Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

Kubernetes configmaps: How to update configmap automatically into pods?

Spread the Knowledge

We often come acorss following questions while working with ConfigMap and secret are as follows;

  • How to Updating Kubernetes Deployments on a ConfigMap Change?
  • How Mounted ConfigMap is updated automatically in pods?
  • While changing in configmap it doesn’t reflect automatically, every time I have to restart the pod. How can I do it automatically?

Answer:

To update a configmap or secret resource which depends on a deployment(pod). Obviously, updating them is not a big deal. But how would you notify to relevant deployment/pod?

Method 1: Manual restart a pod/deploy which would update volume with latest configmaps and secrets.

kubectl v1.15 now provides a rollout restart sub-command that allows you to restart Pods in a Deployment – taking into account your surge/unavailability config – and thus have them pick up changes to a referenced ConfigMap, Secret or similar. It’s worth noting that you can use this with clusters older than v1.15, as it’s implemented in the client.

Example usage: kubectl rollout restart deploy/admission-control to restart a specific deployment. Easy as that!

$ kubectl rollout restart deploy nginx -n dev

Method 2: Automatic how would you notify to relevant deployment/pod on configmaps and secrets changes?

There are very good reference for this scnario are given below;

  • https://medium.com/@harik8/kubectl-restart-po-deploy-a5b4c6d523fe
  • https://blog.questionable.services/article/kubernetes-deployments-configmap-change/
Rajesh Kumar