⌨️
Basics

kubectl Basics

Command-Line Tool
💡 kubectl, EK, "REMOTE, CONTROL" jaisa, hai, poore, cluster, ke, liye — TUM, EK, hi, TOOL, se, HAR, CHEEZ, (pods, deployments, services) ko, CREATE, VIEW, UPDATE, aur, DELETE, kar, sakte, ho.

kubectl, Kubernetes, API, Server, se, TALK, karta hai — HAR, COMMAND, EK, HTTP, request, ban, jaati, hai, JO, API, Server, ko, jaati, hai. "kubectl get" resources, LIST, karta hai, "kubectl describe" DETAILS, deta hai, "kubectl apply" resources, CREATE/UPDATE, karta hai.

"kubectl apply -f file.yaml" DECLARATIVE, APPROACH, follow, karta hai — TUM, DESIRED, STATE, (YAML, file, mein) DEFINE, karte, ho, aur, Kubernetes, KHUD, DECIDE, karta hai, ki, CURRENT, STATE, se, DESIRED, STATE, tak, kaise, PAHUNCHNA, hai.

kubectl get pods
kubectl describe pod my-pod
kubectl apply -f deployment.yaml
kubectl delete pod my-pod
kubectl logs my-pod
⌨️
kubectl, EK, "REMOTE, CONTROL" jaisa, hai, poore, cluster, ke, liye — TUM, EK, hi, TOOL, se, HAR, CHEEZ, (pods, deployments, services) ko, CREATE, VIEW, UPDATE, aur, DELETE, kar, sakte, ho.
1 / 2
⚡ झट से Recap
  • kubectl = command-line tool jo API Server se baat karta hai
  • get/describe/apply/delete/logs sabse common commands hain
  • kubectl apply declarative hai — desired state define karo, K8s baaki khud sambhalta hai
इस page में (2 subtopics)

kubectl, "~/.kube/config" FILE, mein, SAARE, clusters, ki, INFO, aur, CREDENTIALS, STORE, karta hai — "context" batata hai, ki, ABHI, KAUNSE, cluster, aur, namespace, PAR, kaam, ho, RAHA, hai.

kubectl config get-contexts
kubectl config use-context my-cluster
kubectl config view

"kubectl create deployment" IMPERATIVE, command, hai — DIRECTLY, EK, ACTION, TELL, karta hai. "kubectl apply -f file.yaml" DECLARATIVE, hai — DESIRED, STATE, DEFINE, karta hai. PRODUCTION, mein, DECLARATIVE, APPROACH, (YAML, files, + version, control) RECOMMEND, ki, jaati, hai.

💡Tip: YAML, files, ko, Git, mein, STORE, karna, aur, "kubectl apply" se, hi, DEPLOY, karna, — isko, "GitOps" kehte, HAIN, aur, YE, MODERN, Kubernetes, workflows, ka, STANDARD, hai.