I want to debug the pod in a simple way, therefore I want to start the pod without deployment.
But it will automatically create a deployment
$ kubectl run nginx --image=nginx --port=80 deployment "nginx" created So I have to create the nginx.yaml file
--- apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: - name: nginx image: nginx ports: - containerPort: 80 And create the pod like below, then it creates pod only
kubectl create -f nginx.yaml pod "nginx" created How can I specify in the command line the kind:Pod to avoid deployment?
// I run under minikue 0.20.0 and kubernetes 1.7.0 under Windows 7
Without a deployment, Pods can still be created and run through unmanaged ReplicaSets. While you will still be able to scale your application you lose out on a lot of base functionality deployments provide and drastically increase your maintenance burden.
To create a pod using the nginx image, run the command kubectl run nginx --image=nginx --restart=Never . This will create a pod named nginx, running with the nginx image on Docker Hub. And by setting the flag --restart=Never we tell Kubernetes to create a single pod rather than a Deployment.
kubectl run nginx --image=nginx --port=80 --restart=Never
--restart=Always: The restart policy for this Pod. Legal values [Always,OnFailure,Never]. If set toAlwaysa deployment is created, if set toOnFailurea job is created, if set toNever, a regular pod is created. For the latter two--replicasmust be1. DefaultAlways[...]
see official document https://kubernetes.io/docs/user-guide/kubectl-conventions/#generators
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