Quick revision
The short answer
First we list what each approach really gives us, dynamic refresh, audit, encryption and availability needs, and which services actually use those features. Usually the answer favours Kubernetes ConfigMaps and Secrets managed through GitOps, which give versioned, reviewed configuration with no runtime dependency. If we keep the config server for some needs, its import must be optional or cached, because at startup it is a hard dependency. We migrate service by service, moving properties and importing them with spring.config.import or config trees, and keep secrets in a dedicated secret store whichever approach we choose.
What to remember
In this answer, we saw that the outage blocked deploys because the config server was a hard dependency at startup for half the fleet. Listing what each approach gives, refresh, audit, encryption and availability, usually points to ConfigMaps and Secrets through GitOps, with runtime needs met by a feature flag service. If the config server stays, its imports must be optional or cached. We migrate one service at a time by importing the new source after the old one and comparing values, and we keep secrets in a dedicated secret store whatever we choose.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
First we list what each approach really gives us, dynamic refresh, audit, encryption and availability needs, and which services actually use those features. Usually the answer favours Kubernetes ConfigMaps and Secrets managed through GitOps, which give versioned, reviewed configuration with no runtime dependency. If we keep the config server for some needs, its import must be optional or cached, because at startup it is a hard dependency. We migrate service by service, moving properties and importing them with spring.config.import or config trees, and keep secrets in a dedicated secret store whichever approach we choose.
Why this question is asked
Having two configuration systems is costly in quiet ways: two places to look during an incident, two sets of access rules, two kinds of audit evidence, and two failure modes. The outage in this scenario shows the sharpest cost: a central server that every service needs at startup turned a single failure into a platform-wide freeze, because no new pod could start. Interviewers ask this because it combines an architectural decision with a migration plan and an incident lesson. In this answer, we will understand why the outage blocked deploys, compare what each approach gives, make the choice, plan the migration service by service, and treat secrets separately.
1Why One Outage Blocked Every Deploy
A Spring Cloud Config client fetches its properties from the config server while it starts, before the application context is created. If the import is not optional and the server does not answer, the application cannot start; with fail-fast enabled it stops at once, otherwise it may retry and then stop. During normal operation nobody notices, because running instances already have their configuration.
A deployment, though, replaces running instances with new ones, and autoscaling adds new ones. So when the server was down, every deployment and every scale-up of the half of the fleet that uses it failed at the same point, while the ConfigMap half deployed normally. The server had become a hard dependency of every startup.
6 messages in order. Play them, or step through them one at a time.
Running pods are fine; anything new cannot start.
2What Each Approach Gives
Before choosing, we list the features each approach provides and, more importantly, which services actually use them. A config server offers dynamic refresh without restarts, a central view of all configuration, encryption of values at rest, and an access log. ConfigMaps and Secrets managed with GitOps offer versioned and reviewed changes, no runtime dependency, rollout through the same canary as code, and native Kubernetes tooling. Each has an availability need: the config server must be highly available for startups, while GitOps only needs the Kubernetes API, which the cluster needs anyway.
In most fleets, the inventory shows that few services really use dynamic refresh, and those that do mainly refresh a handful of feature flags. The audit need is often better met by Git history than by the server's logs.
| Need | Spring Cloud Config | ConfigMaps + GitOps |
|---|---|---|
| Dynamic refresh | yes, with refresh or a bus | no; a rollout, or file reload |
| Audit of changes | Git backend history | Git history and PR review |
| Encryption | server-side encrypted values | Secrets plus a secret store |
| Startup dependency | the server must be up | only the Kubernetes API |
| Rollout safety | refresh hits all instances | canary and rollback like code |
| Extra service to operate | yes, highly available | no |
3Making the Choice
With that inventory, I would choose ConfigMaps and Secrets through GitOps as the single approach for the fleet. It removes a runtime dependency, gives the review and history auditors ask for, and fits the deployment pipeline we already have. The few true needs for runtime change, mostly feature flags, are better served by a feature flag service built for that, with gradual targeting and its own audit.
If some organisation-specific reason means we keep the config server, the outage lesson still applies: every import must be optional, or the client must start from a cached copy of the last known configuration, so that the server can be down without blocking startups. Keeping it highly available is necessary but not sufficient; the clients must tolerate its absence.
4Migrating Service by Service
The migration is a series of small, reversible steps per service, not a big switch. For each service, we export its effective configuration from the config server for each environment, write it into a ConfigMap in the GitOps repository, and mount it as a file or config tree. The service imports it with spring.config.import, while the config server import is still there, so for a release both sources exist and we can compare.
- Export effective config per environmentfrom the config server
- Commit it as a ConfigMap in GitOpsreviewed like code
- Import the file after the server importthe file wins, the server is a fallback
- Do env endpoint values match?compare key properties per environmentYesRemove the configserver importNoFix the ConfigMap and compare again
- Delete the service's files from the config repoone fewer client
5 steps in order. Play them, or step through them one at a time.
Notice the order of imports: the later import wins, so the ConfigMap values take over while the server remains as a fallback. Comparing the Actuator env endpoint before and after proves that every key now comes from the new source with the same value. Once that holds in every environment, we remove the server import and delete the service's files from the config repository. We start with low-risk services, track progress per service, and retire the server when the last client is gone.
5Secrets Stay in a Dedicated Store
Whichever approach wins, secrets should not move from the config server's encrypted values into plain Kubernetes Secrets stored in Git. They belong in a dedicated secret store such as Vault or a cloud secret manager, delivered to the pod by an operator or CSI driver as mounted files, which the service reads as a config tree. The GitOps repository then holds only references to secrets, never their values, and rotation and access audit are handled by the store.
6Follow-up questions
What about services that really rely on runtime refresh?
Look at what they refresh. If it is feature flags, move them to a feature flag service. If it is operational values like rate limits, a rollout with a canary is usually fast enough. For the rare remaining case, Spring Cloud Kubernetes can reload configuration from ConfigMaps, so even then the server is not required.
How would you prevent the same outage during the migration?
Make every existing config server import optional first, as a small change across all clients, before the migration starts. That removes the startup dependency immediately, so another outage only means services start with their fallback configuration.
How do you prove nothing changed for a service?
Compare the property sources and resolved values, for example via the Actuator env endpoint with authorised access or a startup log of key properties, before and after the switch in each environment. A diff of the exported configuration and the new ConfigMap is a good first check.
7Conclusion
In this answer, we saw that the outage blocked deploys because the config server was a hard dependency at startup for half the fleet. Listing what each approach gives, refresh, audit, encryption and availability, usually points to ConfigMaps and Secrets through GitOps, with runtime needs met by a feature flag service. If the config server stays, its imports must be optional or cached. We migrate one service at a time by importing the new source after the old one and comparing values, and we keep secrets in a dedicated secret store whatever we choose.
Open with
First I would make sure the outage cannot repeat, by making every config server import optional, with fail-fast off, so a server outage no longer blocks startups. That is a small change across all clients.
Then, if they want more
Then I would choose based on an inventory of what each approach gives and what services actually use: dynamic refresh, audit, encryption and availability needs. In most fleets few services really need runtime refresh, and those mostly use it for feature flags.
ConfigMaps and Secrets through GitOps give versioned, reviewed changes, canary rollouts and no runtime dependency beyond the Kubernetes API. So I would pick GitOps as the single approach and move true runtime toggles to a feature flag service. If we had to keep the config server, it would stay optional or cached, never a hard dependency at startup.
The migration goes service by service. I export each service's effective configuration per environment, commit it as a ConfigMap, and import it with spring.config.import after the config server import, so the file wins while the server remains a fallback.
I compare the env endpoint values before and after, then remove the server import and the service's files from the config repo. The server is retired when the last client is gone. Secrets go to a dedicated secret store like Vault, delivered as mounted files and read as a config tree, with only references in Git.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Boot reference
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Half of your services read configuration from Spring Cloud Config and half from...": https://scrivio-interview-library.netlify.app/spring-boot/externalized-configuration/1fcc8af005/