DEV Community

Cloudev
Cloudev

Posted on

Kubernetes Essentials

Kubernetes is the go-to platform for managing containerized applications at scale. Here’s a concise guide to the basics every developer or SysOps engineer should know

1. Pods

Definition: Smallest deployable unit in Kubernetes; can run one or more containers.

Commands:

kubectl get pods # List all pods
kubectl describe pod # Detailed info
kubectl logs # View container logs

2. Deployments

Purpose: Ensure your application runs with the desired number of replicas. Handles updates and rollbacks automatically.

Commands:

kubectl create deployment --image=
kubectl get deployments
kubectl scale deployment --replicas=N

3. Services

Purpose: Expose pods to internal or external traffic.
Types:

ClusterIP – internal only (default)

NodePort – accessible via node IP

LoadBalancer – external access via cloud LB

Commands:

kubectl expose deployment --type=NodePort --port=80
kubectl get svc

4. Common Commands

kubectl get all – List all resources in the cluster

kubectl delete pod – Remove a pod

kubectl apply -f – Apply configuration files

5. Troubleshooting

kubectl describe pod – Check events, errors, or misconfigurations

kubectl logs – Inspect application logs

kubectl get nodes – Check node health and availability

Tip: Always start by inspecting pods and their logs when troubleshooting, then check deployments and services. Kubernetes is powerful, but clear visibility into resources makes management easier

Top comments (0)