Kubernetes - sharing secret across namespaces

matth3o picture matth3o · Sep 19, 2017 · Viewed 51.2k times · Source

Is there a way to share secrets across namespaces in Kubernetes?

My use case is: I have the same private registry for all my namespaces and I want to avoid creating the same secret for each.

Thanks for your help.

Answer

Innocent Anigbo picture Innocent Anigbo · Sep 19, 2017

Secret API objects reside in a namespace. They can only be referenced by pods in that same namespace. Basically, you will have to create the secret for every namespace.

https://kubernetes.io/docs/concepts/configuration/secret/#details