Code
kubernetes
# Resources
kubectl get pods,svc,deploy -n default
kubectl get all -o wide
# Inspect
kubectl describe pod api-pod
kubectl explain pod.spec.containers
# Logs and exec
kubectl logs -f deployment/api
kubectl logs api-pod -c sidecar
kubectl exec -it api-pod -- sh
# Apply, scale, and patch
kubectl apply -f deploy.yaml
kubectl scale deployment api --replicas=5
kubectl patch deployment api -p '{"spec":{"replicas":3}}'
# Cleanup
kubectl delete -f deploy.yaml
kubectl delete pod,svc -l app=api