Quick Start
Learn core Kubernetes concepts and orchestration patterns. This Quick Start teaches essential Kubernetes skills.
🎯 What You’ll Learn
By the end of this tutorial, you’ll understand:
- Pods, Deployments, and Services
- ConfigMaps and Secrets
- Persistent Volumes
- Scaling and updates
📋 Prerequisites
- Kubernetes installed (see Initial Setup)
📦 Pods and Deployments
Create deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
spec:
replicas: 3
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: nginx:latest
ports:
- containerPort: 80Apply:
kubectl apply -f deployment.yaml
kubectl get pods
kubectl get deployments🌐 Services
Create service.yaml:
apiVersion: v1
kind: Service
metadata:
name: myapp-service
spec:
selector:
app: myapp
ports:
- protocol: TCP
port: 80
targetPort: 80
type: LoadBalancerApply:
kubectl apply -f service.yaml
kubectl get services🔐 ConfigMaps and Secrets
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
DATABASE_URL: "postgres://db:5432/myapp"
LOG_LEVEL: "info"
---
apiVersion: v1
kind: Secret
metadata:
name: app-secret
type: Opaque
stringData:
password: "secret123"📈 Scaling
kubectl scale deployment myapp --replicas=5
kubectl get pods✅ Next Steps
You now understand Kubernetes essentials!
- Try the examples: Create and manage resources
- Explore By Example: Kubernetes By Example
🎯 Self-Assessment
After completing this Quick Start, you should be able to:
- Create Deployments and Pods
- Expose applications with Services
- Use ConfigMaps and Secrets
- Scale applications
Last updated