更新Istio-IngressGateway TLS证书

时间:2020-08-27 17:38:48

标签: kubernetes ssl-certificate istio

我有一个场景,我需要每24小时更新一次Ingress网关tls cert (/etc/istio/ingressgateway-certs/tls.crt)并密钥。我可以使用C#Kubernetes客户端获取原始字节并创建机密,但是除非Ingress Gateway重新启动,否则它不会获取更新的证书。是否可以通过代码来实现重新启动入口网关部署?

任何其他建议也将受到高度赞赏。

1 个答案:

答案 0 :(得分:2)

您正在通过文件引用来安装证书/密钥。 Istio现在支持SDS,因此您可以通过credentialName 来安装证书。此模式将检测到新证书,而无需重新启动。来自文档:

 apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: mygateway
spec:
  selector:
    istio: ingressgateway # use istio default ingress gateway
  servers:
  - port:
      number: 443
      name: https
      protocol: HTTPS
    tls:
      mode: SIMPLE
      credentialName: httpbin-credential # must be the same as secret
    hosts:
    - httpbin.example.com

顺便说一句:文档指出...

机密名称不应以istio 或prometheus开头,并且机密不应包含令牌字段。

https://istio.io/latest/docs/tasks/traffic-management/ingress/secure-ingress/#configure-a-tls-ingress-gateway-for-a-single-host