Skip to content

Commit 5ba4482

Browse files
committed
refactor: update kubectl commands
1 parent bb701f1 commit 5ba4482

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

kubernetes/kubectl-commands.sh

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,19 @@ source <(kubectl completion bash)
88

99
######################################################################
1010

11+
### version
12+
kubectl version
1113
kubectl api-versions
1214

1315
######################################################################
1416

15-
### kubectx and kubens
16-
17-
kubectx
18-
kubectx -
19-
kubectx -h
20-
kubectx -c
21-
kubectx --current
22-
kubectx docker-desktop
23-
24-
kubens
25-
kubens -
26-
kubens -h
27-
kubens -c
28-
kubens --current
29-
kubens kube-system
17+
### check logs and events
18+
kubectl logs <pod-name> -c <init-container-name>
19+
kubectl describe pod <pod-name>
3020

3121
######################################################################
3222

33-
### apply and delete
23+
### apply and delete resources
3424

3525
cat <<EOF | kubectl apply -f -
3626
EOF
@@ -63,7 +53,23 @@ kubectl annotate --overwrite storageclass rook-ceph-block storageclass.kubernete
6353

6454
######################################################################
6555

66-
### dashboard
56+
### kubectx and kubens
57+
58+
kubectx
59+
kubectx -
60+
kubectx -h
61+
kubectx -c
62+
kubectx --current
63+
kubectx docker-desktop
64+
65+
kubens
66+
kubens -
67+
kubens -h
68+
kubens -c
69+
kubens --current
70+
kubens kube-system
71+
72+
######################################################################
6773

6874
### dashboard password
6975
kubectl describe secrets kubernetes-dashboard-token --namespace kube-system | grep token: | awk '{print $2}'

0 commit comments

Comments
 (0)