EKS+Route53+Istio网关+证书管理器+letsencrypt



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

我不太清楚如何为istio进行设置,但对于ingress,它是以下方式,希望同样的方式也能在那里工作。

你可以从这里下载cert-manager helm图表,然后你必须创建流量路由的入口规则,为了在那里进行TLS终止,你可以遵循这个stackoverflow链接

请使用

apiVersion: cert-manager.io/v1alpha2

在clusterissuer中,如果stackoverflow帖子中出现的clusterissuer的apiVersion是不可接受的

有关于集成证书menager和istio的相关文档。

证书管理器

配置

请参阅证书管理器安装文档以开始操作。使用Istio不需要特别的更改。

使用

Istio网关cert管理器可以用于向Kubernetes写入机密,然后网关可以引用该机密。要开始,请按照证书管理器文档配置证书资源。证书应该在与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通过在Ingress对象上配置注释,提供与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-discuss上做了一个例子。


希望您觉得这很有用。

最新更新