Quantcast
Viewing all articles
Browse latest Browse all 49

Answer by blacktide for Kubernetes - create secret with a label using cli in a single line

There isn't an option in the kubectl create secret command to add a label.

You will need to run a second command to add the label:

kubectl label secret my-secret -n myns "foo=bar"

But you could technically do it on one line like:

kubectl create secret generic my-secret ... && kubectl label secret my-secret "foo=bar"

Or do as @larsks suggests which is much better for job security.


Viewing all articles
Browse latest Browse all 49

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>