Multiple Instances of the Same Microservice BUT with Different Secrets


I would like to run 3 instances of the same exact microservice but would also like that each microservice will read from a different secret with unique parameters and database connection string.

1) Is this something that can be configured in Kubernetes?

2) In case we decide not to use Kubernetes, what is the best way to associate a microservice instance with its secret (appsettings?).

-- user1409708

1 Answer


When you say: same exact microservice, do you mean "same image" or "same deployment"? Are these part of the same replicaset or they are "independent"? Is this a multi-tenant where each "instance" is processing requests for a tenant?

If they are different deployments, they that can easily be done because in k8s they are different and each can have it's own config/secrets.

If they are the same deployment/replicaset; then I'd question why you need this?

-- Mohammad Shaddad
Source: StackOverflow