Running one container is easy. Running fifty of them across several servers, restarting the ones that crash, adding more when traffic grows and updating them without downtime is not. That is the job of Kubernetes: you describe the state you want, and it works continuously to keep the cluster in that state.

The smallest unit in Kubernetes is the pod, one or more containers that run together and share a network address. You rarely create pods by hand. Instead you create a Deployment, which says which image to run and how many copies (replicas) you want. If a pod dies or a server fails, the Deployment notices that fewer copies are running than asked for and starts new ones.

Pods come and go, and each new one gets a new address, so other apps cannot rely on them directly. A Service gives a set of pods one stable name and address and spreads requests across them. To reach the app from outside the cluster, an Ingress routes web traffic by host name or path to the right Service.

Kubernetes can only keep an app healthy if it knows what healthy means. A readiness probe tells it when a pod is ready to receive traffic, so requests are not sent to an app that is still starting. A liveness probe tells it when a pod is stuck, so it can be restarted. Setting both is one of the simplest ways to make an app more reliable.

Every container should also declare its resource requests and limits: how much CPU and memory it needs, and the most it may use. Requests let the scheduler place pods on servers with enough room. Limits stop one misbehaving app from starving everything else on the same server.

With requests in place, scaling becomes automatic. The Horizontal Pod Autoscaler watches a measure such as average CPU use and adds replicas when it rises above your target, then removes them when it falls. On managed platforms such as Azure Kubernetes Service (AKS) and Amazon EKS, the cluster autoscaler can add and remove whole servers too, so you pay for extra capacity only while you need it.

Updates are handled the same declarative way. Change the image version in the Deployment and Kubernetes performs a rolling update, starting new pods and removing old ones a few at a time, waiting for each new pod to pass its readiness probe. If something goes wrong, kubectl rollout undo returns to the previous version.

Most teams keep these definitions as YAML files in Git and package them with Helm, so every environment is created from the same reviewed source. Our DevOps course takes you from your first pod to deploying a real application on a managed cluster, with autoscaling and zero-downtime updates.