אשכול ו-context ⤢ kubectl cluster-infoמציג היכן רצים ה-control plane והשירותים המרכזיים. kubectl cluster-info ⤢ kubectl config get-contextsמציג רשימה של האשכולות וה-namespaces שאפשר לעבור ביניהם. kubectl config get-contexts ⤢ kubectl config use-contextעובר ל-context אחר של אשכול או namespace. kubectl config use-context my-prod ⤢ kubectl config set-context --current --namespaceקובע את ברירת המחדל של ה-namespace ב-context הנוכחי. kubectl config set-context --current --namespace=staging ⤢ kubectl config rename-contextמשנה שם של context שמור ב-kubeconfig שלך. kubectl config rename-context old-name prod ⤢ kubectl api-resourcesמציג רשימה של כל סוגי המשאבים שהאשכול מכיר. kubectl api-resources ⤢ kubectl versionמדפיס את גרסאות ה-Kubernetes של הלקוח והשרת. kubectl version ⤢ kubectl explainמציג את השדות שמשאב תומך בהם, שנקראים מהסכימה של ה-API. kubectl explain pod.spec.containers ⤢ kubectl auth can-iבודק אם למשתמש הנוכחי מותר להריץ פעולה מסוימת. kubectl auth can-i delete pods בחינת workloads ⤢ kubectl get podsמציג רשימה של פודים ומצבם; הוסף -o wide לצורך node ו-IP. kubectl get pods -A ⤢ kubectl get allמציג בקריאה אחת את המשאבים הנפוצים של namespace. kubectl get all ⤢ kubectl get -o wideמוסיף עמודות node ו-IP לכל פקודת get. kubectl get pods -o wide ⤢ kubectl get -o yamlמדפיס משאב כ-manifest ה-YAML המלא שמאחוריו. kubectl get deploy/web -o yaml ⤢ kubectl get deploymentsמציג רשימה של deployments וכמה replicas מוכנים. kubectl get deployments ⤢ kubectl get statefulsetsמציג רשימה של stateful sets וה-replicas המוכנים שלהם. kubectl get statefulsets ⤢ kubectl get jobs, cronjobsמציג רשימה של jobs של אצווה ו-cron jobs מתוזמנים. kubectl get jobs,cronjobs ⤢ kubectl describe podמציג אירועים, תוויות ומצב של פוד אחד. kubectl describe pod web-abc ⤢ kubectl describe nodeמציג את הקיבולת של node, את התנאים שלו ואת הפודים הרצים עליו. kubectl describe node node-1 ⤢ kubectl logsמדפיס את הפלט הסטנדרטי של פוד; -f למעקב, --previous לקריסה האחרונה. kubectl logs -f web-abc ⤢ kubectl execמריץ פקודה בתוך פוד רץ. kubectl exec -it web-abc -- sh ⤢ kubectl topCPU וזיכרון חיים לפודים או לצמתים (דורש metrics-server). kubectl top pods ⤢ kubectl get eventsמציג רשימה של אירועים אחרונים כגון pullים כושלים ו-backoffs. kubectl get events -A --sort-by=.lastTimestamp ⤢ kubectl get ingressמציג רשימה של כללי ingress וכתובות ה-load balancer שלהם. kubectl get ingress ⤢ kubectl cpמעתיק קבצים בין המכונה שלך לפוד רץ. kubectl cp web-abc:/var/log/app.log ./app.log ⤢ kubectl waitחוסם עד שמשאב עומד בתנאי. kubectl wait --for=condition=ready pod -l app=web ⤢ kubectl runמריץ פוד חד-פעמי מ-image, בלי צורך ב-manifest. kubectl run debug --rm -it --image=busybox -- sh החלה, שינוי קנה מידה ו-rollout ⤢ kubectl diffמציג מה apply היה משנה, בלי לשנות דבר. kubectl diff -f deploy.yaml ⤢ kubectl apply -fיוצר או מעדכן משאבים מקובץ manifest. kubectl apply -f deploy.yaml ⤢ kubectl apply --pruneמחיל manifests ומוחק אובייקטים שיצאו מהם. kubectl apply -f dir/ --prune -l app=web ⤢ kubectl editפותח משאב חי בעורך שלך ומחיל בשמירה. kubectl edit deploy/web ⤢ kubectl patchמשנה כמה שדות במשאב חי. kubectl patch deploy/web --patch-file fix.json ⤢ kubectl set imageמפנה את הקונטיינרים של deployment אל image חדש. kubectl set image deploy/web web=nginx:1.27 ⤢ kubectl replace --forceמחליף אובייקט, מוחק ויוצר אותו מחדש לפי הצורך. kubectl replace --force -f deploy.yaml ⤢ kubectl delete -fמסיר את המשאבים שמוגדרים בקובץ manifest. kubectl delete -f deploy.yaml ⤢ kubectl scaleמשנה את מספר ה-replicas של deployment. kubectl scale deploy/web --replicas=4 ⤢ kubectl rollout statusעוקב אחר rollout עד שהוא מסתיים או נכשל. kubectl rollout status deploy/web ⤢ kubectl rollout historyמציג רשימה של ה-revisions ש-rollout עבר. kubectl rollout history deploy/web ⤢ kubectl rollout restartמריץ מחדש כל פוד של deployment, אחד אחד. kubectl rollout restart deploy/web ⤢ kubectl rollout undoמחזיר deployment ל-revision הקודמת שלו. kubectl rollout undo deploy/web שירותים ורשת ⤢ kubectl get svcמציג רשימה של שירותים עם הסוג וה-IP האשכולי שלהם. kubectl get svc ⤢ kubectl get endpointsמציג אילו IPs של פודים מגבים כרגע כל שירות. kubectl get endpoints web ⤢ kubectl exposeיוצר שירות שעומד בפני קבוצת פודים; --type=NodePort או LoadBalancer מגיע מחוץ לאשכול. kubectl expose deploy/web --port=80 ⤢ kubectl ingress statusמציג את כתובת ה-load balancer שמאחורי כל ingress (אלפא). kubectl ingress status -A ⤢ kubectl get networkpoliciesמציג רשימה של המדיניות שמגבילה תעבורת פודים. kubectl get networkpolicies ⤢ kubectl port-forwardמנהר פורט מקומי אל פוד או שירות. kubectl port-forward svc/web 8080:80 צמתים ותחזוקה ⤢ kubectl get nodesמציג רשימה של צמתי האשכול ומצבם. kubectl get nodes -o wide ⤢ kubectl cordonמסמן node כבלתי ניתן לתזמון (בלי פודים חדשים). kubectl cordon node-1 ⤢ kubectl uncordonמסמן node שוב כניתן לתזמון. kubectl uncordon node-1 ⤢ kubectl drainפונה פודים מ-node ומסמן אותו כבלתי ניתן לתזמון. kubectl drain node-1 --ignore-daemonsets ⤢ kubectl taintמוסיף או מסיר taint שדוחה פודים מ-node. kubectl taint node node-1 key=value:NoSchedule ⤢ kubectl delete pod --grace-period=0 --forceמוחק מיד פוד תקוע, תוך דילוג על כיבוי מסודר. kubectl delete pod web-abc --grace-period=0 --force אובייקטים ותצורה ⤢ kubectl create namespaceיוצר namespace חדש לתיחום משאבים. kubectl create namespace staging ⤢ kubectl get namespacesמציג רשימה של namespaces ומצבם. kubectl get namespaces ⤢ kubectl create configmapמאחסן מפתחות או קבצי תצורה כאובייקט אשכול. kubectl create configmap app --from-file=config.yaml ⤢ kubectl get configmapsמציג רשימה של config maps ב-namespace. kubectl get configmaps ⤢ kubectl create secretמאחסן סיסמה או תעודה כ-secret. kubectl create secret generic db --from-literal=password=s3cret ⤢ kubectl get secretsמציג רשימה של secrets ב-namespace. kubectl get secrets ⤢ kubectl labelמצמיד או מסיר תווית על משאב. kubectl label pod web-abc tier=backend ⤢ kubectl annotateמצמיד מטא-נתונים ש-selectors לא יכולים להתאים. kubectl annotate deploy/web release=july