I spent two weeks reading Kubernetes documentation before I realized most of it wasn’t relevant to my job as a developer. K8s docs are written for cluster administrators. Developers need a different perspective.
Here’s everything I actually use as a developer who deploys to Kubernetes.
What Kubernetes Does (30-Second Version)
Kubernetes runs your containers and keeps them running. You tell it “I want 3 copies of my app running,” and K8s makes that happen. If one crashes, it starts a new one. If traffic increases, it can scale up. That’s the core idea.
The Four Resources You’ll Work With
1. Pods (Your Running Container)
A Pod is the smallest deployable unit – usually one container running your app. You rarely create Pods directly, but you need to understand them.
# Check running pods
kubectl get pods
kubectl logs my-app-pod-abc123 # View logs
kubectl exec -it my-app-pod -- /bin/sh # Shell into a pod
2. Deployments (How You Run Your App)
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-api
spec:
replicas: 3
selector:
matchLabels:
app: my-api
template:
metadata:
labels:
app: my-api
spec:
containers:
- name: my-api
image: myregistry/my-api:v1.2.3
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "500m"
This tells K8s: run 3 copies of my API, each with specific memory and CPU limits.
3. Services (How Traffic Reaches Your App)
apiVersion: v1
kind: Service
metadata:
name: my-api-service
spec:
selector:
app: my-api
ports:
- port: 80
targetPort: 8080
type: ClusterIP
A Service gives your pods a stable network endpoint. Pods come and go, but the service name stays the same.
4. ConfigMaps and Secrets (Configuration)
# Create a secret
kubectl create secret generic db-creds \
--from-literal=password=mysecretpassword
# Reference in deployment
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: db-creds
key: password
kubectl Commands You’ll Use Daily
kubectl get pods # List pods
kubectl get pods -w # Watch pods in real-time
kubectl describe pod [name] # Detailed pod info (great for debugging)
kubectl logs [pod] -f # Stream logs
kubectl rollout restart deployment/my-api # Restart all pods
kubectl rollout status deployment/my-api # Check deployment progress
kubectl port-forward svc/my-api 8080:80 # Access service locally
Debugging Tips
When your pod isn’t starting:
kubectl describe pod [name]– Check events at the bottomkubectl logs [name]– Check application logs- Common issues: image not found, insufficient resources, failed health checks
You don’t need to understand the control plane, etcd, or custom operators to be effective. Focus on Deployments, Services, and kubectl. That covers 90% of what developers need.
