【发布时间】:2020-05-10 04:01:23
【问题描述】:
是否有一个通用(或任何)工作流程来为在 Istio VirtualService & Gateway 中配置的应用程序颁发和更新 LE 证书? Istio 文档仅涵盖 Ingress 用例,我认为它不涵盖处理续订。
我的实际用例是使用通配符证书和自定义应用程序来实现这一点,但为了简单起见,我想使用安装在 Istio 演示中的 Prometheus 服务来解决这个问题。 VirtualService 和 Gateway 对于我的实际用例来说是必需的。
这是我目前通过 https 使用自签名证书为 Prometheus 提供服务的方式。我在 GKE K8s 版本 1.15.11 上运行 Istio 版本 1.5.2。证书管理器也已安装。
那么我该如何调整它以使用 Cert Manager 为 prom.example.com 颁发和更新 LE 证书?
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: prometheus-gateway
#namespace: istio-system
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 443
name: http-prom
protocol: HTTPS
hosts:
- "prom.example.com"
tls:
mode: SIMPLE # enables HTTPS on this port
serverCertificate: /etc/istio/ingressgateway-certs/tls.crt
privateKey: /etc/istio/ingressgateway-certs/tls.key
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: prometheus-vs
spec:
hosts:
- "prom.example.com"
gateways:
- prometheus-gateway
http:
- match:
- port: 443
route:
- destination:
host: prometheus
port:
number: 9090
【问题讨论】:
标签: kubernetes lets-encrypt istio cert-manager