هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
المهارات في هذا الفصل
- Kubernetes — 8
kubectl — talk to the cluster
kubectl creates, reads, changes and deletes everything in Kubernetes.
kubectl get pods -n shop -o wide
kubectl apply -f deploy.yaml
kubectl rollout status deploy/shop -n shop
kubectl logs deploy/shop -n shop --since=10m
kubectl describe pod shop-7d9c-abcde -n shopGood practice:
- Changes go through Git (GitOps); kubectl on production is for reading and emergencies.
- Requests and limits, readiness and liveness probes on every container.
Helm — packages for Kubernetes
helm installs an app from a chart with your values, and upgrades or rolls it back as one release.
Kustomize — one base, many environments
kustomize changes plain YAML per environment with overlays — no templates.
minikube, kind and k3s — clusters to practise
A real cluster on your laptop or a small VM, made in a minute and thrown away.
k9s and stern — find problems fast
k9s is a live terminal UI for the cluster; stern follows the logs of many pods at once.
Debug a pod that does not start
The same 5 steps for every broken pod.
kubectl get pods— the STATUS: Pending, ImagePullBackOff, CrashLoopBackOff, OOMKilled?kubectl describe pod— the Events at the bottom tell why.kubectl logs POD --previous— the logs of the container before it crashed.kubectl get events --sort-by=.lastTimestamp— what happened around it.kubectl exec -it POD -- shorkubectl debug— look inside.
تذكّر
Pending = scheduling (resources, taints); ImagePullBackOff = image name or registry login; CrashLoopBackOff = the app itself or its config.