I want to create multiple namespace from command line using kubectl. i dont want to create them from YAML manifest. say,
kubectl create ns app1,app2,app3
can this be done?
You could chain together 2 kubectl commands like so:
kubectl create ns app1 && kubectl create ns app2...
kubectl
expects exactly one namespace:
➜ / kubectl create ns
error: exactly one NAME is required, got 0
depending on your shell you could pack it into a loop. here's an example for bash and zsh:
➜ / foreach ns (ns1 ns2 ns3); kubectl create ns $ns; end