Title here
Summary here
Command | Description |
---|---|
kubectl create -f demo.yaml | Create a demo service |
kubectl get pods | Lists all pods in the current namespace. |
kubectl get pods -n | Lists all pods in a specific namespace. |
kubectl describe pod | Displays detailed information about a specific pod. |
kubectl logs | Fetches logs from a specific pod. |
kubectl logs | Fetches logs from a specific container within a pod. |
kubectl exec -it | Opens an interactive shell session in a running pod. |
kubectl apply -f | Applies a configuration change to a resource defined in a YAML file. |
kubectl create -f | Creates a resource defined in a YAML file. |
kubectl delete -f | Deletes a resource defined in a YAML file. |
kubectl get svc | Lists all services in the current namespace. |
kubectl get nodes | Lists all nodes in the cluster. |
kubectl top node | Displays resource usage for nodes in the cluster. |
kubectl top pod | Displays resource usage for pods in the cluster. |
kubectl scale deployment | Scales a deployment to the specified number of replicas. |
kubectl rollout status deployment | Watches the status of a deployment rollout until it completes. |
kubectl edit deployment | Edits a deployment’s configuration. |
kubectl delete pod | Deletes a specific pod. |
kubectl config view | Displays the kubeconfig configuration. |
kubectl get configmaps | Lists all ConfigMaps in the current namespace. |
kubectl get secrets | Lists all secrets in the current namespace. |
kubectl port-forward | Forwards a port from a local machine to a port on a pod. |
kubectl get events –sort-by=.metadata.creationTimestamp | Lists all events, sorted by their creation timestamp. |
kubectl drain | Safely evicts all pods from a node for maintenance. |
kubectl cordon | Marks a node as unschedulable (prevents new pods from being scheduled). |
kubectl uncordon | Marks a node as schedulable (allows new pods to be scheduled). |
kubectl version –short | Displays the client and server versions of Kubernetes. |
kubectl get ingress | Lists all ingress resources in the current namespace. |
kubectl get all | Lists all resources in the current namespace. |