https://github.com/stakater/Reloader
它允许你定义要监视的配置映射或机密,当它们更新时,将执行部署的滚动更新。这是一个例子:
您有部署foo和名为foo-configmap的ConfigMap。您希望每次更改configmap时都滚动部署的pod。您需要使用以下命令运行Reloader:
kubectl apply -f https://raw.githubusercontent.com/stakater/Reloader/master/deployments/kubernetes/reloader.yaml
然后在部署中指定此注释:
kind: Deployment
metadata:
annotations:
configmap.reloader.stakater.com/reload: “foo-configmap”
name: foo
…
kind: Deployment
metadata:
annotations:
secret.reloader.stakater.com/reload: “foo-configmap”
name: foo
…