stakater / Reloader

A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig – [✩Star] if you're using it!
https://docs.stakater.com/reloader/
Apache License 2.0
7.72k stars 513 forks source link

Shared ConfigMap by multiple services, but can not handle specific reload by config map key for specific service. #786

Open supanut1911 opened 1 week ago

supanut1911 commented 1 week ago

Describe the bug Hi, I got issue with Stakater. I use 1 configmap to share with multiple services and when I update value of config map it will impact (reload / redeploy) all service that helm-value use key in config map.

To Reproduce Steps to reproduce the behavior Example configmap

kind: ConfigMap
metadata:
  name: xxxxx
  namespace: yyyy
data:
  animal: "cat"
  animal2: "bat"

Example helm-value

configMapRef:

FOOOPTIONS:
     configMapName: foo-bar-bar
     configMapKey: animal

animal is used by helm-value of serviceA and animal2 is used by helm-value of serviceB. But when I reassign new value of animal ("dog" instead "cat"), Stakater will reload both serviceA and serviceB.

Expected behavior When I update animal value I need Stakater repload / redeploy only service A. What are some ways to solve this problem?

Screenshots If applicable, add screenshots to help explain your problem.

Environment

MuneebAijaz commented 1 week ago

duplicate of https://github.com/stakater/Reloader/issues/507. We are open for PRs for this enhancement

faizanahmad055 commented 1 week ago

Reloader does not support the reload based on specific data field changes. It looks at the complete data when performing the reload. In your case, the only solution is to split the configmap among different services/applications. However, as Muneeb mentioned, this is an enhancement that can be added in future by contribution.

supanut1911 commented 1 week ago

@MuneebAijaz @faizanahmad055 Many thanks for your assistance.