Hi
I was creating a service with the command
kubectl -n mynamespace expose deploy .... --dry-run=client -o yaml > service.yaml
and it seems that the namespace is not taken into account in the yaml file.
Is it normal ?
Hi
I was creating a service with the command
kubectl -n mynamespace expose deploy .... --dry-run=client -o yaml > service.yaml
and it seems that the namespace is not taken into account in the yaml file.
Is it normal ?
Hello all,
If the namespace was not yet available, the error message will be thrown:
Error from server (NotFound): namespaces "mynamespace" not found
I give it a try on my end and it worked just fine, the namespace apear under metadata attribute, which kubectl
version do you have on your machine @stephane.hordoir ?
Trung.
Try
kubectl create namespace test
kubectl -n test create deployment nginx --image=nginx
kubectl -n test expose deployment nginx --port 80 --dry-run=client -o yaml > service.yml
Also, you can check the steps in the attached gif
Perfect,
Thanks for the review, it is perfectly clear, I must have made a mistake.