B
B
Benedictus2020-10-13 20:36:58
Kubernetes
Benedictus, 2020-10-13 20:36:58

What is the difference between kubectl run and kubectl create deployment?

I decided to make friends with k8s here at my leisure, but in the process of deploying minikube there was a misunderstanding (k8s generally looks quite cumbersome)

minikube raised here according to this guide https://habr.com/ru/company/flant/blog/333470/

But after the kubectl run command hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080 not created deployment

[[email protected] root]$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
default hello-minikube 1 /1 Running 0 79s
kube-system coredns-f9fd979d6-xklkv 1/1 Running 0 23h
kube-system etcd-minikube 1/1 Running 0 23h
kube-system kube-apiserver-minikube 1/1 Running 0 23h
kube-system kube-controller-manager-minikube 1/1 Running 0 23h
kube-system kube-proxy-5m82t 1/1 Running 0 23h
kube-system kube-scheduler-minikube 1/1 Running 0 23h
kube-system storage-provisioner 1/1 Running 0 23h

[[email protected] root]$ kubectl get deployments
No resources found in default namespace.


At the same time, the Minikube documentation indicates the kubectl create deployment command, which I used as an alternative.

kubectl create deployment hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080

after which deployment appeared

[[email protected] hello-node]$ kubectl get pods
NAME READY STATUS RESTARTS AGE
hello-minikube-6d4df66d87 -xpklt 1/1 Running 0 39s
[[email protected] hello-node]$ kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
hello-minikube 1/1 1 1 53s

So what is the difference between kubectl run and kubectl create deployment?

And why is the deployment not created during kubectl run?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
I
Ivan Koryukov, 2020-10-13
@Benedictus

the run command starts one pod
and create deployment creates a deployment, which in turn creates a pod

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question