Skip to content

Creating a Pod

Course: Kubernetes Part 1 - chapter 7

There were 5 jargons we learnt about

  1. Cluster
  2. Nodes
  3. Images
  4. Containers
  5. Pods

We have created a cluster of 3 nodes

How can we deploy a single container from an image inside a pod ?

Let’s try to start this image locally - https://hub.docker.com/_/nginx

docker run -p 3005:80 nginx

Try visiting localhost:3005

  • Start a pod
kubectl run nginx --image=nginx --port=80
  • Check the status of the pod
kubectl get pods
  • Check the logs
kubectl logs nginx

  • Describe the pod to see more details

Good questions to ask

  1. How can I stop a pod?
  2. How can I visit the pod? Which port is it available on?
  3. How many pods can I start?