Video in progress
What risks come with centrally managed configuration (Spring Cloud Config, ConfigMap, a feature flag service)?
Central config is the ability to break every service at once with a single change. So config changes need the same review, versioning, gradual rollout and fast rollback as code.
📖 Answer
Many big incidents started not from a code deploy but from a config change. The reason is simple: code goes through CI, tests and a canary, while config is often "I changed one line" and it spreads everywhere in an instant.
I split config into three kinds:
- Static, shipped with the deploy. Port, pool size, dependency URLs. In the image or Helm values, in git, with review. It changes on a pod restart, which is good, because a rolling deploy acts as a canary itself.
- Dynamic operational settings. Timeouts, rate limits, log level. Reloaded through
@RefreshScopeor the Spring Cloud Config bus. Risky: all instances update at once. I put gradual rollout and validation on these too (for example, a timeout of 0 or a negative value is rejected). - Feature flags. Switching a business feature on or off, for a share of users. A separate service (Unleash, LaunchDarkly or your own system). Flags should have an owner and a removal date too, otherwise after a year the code is left with 300 dead flags.
The central config server is itself a risk point: if it goes down, new pods can't start. spring.config.import: optional:configserver: with a local fallback, or rendering config into a ConfigMap, reduces this dependency.
Another issue is config drift: a value someone changed by hand in prod differs from git, and the next deploy "silently" reverts it. With GitOps (Argo CD, Flux), git becomes the single source of truth.
And every config change should be visible in traces and logs: an answer to "who changed what at 14:03" cuts incident analysis from hours to minutes.
Sign up to mark studied questions and save your progress.