مكتبة الشروحات

Understanding Kubernetes Pods, Deployments and Services

Three core Kubernetes objects do most of the work. Understanding them makes the rest of Kubernetes click.

Pods

A Pod is the smallest deployable unit — one or more containers that share networking and storage. You rarely create Pods directly.

Deployments

A Deployment manages a set of identical Pods, handling rollouts, scaling and self-healing.

kubectl create deployment web --image=nginx
kubectl scale deployment web --replicas=3
kubectl get pods

Services

A Service gives a stable network endpoint to a set of Pods, load-balancing traffic between them.

kubectl expose deployment web --port=80 --type=NodePort
kubectl get services

Useful inspection commands

kubectl describe deployment web
kubectl logs <pod-name>
kubectl delete deployment web

Define these objects declaratively in YAML and apply them with kubectl apply -f file.yaml.

هل كانت المقالة مفيدة ؟

0 أعضاء وجدوا هذه المقالة مفيدة

Powered by WHMCompleteSolution