Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
476 views
in Technique[技术] by (71.8m points)

kubernetes - Create secret for all namespaces

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...