【问题标题】:EKS + Route53+Istio Gateway + Cert-Manager + letsencryptEKS + Route53+Istio Gateway + Cert-Manager +letsencrypt
【发布时间】:2020-07-15 16:49:41
【问题描述】:

我有一个配置了 Iitio 入口网关的 EKS 集群,并且我的 dns 域 (test.com) 托管在 route53 中。我想为我的域生成 Letsencrypt 证书。我正在使用以下版本 certmanager(0.14.1)、Istio (1.6)、Kubernetes (1.17)。能否请您提供要遵循的步骤列表。

【问题讨论】:

    标签: amazon-route53 lets-encrypt istio amazon-eks cert-manager


    【解决方案1】:

    我不太了解如何为 istio 完成设置,但对于 ingress,它是以下方式,希望同样的方式也可以在那里工作。

    您可以从here 下载 cert-manager helm chart,然后您必须为流量路由创建入口规则,并且要在那里执行 TLS 终止,您可以遵循 this stackoverflow link

    请使用

    apiVersion: cert-manager.io/v1alpha2

    在 clusterissuer 中,如果该 stackoverflow 帖子中存在的 clusterIssuer 的 apiVersion 不可接受

    【讨论】:

    • 这在过去使用 istio 的 ppl 中有效,我想也适用于你
    【解决方案2】:

    关于集成 cert-menager 和 istio 有相关的documentation

    证书管理器

    配置

    请咨询cert-manager installation documentation 以开始使用。使用 Istio 无需进行特殊更改。

    用法

    Istio 网关 cert-manager 可用于向 Kubernetes 写入秘密,然后网关可以引用该秘密。要开始使用,请在 cert-manager documentation 之后配置证书资源。证书应该在与 istio-ingressgateway 部署相同的命名空间中创建。例如,证书可能如下所示:

    apiVersion: cert-manager.io/v1alpha2
    kind: Certificate
    metadata:
      name: ingress-cert
      namespace: istio-system
    spec:
      secretName: ingress-cert
      commonName: my.example.com
      dnsNames:
      - my.example.com
      ...
    

    一旦我们创建了证书,我们应该会看到在 istio-system 命名空间中创建的秘密。然后可以在 credentialName 下的网关的 tls 配置中引用它:

    apiVersion: networking.istio.io/v1alpha3
    kind: Gateway
    metadata:
      name: gateway
    spec:
      selector:
        istio: ingressgateway
      servers:
      - port:
          number: 443
          name: https
          protocol: HTTPS
        tls:
          mode: SIMPLE
          credentialName: ingress-cert # This should match the Certifcate secretName
        hosts:
        - my.example.com # This should match a DNS name in the Certificate
    

    Kubernetes Ingress

    cert-manager 通过配置annotation on the Ingress object 提供与 Kubernetes Ingress 的直接集成。如果使用此方法,则 Ingress 必须与 istio-ingressgateway 部署位于同一命名空间中,因为只能在同一命名空间中读取机密。

    或者,可以按照Istio Gateway 中的描述创建证书,然后在 Ingress 对象中引用:

    apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
      name: ingress
      annotations:
        kubernetes.io/ingress.class: istio
    spec:
      rules:
      - host: my.example.com
        http: ...
      tls:
      - hosts:
        - my.example.com # This should match a DNS name in the Certificate
        secretName: ingress-cert # This should match the Certifcate secretName
    

    另外还有一个@chrisnyc 在 istio 讨论中提出的example


    希望你觉得这很有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-27
      • 2020-10-25
      • 1970-01-01
      • 1970-01-01
      • 2019-12-21
      • 1970-01-01
      • 2021-12-02
      相关资源
      最近更新 更多