Create secret for all namespaces

1/7/2021

When I create secret with Rancher and select it should be visible in all namespaces, it creates a secret without namespace tag and with namespaceId: null.

How to create such secret without Rancher? When I use kubectl, it always binds it to the namespace from the command context.

-- 9ilsdx 9rvj 0lo
kubectl
kubernetes
kubernetes-secrets
rancher

1 Answer

1/7/2021

kubectl currently does not support creating secrets across namespaces.

They are available to a single namespace. Rancher supports it creating secrets at the project level. it will replicate the secret to all namespaces in the project (present and future). also, functionality is not in the rancher cli yet.

there are some work around option available to replicate the secret and configmap across the namespace in Kuberenetes.

You can check this out open source projects:

  1. https://github.com/zakkg3/ClusterSecret
  2. https://github.com/mittwald/kubernetes-replicator
-- Harsh Manvar
Source: StackOverflow