Kubernetes Command - Quick Guide
Kubernetes Command - Quick Guide
t
7. Working with Persistent Volumes (PV) and Claims (PVC)................................................... 3
s
8. Configuring and Viewing Contexts........................................................................................ 3
9. Debugging Resources.............................................................................................................4
ni
10. Managing Jobs and CronJobs............................................................................................. 4
11. Applying and Deleting Manifests......................................................................................... 4
o
1. Working with Pods
si
kubectl get pods -> # Lists all pods in the current
Fu
namespace
kubectl get pods -A -> # Lists all pods across all
namespaces
kubectl describe pod <pod> -> # Displays detailed info about a
specific pod
h
t
kubectl rollout undo deployment <name> -> # Rolls back the
s
last deployment
ni
3. Working with Services
o
kubectl get services si -> # Lists all services
kubectl describe svc <service> -> # Displays detailed info about a
service
kubectl expose deployment <name> --port=<port> --type=<type> -> #
Fu
Exposes a deployment as a service
kubectl delete svc <service> -> # Deletes a specific service
Creates a ConfigMap
kubectl get configmaps -> # Lists
Te
all ConfigMaps
kubectl describe configmap <name> -> #
Describes a ConfigMap
kubectl create secret generic <name> --from-literal=key=value -> #
Creates a secret
kubectl get secrets -> # Lists
all secrets
kubectl describe secret <name> -> #
Describes a secret
5. Working with Namespaces
s t
ni
6. Managing Nodes
o
kubectl describe node <node> -> # Displays detailed info about a node
kubectl drain <node> -> # Safely evicts pods from a node (for
maintenance)
kubectl cordon <node>
si
-> # Marks node as unschedulable
Fu
kubectl uncordon <node> -> # Marks node as schedulable again
s t
9. Debugging Resources
ni
kubectl describe <resource> <name> -> # Describes any Kubernetes
o
resource
kubectl logs <pod> si -> # Displays logs of a pod
kubectl logs -f <pod> -> # Follows pod logs in
real-time
kubectl get events -> # Lists cluster events
Fu
kubectl debug <pod> -> # Debugs a running pod
h
s t
Hope you find this document helpful!
ni
For more such content you can check : https://techyoutube.com/
o
Telegram: https://t.me/LearnDevOpsForFree
Twitter: https://twitter.com/techyoutbe
si
Youtube: https://www.youtube.com/@T3Ptech
Fu
c h
Te