User Tools

Site Tools


private:arie:k8

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

private:arie:k8 [2024/12/24 16:17] – created arieprivate:arie:k8 [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== k8 notes of Arie ====== 
  
-<code> 
-#Bash into container 
-k exec -it wiki-dokuwiki-9f9fd859d-2wfx6 bash 
- 
-kush wiki-dokuwiki 
- 
-# fetch chart to analyse values.yaml 
-helm fetch gitlab/gitlab --untar 
- 
-# debug certs 
-kug orders,challenges -o wide 
- 
-# Delete PV that has finalizers 
-pv=pvc-daec7eed-fc8e-4281-a15b-6b370df54804 
-echo '{"metadata": {"finalizers": null}}' | kubectl patch pv $pv --patch-file=/dev/stdin 
-# 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 /mnt/common/tmp/run dev/page2-dp-77f87664bb-4l8mc:/tmp/run  
- 
-# Delete namespace that got stuck 
-namespaceToDelete=brocha 
-kubectl get namespace "$namespaceToDelete" -o json | \ 
- jq 'del(.spec.finalizers)'   | \ 
- kubectl replace --raw /api/v1/namespaces/$namespaceToDelete/finalize -f - 
- 
-# 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/prometheus-k8s 40090:9090 --address='0.0.0.0' 
- 
-# 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/control-plane= 
-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/name=kube-state-metrics 
-# 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 
-</code> 
private/arie/k8.1735057040.txt.gz · Last modified: 2024/12/31 08:55 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki