Kubernetes Tutorial #9: CI/CD with Kubernetes and GitHub Actions
Deploying to Kubernetes manually is slow and error-prone. Every deploy requires building an image, pushing it to a registry, and updating the cluster. With CI/CD, all of that happens automatically on every push to your main branch. Write code, push to GitHub, and your new version is live in minutes — with zero-downtime rolling updates. This tutorial builds a complete pipeline with GitHub Actions. The Pipeline Overview Developer pushes code to main branch ↓ GitHub Actions triggers workflow ↓ Build Docker image ↓ Push image to registry (GHCR or Docker Hub) ↓ Deploy to Kubernetes (kubectl apply or helm upgrade) ↓ Wait for rollout to complete ↓ Done — new version is live Prerequisites A Kubernetes cluster (for this tutorial, we use a real cluster — not minikube). Options: k3s on a VPS, or any cloud provider. A GitHub repository with your app code and Kubernetes manifests Basic understanding of GitHub Actions (jobs, steps, secrets) Step 1: Prepare the Kubernetes Manifests Keep your Kubernetes YAML files in your repository, under a k8s/ directory: ...