Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubectl create namespace with label

Is there a way to create a namespace with one label using kubectl?

e.g.

kubectl create ns <newnamespace> label=appid:foo12

as opposed to using kubectl apply -f <somefile>

like image 567
Simply Seth Avatar asked May 09 '26 06:05

Simply Seth


1 Answers

This may help you:

kubectl create namespace namespace_name
kubectl label namespaces namespace_name labelname=value --overwrite=true
like image 166
Mahesh Wabale Avatar answered May 11 '26 19:05

Mahesh Wabale



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!