I am using kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml
to create deployment.
I want to create deployment in my namespace examplenamespace
.
How can I do this?
There are three possible solutions.
kubectl
command:kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml -n my-namespace
yaml
files: apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
namespace: my-namespace
~/.kube/config
:apiVersion: v1
kind: Config
clusters:
- name: "k8s-dev-cluster-01"
cluster:
server: "https://example.com/k8s/clusters/abc"
namespace: "my-namespace"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With