Updated configMap.yaml but it's not being applied to Kubernetes pods

吃可爱长大的小学妹 提交于 2020-12-13 16:05:53

问题


I'm editing configMap.yaml in my Helm chart, but when I log in to one of my pods to check if it's being applied, it doesn't reflect my changes. I'm fairly new to Helm charts so any help is appreciated.


回答1:


For updating your ConfigMap you can also use kubectl patch command if you find it more fitting for you. Documentation regarding it can be found here.

For applying the changes there is a very useful tool called Reloader. Reloader can watch changes in ConfigMap and Secret and do rolling upgrades on Pods with their associated DeploymentConfigs, Deployments, Daemonsets and Statefulsets.

Please let me know if that helped.




回答2:


After you edited cm, should restart you pod to reload new value.

  1. edit yaml file.
  2. kubectl apply -f cm.yaml
  3. kubectl delete po your-pod -n your-ns if controlled by a controller. If just pod, kubectl delete -f pod.yaml then kubectl create -f pod.yaml.


来源:https://stackoverflow.com/questions/56979319/updated-configmap-yaml-but-its-not-being-applied-to-kubernetes-pods

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!