CI/CD + Kubernetes — GitHub Actions · Pod · Deployment
CI/CD + Kubernetes — GitHub Actions · Pod · Deployment
🎯 What you'll be able to do after this lesson
By the end of this lesson, you'll be confident doing all three of the following.
- ▸✅ GitHub Actions / GitLab CI workflows
- ▸✅ Kubernetes Pod · Deployment · Service · Ingress
- ▸✅ Helm package manager + per-environment values.yml
Keep these goals as a checklist — when you can answer every item, close the lesson.
CI/CD Flow + GitHub Actions
CI/CD = Code → Production Automation:
1. Continuous Integration: Code push → automated build, test, and lint
2. Continuous Delivery: + automated staging deployment
3. Continuous Deployment: + automated production deployment
GitHub Actions (most common):
- ▸
.github/workflows/*.ymlfiles - ▸push, PR, schedule, and manual triggers
- ▸Free for public repos; 2,000 minutes/month free for private repos
Example:
Security best practices:
- ▸Use
secrets.GITHUB_TOKEN(never paste a Personal Access Token directly) - ▸Use OIDC for temporary AWS/GCP credentials (no long-lived keys)
- ▸Pin actions to a commit hash (not a version tag)
- ▸Use Dependabot to keep actions up to date automatically
Other CI/CD tools:
- ▸GitLab CI — built into GitLab
- ▸Jenkins — self-hosted, powerful but complex
- ▸CircleCI — quick to get started
- ▸ArgoCD — GitOps (Kubernetes-native)
Kubernetes — Pod · Service · Deployment
In one line: K8s = automated operations tool for containers. Born from Google's Borg → open-sourced in 2014 → now the de facto standard.
Core objects:
Deployment example:
Rolling update (default strategy):
- ▸Gradually add new-version Pods → gradually remove old Pods
- ▸Guarantees zero-downtime deployment
- ▸Automatic rollback is possible on failure
Essential commands:
- ▸
kubectl apply -f deploy.yaml— deploy - ▸
kubectl get pods,svc,deploy— check status - ▸
kubectl logs -f <pod>— stream logs - ▸
kubectl exec -it <pod> -- bash— enter the container - ▸
kubectl rollout undo deployment web— rollback
🤖 Try asking AI like this
Once you know the concepts in this lesson, you can give AI specific, precise instructions — not a vague 'fix this,' but a request with vocabulary — and that's where token savings begin.
- ▸'Create a GitHub Actions workflow for this project (lint + test + deploy).'
- ▸'Convert this app into Kubernetes deployment + service + ingress YAML.'
Why this reduces tokens
When you don't know the concepts, even after getting an AI response you have to ask 'What does that mean?' all over again. Those follow-up questions eat tokens. Learn the concepts once, and the conversation ends in a single round.