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
kubectl run nginx --image=nginx --port=80 --restart=Never
--restart=Always
: The restart policy for this Pod. Legal values [Always
,OnFailure
,Never
]. If set toAlways
a deployment is created, if set toOnFailure
a job is created, if set toNever
, a regular pod is created. For the latter two--replicas
must be1
. DefaultAlways
[...]
see official document https://kubernetes.io/docs/user-guide/kubectl-conventions/#generators