【发布时间】:2021-07-28 11:08:14
【问题描述】:
cert-manager的证书文件挂载在nginx卷上,正在使用中。
例如
nginx deploy.yaml -
volumes:
- name: secret-volume
secret:
secretName: my.test.app.com
- name: configmap-volume
configMap:
name: nginxconfigmap
containers:
- name: nginxhttps
image: bprashanth/nginxhttps:1.0
ports:
- containerPort: 443
- containerPort: 80
volumeMounts:
- mountPath: /etc/nginx/ssl
name: secret-volume
- mountPath: /etc/nginx/conf.d
name: configmap-volume
和我的 nginx.conf 文件在
ssl_certificate /etc/nginx/ssl/tls.crt;
ssl_certificate_key /etc/nginx/ssl/tls.key;
而且效果很好。 另外,证书由cert-manager顺利补发。
但是,由于重新颁发的证书文件在nginx容器中没有更新,所以从浏览器访问时说证书已经过期。
如果我强制重启 pod 没有问题,但我想自动化它。
不知道有没有办法在不强制重启pod的情况下自动更新证书。
【问题讨论】:
-
您所包含的
YAML清单未连接到nginx-ingress的假设是否正确?请说明证书未更新的步骤(Secret、Pod内部或nginx本身)?根据文档Secret应该是updated eventually 如果它被挂载为Volume。同样根据this thread,需要重新加载才能使用新证书。
标签: nginx ssl kubernetes google-kubernetes-engine cert-manager