Merge pull request #36 from djerfy/update-kubernetes-cheat

Update kubernetes cheat
This commit is contained in:
Denis Isidoro 2019-09-23 14:19:07 -03:00 committed by GitHub
commit ba1ee082ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,43 @@
% kubernetes, k8s
# Edit deployment
kubectl edit deployment <deployment>
# Print resource documentation
kubectl explain <resource>
# Get pods
kubectl get pods
# Get nodes (add option `-o wide` for details)
kubectl get nodes
# Get namespaces
kubectl get namespaces
# Get pods from namespace (add option `-o wide` for details)
kubectl get pods -n <namespace>
# Get pods from all namespace (add option `-o wide` for details)
kubectl get pods --all-namespaces
# Get services from namespace
kubectl get services -n <namespace>
# Get details from resource on namespace
kubectl describe <resource>/<name> -n <namespace>
# Print logs from namespace
kubectl logs -f pods/<name> -n <namespace>
# Get deployments
kubectl get deployments -n <namespace>
# Edit deployments
kubectl edit deployment/<name> -n <namespace>
# Drain node in preparation for maintenance
kubectl drain <name>
# Mark node as schedulable
kubectl uncordon <name>
# Mark node as unschedulable
kubectl cordon <name>
# Display resource (cpu/memory/storage) usage
kubectl top <type>