Kubernetes Overview
Kubernetes is an open-source container-orchestration system for automating computer application deployment, scaling, and management. It was originally designed by Google and is now maintained by the Cloud Native Computing Foundation.
Key Features
- Container Orchestration: Automates deployment and management of containerized applications
- Service Discovery: Automatic DNS and load balancing
- Self-healing: Restarts failed containers and reschedules when nodes die
- Horizontal Scaling: Scale applications up and down with simple commands
- Secret Management: Store and manage sensitive information
- Rollouts and Rollbacks: Manage application updates and reversions
- Extensible: Supports plugins and custom resources
Installation & Setup
Installation Steps:
- Install a container runtime like Docker
- Install kubectl (Kubernetes command-line tool)
- Choose a Kubernetes distribution:
- Minikube for local development
- kubeadm for custom clusters
- Managed services (EKS, GKE, AKS)
- Verify installation:
kubectl version - Configure kubectl to connect to your cluster
Core Concepts:
Pods
Smallest deployable units in Kubernetes
Deployments
Manage replicated applications
Services
Network abstraction to access pods
Namespaces
Virtual clusters within a physical cluster
Productivity Tips
kubectl Aliases
Create aliases for common commands like:
alias k=kubectl
alias kgp="kubectl get pods"
Context Switching
Use kubectl config use-context to switch between clusters.
kubectl explain
Use kubectl explain to understand resource fields.
Port Forwarding
Access services locally with kubectl port-forward.