Jeff
Jeff Cloud Systems Arcitect with a focus on Kuberetes
1 min read

Copy Kubernetes Secret to Another Namespace

Copy Kubernetes Secret to Another Namespace

Copy Kubernetes Secret to Another Namespace


Sometimes you just want to share a secret between namespaces, for example, a Docker Registry Credential.

Replace CurrentNameSpace and NewNameSpace with your respective namespaces. Also, change the SecretName, pretty simple

kubectl get secret SecretName -n CurrentNameSpace --export -o yaml |\
kubectl apply -n NewNameSpace -f -

That's it