Is there any other way to update the config map for deployment without having to restart the pod?

+1 vote
How do i update the config map without restarting the kubernetes pod?
Jul 19, 2019 in Kubernetes by Namik
• 1,210 points

1 answer to this question.

0 votes
  • Well, you need to have some way of triggering the reload. 

  • Either do a check every minute or have a reload endpoint for an API or project the configmap as a volume, could use inotify to be aware of the change. 

  • It depends on how the configmap is consumed by the container. If env vars, then no. If a volumeMount, then the file is updated in the container ready to be consumed by the service but it needs to reload the file.

  • The container does not restart. if the configmap is mounted as a volume it is updated dynamically. if it is an environment variable it stays as the old value until the container is restarted.volume mount the configmap into the pod, the projected file is updated periodically. NOT realtime. then have the app recognise if the config on disk has changed and reload.

answered Jul 19, 2019 by Sirajul
• 50,480 points

Related Questions In Kubernetes

0 votes
1 answer
0 votes
1 answer

is there any way we can run kubectl command without sudo acess in KOPS kubernetes?

Yes, you can use kubectl on kops ...READ MORE

answered Aug 28, 2019 in Kubernetes by Adarsh
0 votes
2 answers

Is there a way to start a cron job manually

You can create a simple job based ...READ MORE

answered Sep 18, 2018 in Kubernetes by Nilesh
• 6,960 points
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 11, 2019 in Kubernetes by Kalgi
• 51,830 points

reshown Apr 12, 2019 by Kalgi 1,532 views
0 votes
1 answer

Is there a way to make a pod to automatically come up when the host restarts?

Yes using replication controller but it may ...READ MORE

answered Jul 19, 2019 in Kubernetes by Sirajul
• 50,480 points
0 votes
1 answer

Is it possible for containers within a pod to communicate with each other?

Yes, it is possible for containers to ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 50,480 points