100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
CI/CD with GitHub Actions
35 minintermediate

Deploying to Kubernetes from CI

Kubernetes has become the dominant platform for running containerised workloads in production. Deploying to Kubernetes from a CI/CD pipeline requires a distinct pattern compared to deploying to a bare VM or a managed application platform: instead of pushing files or running a deploy script directly on the target machine, you declaratively describe the desired state in YAML manifests and apply those manifests to the Kubernetes API server. The cluster's reconciliation loops then converge the actual state to match the desired state — pulling the new container image, replacing old pods, updating service routing. This declarative model makes Kubernetes deployments naturally idempotent and auditable, but it requires the CI pipeline to handle manifest management, image tag substitution, and rollout verification correctly. Understanding these mechanics — and the tools that simplify them (kubectl, Kustomize, Helm) — is essential for operating production Kubernetes workloads reliably from GitHub Actions.

Analogy🏏Cricket
🏏 Think of it like cricket: A cricket series is structured in three tiers: the series schedule (which matches are played and when), individual match plans (batting order, bowling rotations, fielding strategy), and specific delivery plans (which balls to bowl to which batsman in which over). The series schedule is the workflow — it defines the overall event. Each match is a job — it runs independently but contributes to the series outcome. Each delivery plan is a step — a specific action with a discrete result. Just as a Test captain doesn't redesign the series schedule for every match but does adjust the bowling plan for each innings, GitHub Actions separates what triggers the automation (workflow) from how independent tasks are parallelised (jobs) from the individual commands executed (steps). The insight is that this separation of concerns is what allows large, complex pipelines to remain manageable — just as a well-structured series plan keeps a touring team organised across multiple venues and formats.
Lesson 17 of 24
0% complete