-
Notifications
You must be signed in to change notification settings - Fork 41
/
Cheatsheet
57 lines (46 loc) · 1.37 KB
/
Cheatsheet
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# remove all untagged images
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
# alias kubectl
alias eks='kubectl --kubeconfig <path-to-kubeconfig>
# alias for oc
alias oca='oc --config <path-to-kubeconfig>
# list cluster nodes
kubectl get nodes
# list cluster nodes with more info
kubectl get nodes -o wide
# list pods
kubectl get pods
#list deployments
kubectl get deploy
#delete deployment
kubectl delete deploy <deployment name>
#context switching
kubectl config view -o jsonpath='{.users[*].name}' # get a list of users
kubectl config get-contexts # display list of contexts
kubectl config current-context # display the current-context
kubectl config use-context my-cluster-name # set the default context to my-cluster-name
# permanently save the namespace for all subsequent kubectl commands in that context.
kubectl config set-context --current --namespace=ggckad-s2
Short name Full name
csr certificatesigningrequests
cs componentstatuses
cm configmaps
ds daemonsets
deploy deployments
ep endpoints
ev events
hpa horizontalpodautoscalers
ing ingresses
limits limitranges
ns namespaces
no nodes
pvc persistentvolumeclaims
pv persistentvolumes
po pods
pdb poddisruptionbudgets
psp podsecuritypolicies
rs replicasets
rc replicationcontrollers
quota resourcequotas
sa serviceaccounts
svc services