Agentic AI with Java: Live Cohort
Kubernetes

Introduction

What Kubernetes is, the problem it solves, the core vocabulary from Pod to Helm chart, how desired state works, and how Kubernetes on EKS fits with Docker, Terraform, Jenkins and monitoring tools.

Containers solved packaging. A Docker image runs the same way on a laptop, a test server and production. But a container on its own is still just a process on one machine. If the machine dies, the container dies. If traffic doubles, nobody starts more copies. If you push a new image, someone has to stop the old containers and start the new ones, carefully, on every server.

Kubernetes takes over that work. You describe the state you want ("three copies of this image, reachable on port 80, using this configuration") and Kubernetes keeps the cluster in that state: it places containers on machines with room, replaces anything that fails, spreads traffic across healthy copies, and changes versions step by step when you ask it to.

What Kubernetes is

Kubernetes (often written K8s) is an open source container orchestration platform. Google open sourced it in 2014, based on more than a decade of running its own internal system, Borg. Today it is maintained by the Cloud Native Computing Foundation and is the standard way to run containers in production on every major cloud and in private data centres.

It is not a replacement for Docker. Docker (or any OCI tool) builds the images. Kubernetes runs them across a cluster of machines and keeps them running.

Desired state: the one idea behind everything

Almost everything in Kubernetes follows the same loop:

You write YAML (desired state)  ->  kubectl apply  ->  API server stores it in etcd
        ^                                                     |
        |                                                     v
  you change the YAML              controllers compare desired state with actual state
                                   and act until they match (create, delete, replace)

That loop is why a deleted pod comes back, why scaling is a one-line change, and why a rolling update happens without you touching individual containers. Once this idea clicks, every new object in the course is "another kind of desired state with its own controller".

Core vocabulary

TermMeaningFirst covered in
ClusterA control plane plus worker nodes that run your workloadsArchitecture
Control planeAPI server, etcd, scheduler, controller manager. On EKS, run by AWSArchitecture
NodeA machine (an EC2 instance on EKS) that runs podsArchitecture
kubectlThe command line client for every Kubernetes clusterInstalling the tools
ManifestA YAML file describing objects: apiVersion, kind, metadata, specManifest files
PodThe smallest deployable unit: one or more containers sharing an IPFirst pod
ServiceA stable address and load balancer for a group of podsServices
NamespaceA logical partition of one clusterNamespaces
Label / selectorKey-value tags on objects, and queries that find themLabels
ReplicaSetKeeps N identical pods runningReplicaSets
DeploymentManages ReplicaSets for rolling updates and rollbacksDeployments
DaemonSetRuns one pod on every nodeDaemonSets
StatefulSetRuns pods with stable names and their own storage, for databasesStatefulSets
PersistentVolume / ClaimStorage that outlives pods, on EKS backed by EBSPV and PVC
ConfigMap / SecretConfiguration and sensitive values kept outside the imageConfigMaps and Secrets
HPAHorizontalPodAutoscaler: adds and removes pods based on loadHPA
ResourceQuotaLimits on what a namespace may consumeResourceQuota
Job / CronJobRun work to completion, once or on a scheduleJobs
Helm chartA packaged, configurable set of manifestsHelm
Argo CDGitOps tool that keeps the cluster in sync with GitArgo CD
Prometheus / GrafanaMetrics collection and dashboardsPrometheus

Why Amazon EKS

You can run Kubernetes on your laptop (minikube, kind), on your own servers (kubeadm), or as a managed service. This course uses Amazon Elastic Kubernetes Service (EKS):

  • AWS runs and patches the control plane across multiple Availability Zones
  • Worker nodes are ordinary EC2 instances in a managed node group
  • type: LoadBalancer Services create real AWS load balancers, and PersistentVolumes can be real EBS volumes
  • eksctl creates the whole setup with one command and deletes it with another

The manifests you write are standard Kubernetes and work on any conformant cluster. Only the cluster setup and a few integrations are EKS specific.

How Kubernetes fits with the rest of the bootcamp

Git, Jenkins, Docker and a registry produce an image that Kubernetes on EKS pulls and runs as a Deployment with a Service, ConfigMaps and an HPA. Helm and Argo CD sync YAML from Git, Terraform or eksctl create the cluster, and Prometheus and Grafana watch it
ToolRole around Kubernetes
GitStores application code and the Kubernetes YAML
Maven, DockerBuild the application and package it into an image
Docker Hub, Amazon ECRRegistries the cluster pulls images from
Terraform, eksctlCreate the cluster and its VPC, node groups and IAM roles
JenkinsRuns the CI pipeline: build, test, push the image, update the manifest
Helm, Argo CDPackage the manifests and deploy them to the cluster from Git
Prometheus, GrafanaWatch the cluster and the applications running on it

The final Jenkins project of the bootcamp ties these together into one pipeline that ends with a rollout on Kubernetes.

What Kubernetes does not do

Kubernetes is powerful, but it is not magic. It does not build your images, write your Dockerfiles, fix your application's bugs, back up your databases by itself, or make a badly designed app scale. It also adds real operational complexity. For a single small application, a VM with Docker Compose or a simpler service such as Amazon ECS may be the better choice. Kubernetes earns its place when you run many services, deploy often, and need scaling, self-healing and consistent tooling across environments.

Start with the foundations

The first section explains why orchestration exists and how the cluster is built. Do not skip the architecture lesson: almost every error message later in the course points to one of its components.

Official references


Written By: Shramik Masti

How is this guide?

Last updated on