我已经更新了我的kubernetes入口服务的SSL证书,但是我不知道如何重新启动使用更新的证书秘密而不手动删除和重新启动入口实例。这不是理想的选择,因为使用该特定证书(所有人都坐在同一TLD上)。我该如何强制使用更新的秘密?
您不需要删除入口对象即可使用更新的TLS Secret。
GKE Ingress Controller(https://github.com/kubernetes/ingress-gce)自动选择更新的秘密资源并对其进行更新。(如果没有在存储库上打开问题)。
示例:
$ kubectl describe ingress foobar
Name: foobar
Labels: <none>
Namespace: default
Address: 123.234.123.234
Ingress Class: <none>
Default backend: <default>
TLS:
my-secret terminates
(...)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Sync 6m29s loadbalancer-controller TargetProxy "<redacted>" certs updated
Normal Sync 6m25s (x78 over 12h) loadbalancer-controller Scheduled for sync
- 在这里,来自秘密" my-secret"的证书已成功地重新加载了6m29s。
如果您没有看到〜10-20分钟的更改,我建议您琐碎地编辑入口对象(例如,添加标签或注释),以便Ingress Controller再次拾取对象并评估目标状态vs当前状态,然后继续进行更改(更新TLS Secret)。
事实证明其不更新的原因是证书没有正确链接;我上传了没有实际终端证书的CA-Bundle,我想Google如果不是有效的链条,则拒绝更新LB证书。这很奇怪,但是,可以,确定。