topic:k8
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| topic:k8 [2024/12/24 17:55] – removed arie | topic:k8 [2024/12/31 09:00] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== k8 notes of Arie ====== | ||
| + | < | ||
| + | #Bash into container | ||
| + | k exec -it wiki-dokuwiki-9f9fd859d-2wfx6 bash | ||
| + | |||
| + | ### Useful aliases ### | ||
| + | kush [-n ns] pod_name | ||
| + | kud pod_name | ||
| + | kug pod pod_name | ||
| + | ktail pod_name | ||
| + | |||
| + | # fetch chart to analyse values.yaml | ||
| + | helm fetch gitlab/ | ||
| + | |||
| + | # debug certs | ||
| + | kug orders, | ||
| + | |||
| + | # Delete PV that has finalizers | ||
| + | pv=pvc-daec7eed-fc8e-4281-a15b-6b370df54804 | ||
| + | echo ' | ||
| + | # Delete POD that got stuck (and no finalizers to delete) | ||
| + | kubectl delete pods fluent-bit-xczr2 --grace-period=0 --force | ||
| + | |||
| + | #copy file into pod | ||
| + | kubectl cp / | ||
| + | |||
| + | # Delete namespace that got stuck | ||
| + | namespaceToDelete=brocha | ||
| + | kubectl get namespace " | ||
| + | jq ' | ||
| + | | ||
| + | |||
| + | # drain and evict pods from a node | ||
| + | kubectl drain --ignore-daemonsets --delete-emptydir-data k8i03 | ||
| + | #untaint | ||
| + | kubectl uncordon k8i03 | ||
| + | |||
| + | # port forwarding of localport 40090 to port 9090 of the svc | ||
| + | kubectl port-forward -n monitoring svc/ | ||
| + | |||
| + | # see nodes labels | ||
| + | kug nodes --show-labels | ||
| + | # remove label worker from a node: | ||
| + | kubectl label node ip-10-0-7-187.ec2.internal worker- | ||
| + | # add control-plane label | ||
| + | kubectl label node k8r05 node-role.kubernetes.io/ | ||
| + | kubectl label node k8p01 general=yes | ||
| + | |||
| + | # See cpu/mem usage by nodes | ||
| + | kubectl top node | ||
| + | |||
| + | # Show pod by label | ||
| + | kug pod -n monitoring -l app.kubernetes.io/ | ||
| + | # kill pods by label | ||
| + | kudel pod -n nqa -l app=etljobs-sel | ||
| + | |||
| + | # watch hpa of gwpa@rnd | ||
| + | kug hpa -n rnd gwpa-hpa --watch | ||
| + | |||
| + | # events on API of prod2 farm | ||
| + | kug events -n prod2 | ||
| + | </ | ||
topic/k8.1735062955.txt.gz · Last modified: 2024/12/31 08:55 (external edit)
