Stage 7 · Master
KCNA — Kubernetes & Cloud Native Associate
App Delivery Fundamentals (8%)
GitOps, CI/CD, and Helm packaging — shipping software the cloud native way.
CI/CD Models
Continuous Integration (CI) merges code changes into a shared repository and runs automated tests. Continuous Delivery (CD) extends this by automating deployment to staging or production. The pipeline ensures every change is tested and deployable.
- CI — Build, lint, test, and package on every commit.
- CD (Delivery) — Deploy to staging automatically; production on manual trigger.
- CD (Deployment) — Deploy to production automatically after CI passes.
GitOps Principles
GitOps is a way of doing CD where Git is the single source of truth. Desired state is declared in Git, and a controller reconciles the live cluster state with the declared state. Git becomes your audit trail, rollback mechanism, and collaboration platform.
- Declarative — System desired state is declared, not scripted.
- Versioned and immutable — Every change is a Git commit.
- Pulled automatically — Agents pull changes, nothing is pushed.
- Continuously reconciled — The controller corrects drift automatically.
Traditional CI/CD pushes changes to the cluster. GitOps pulls changes from Git. Pull-based deployment is more secure because the cluster never needs to expose its API to external CI systems.
GitOps Tools
| Tool | Maintained By | Key Feature |
|---|---|---|
| Argo CD | CNCF | UI-driven, multi-cluster, SSO |
| Flux | CNCF | GitOps Toolkit, multi-tenancy |
| Jenkins X | CD Foundation | Kubernetes-native CI/CD |
Helm — Package Manager
Helm is the package manager for Kubernetes. It bundles manifests into reusable charts, supports templating, manages releases, and handles rollbacks. Think of it as apt or yum for Kubernetes.
helm repo add bitnami https://charts.bitnami.com/bitnami
helm search repo nginx
helm install my-nginx bitnami/nginx --set replicaCount=3
helm list -A # All releases across namespaces
helm upgrade my-nginx bitnami/nginx --set replicaCount=5
helm rollback my-nginx 1 # Rollback to revision 1
helm uninstall my-nginxHelm charts are stored in repositories. The helm install command creates a release, and each helm upgrade creates a new revision that can be rolled back to.
Kustomize
Kustomize is a template-free way to customize Kubernetes manifests. It uses overlays to patch base manifests without writing Go templates. kubectl has built-in Kustomize support with kubectl apply -k.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
patches:
- target:
kind: Deployment
name: my-app
patch: |-
- op: replace
path: /spec/replicas
value: 3Kustomize patches use JSON Patch format. The kubectl apply -k . command applies the entire kustomization directory.
Delivery Strategies
| Strategy | Description | Downtime |
|---|---|---|
| Rolling Update | Gradually replaces old Pods with new ones | No |
| Recreate | Terminates all old Pods before creating new ones | Yes |
| Blue/Green | Deploys new version alongside old, switches traffic | No |
| Canary | Routes a small percentage of traffic to new version | No |
Know the difference between Rolling Update (Kubernetes default) and Recreate strategy. The exam may ask which strategy to use when zero-downtime deployment is required.
Key Commands
kubectl apply -f manifest.yaml # Direct apply
kubectl apply -k ./overlays/prod # Kustomize apply
kubectl diff -f manifest.yaml # Preview changes before apply
kubectl rollout status deployment/my-app
kubectl rollout history deployment/my-app
kubectl rollout undo deployment/my-appThe kubectl diff command shows what will change before you apply. Use it on every apply to avoid surprises.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.