forked from denisidoro/navi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubernetes.cheat
43 lines (29 loc) · 969 Bytes
/
kubernetes.cheat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% kubernetes, k8s
# Print resource documentation
kubectl explain <resource>
# 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>