Running A Pod
Part of the Introduction to Kubernetes section of Coddy's Terminal journey. Lesson 3 of 45.
Kubernetes does not run containers directly. It runs Pods: a Pod wraps one container (sometimes a few that belong together) and is the smallest thing you can create in a cluster.
The quickest way to start a Pod is kubectl run with a name and an image:
kubectl run web --image=nginxKubernetes answers pod/web created. Compare it with docker run: the image is the same nginx you would pull with Docker, but now the cluster picks a node and starts the container there.
The Pod's name (web) is how you refer to it in every later command. Names must be unique, so running the same command twice fails with AlreadyExists.
Challenge
BeginnerStart a Pod named web from the nginx image with kubectl run.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Introduction to Kubernetes
Practice on your own: Terminal playground