0

I have a small application with one deployment, service and 3 configMaps. It is normal Kubernetes YAML files, not a HELM setup. Is it possible to add the configMap checksum in annotations just like we can do in HELM so that whenever the configMap get updated, the deployment gets restarted.

HELM Reference: https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments

Any help will be appreciated. Thanks in advance!

David Maze
  • 130,717
  • 29
  • 175
  • 215
Ankit Soni
  • 95
  • 2
  • 13
  • The Helm setup works by calculating a hash of the ConfigMap content at deploy time and including that as a Pod annotation. That works because Helm can actually run code at deploy time. Plain `kubectl` can't do it, but something that used the Kubernetes API to construct a Deployment would be able to. – David Maze Aug 31 '23 at 10:54

1 Answers1

0

You will need to use a "ConfigMap Reloader".

Stakater Reloader is a Kubernetes Controller which can watch changes in ConfigMap and Secret and do rolling upgrades on Pods with their associated DeploymentConfigs, Deployments, Daemonsets Statefulsets and Rollouts.

Please refer to these links

  1. https://github.com/stakater/Reloader
  2. https://medium.com/linux-shots/configmap-secret-reloader-automatically-add-reload-data-from-configmap-secret-to-deployments-dc245e06b92c
Raghu
  • 123
  • 7