A comprehensive guide covering Kubernetes fundamentals, CI/CD integration, managed Kubernetes services (EKS, AKS, GKE), Minikube setup, deployment workflow, troubleshooting, and production best practices.
- Introduction
- Kubernetes in CI/CD Workflow
- Where Kubernetes Clusters are Created in Real Life
- Managed Kubernetes Services
- AWS EKS
- Azure AKS
- Google GKE
- EKS vs AKS vs GKE Comparison
- Kubernetes Project Workflow
- Minikube Installation
- Deployment Steps
- Troubleshooting
- Debugging
- Load Testing
- ImagePullBackOff Fix
- Key Takeaways
Kubernetes is an open-source container orchestration platform that automates:
- Deployment
- Scaling
- Load balancing
- Self-healing
- Rolling updates
Instead of manually running Docker containers on servers, Kubernetes manages containers automatically.
GitHub
↓
GitHub Actions
↓
Build Docker Image
↓
Push to Amazon ECR
↓
Deploy to EC2
GitHub
↓
GitHub Actions
↓
Build Docker Image
↓
Push Image to ECR
↓
kubectl apply
↓
Kubernetes Cluster
Instead of deploying directly on an EC2 instance, GitHub Actions deploys the latest Docker image into a Kubernetes cluster.
Example deployment step:
- name: Deploy to Kubernetes
run: |
kubectl apply -f deployment.yamlname: CI/CD Pipeline with Kubernetes
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to ECR
run: aws ecr get-login-password --region <region> |
docker login --username AWS --password-stdin \
<account-id>.dkr.ecr.<region>.amazonaws.com
- name: Build Docker Image
run: |
docker build -t app:latest .
docker push <ecr-url>/app:latest
- name: Deploy to Kubernetes
uses: azure/k8s-deploy@v4
with:
manifests: |
deployment.yaml
service.yaml- Automatic scaling
- Rolling updates
- Zero downtime deployment
- Self healing
- Load balancing
- High availability
Used only for learning and testing.
Tools:
- Minikube
- Kind
- Docker Desktop Kubernetes
Companies generally use managed Kubernetes services instead of self-hosting.
Popular options:
- Amazon EKS
- Azure AKS
- Google GKE
Large enterprises with strict compliance requirements may also create on-premise Kubernetes clusters using tools like:
- kubeadm
- Rancher
Minikube is intended only for local development.
Limitations:
- Single-machine setup
- Limited scalability
- No production-grade high availability
- Not suitable for enterprise workloads
Cloud providers manage the Kubernetes control plane while developers manage their applications.
- Managed Control Plane
- IAM integration
- CloudWatch integration
- Elastic Load Balancer support
- VPC networking
- Auto Scaling Groups
- Existing AWS users
- Enterprise applications
- Large-scale workloads
- Beginner-friendly
- Azure AD integration
- Azure Monitor
- Blob Storage support
- Automated upgrades
- Virtual Nodes
- Microsoft ecosystem
- Azure ML
- Hybrid cloud deployments
- Created by Google
- GKE Autopilot
- Automatic scaling
- Cloud Monitoring
- Vertex AI integration
- GPU and TPU support
- AI/ML workloads
- Startups
- Modern cloud-native applications
| Feature | AWS EKS | Azure AKS | Google GKE |
|---|---|---|---|
| Ease of Use | Medium | Beginner Friendly | Beginner Friendly |
| Cloud Integration | AWS | Azure | Google Cloud |
| AI/ML Support | SageMaker | Azure ML | Vertex AI |
| Networking | Advanced | Simple | Simple |
| Autoscaling | Auto Scaling Groups | Built-in | Advanced |
| Best For | Enterprise | Microsoft Users | AI/ML |
Build your application.
Verify it works locally.
Create Docker Image
docker build -t kubernetes-test-app:latest .Verify:
docker imagesRun locally:
docker run -p 5000:5000 kubernetes-test-app:latestCreate
deployment.yaml
Install Minikube
Start Minikube
minikube startor
minikube start --embed-certsminikube statuskubectl get all -Akubectl get pods -Akubectl get nodes -Aminikube start --nodes=2or
minikube start --nodes=2 --embed-certsList Docker images
docker imagesList Minikube images
minikube image listLoad image
minikube image load kubernetes-test-app:latestkubectl apply -f deployment.yamlDelete deployment
kubectl delete deployment kubernetes-test-appCheck Pods
kubectl get podsCheck Nodes
kubectl get nodesDelete Pod
kubectl delete pod <pod-name>Access Service
minikube service kubernetes-test-appOpen Dashboard
minikube dashboardView logs
kubectl logs -f <pod-name>View endpoints
kubectl get endpointsView services
kubectl get serviceUse Postman Performance Runner.
Example:
- 10 users
- 1 minute
- Fixed configuration
Monitor:
- Response time
- Error rate
- Throughput
minikube stopTag image
docker tag kubernetes-test-app:latest \
<dockerhub-username>/kubernetes-test-app:latestPush image
docker push <dockerhub-username>/kubernetes-test-app:latestFailed to connect to registry.k8s.io
If using a proxy:
minikube start \
--docker-env HTTP_PROXY=http://proxy:port \
--docker-env HTTPS_PROXY=https://proxy:portWithout a proxy:
unset HTTP_PROXY
unset HTTPS_PROXY
unset NO_PROXYCheck DNS
nslookup registry.k8s.ioReset Minikube
minikube stop
minikube delete --allRestart
minikube start- Kubernetes automates deployment and scaling of containerized applications.
- GitHub Actions can deploy directly to Kubernetes clusters using
kubectl. - Minikube is ideal for learning but not suitable for production.
- Managed Kubernetes services (EKS, AKS, and GKE) reduce operational complexity.
- GKE is particularly strong for AI/ML workloads due to GPU/TPU and Vertex AI integration.
- Kubernetes provides rolling updates, self-healing, load balancing, and high availability.
- Production environments typically rely on managed Kubernetes services rather than self-hosted clusters.
Docker
↓
Docker Compose
↓
Kubernetes Basics
↓
Pods
↓
ReplicaSets
↓
Deployments
↓
Services
↓
ConfigMaps & Secrets
↓
Ingress
↓
Volumes
↓
Helm
↓
Kubernetes on Cloud (EKS / AKS / GKE)
↓
CI/CD with Kubernetes
Ayush
These notes were created as part of an AI/ML and MLOps learning journey, covering Kubernetes from local development with Minikube to production-ready deployments using managed Kubernetes services.