Menu
Coddy logo textTech

Creating A Deployment

Part of the Introduction to Kubernetes section of Coddy's Terminal journey. Lesson 11 of 45.

A Pod on its own is fragile: delete it, or let its node fail, and it is gone. A Deployment is a controller that keeps a set of identical Pods running. You say how many copies (replicas) you want and which image; the Deployment creates the Pods and replaces any that disappear.

Create one from the command line:

kubectl create deployment web --image=nginx

Kubernetes answers deployment.apps/web created. List Deployments with kubectl get deployments (or the short form deploy): the READY column shows how many replicas are up out of how many you asked for.

List the Pods and you will find one named like web-t94n2pqrtb-hpv6q. The Deployment names its Pods after itself plus two generated parts, so you never name them yourself. Delete such a Pod and the Deployment immediately starts a replacement.

challenge icon

Challenge

Beginner

Create a Deployment named web from the nginx image, then list the Deployments and the Pods.

Try it yourself

Terminal
quiz iconTest 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