Useful Scripts for managing K8s

Getting all resources in namespace 1 2 3 kubectl api-resources --verbs=list --namespaced -o name \ | xargs -n 1 kubectl get --show-kind --ignore-not-found \ -l <label>=<value> -n $namespace Remove terminating namespace using remove-terminating-namespace.sh to remove the namespace that is stuck in the status Terminating 1 2 3 4 5 6 7 8 9 10 # remove-terminating-namespace.sh if [[ $# -ne 1 ]]; then echo "Please input only namespace name" exit 1 fi ns=$1 kubectl get ns ${ns} -o json > tmp....

May 1, 2022 · 2 min · Justin Hung

Windows Working Environment Setup (with WSL and ZSH)

Achievement WSL2 + Docker Desktop + zsh/zim + brew Step 1: WSL2 New Way requirement: Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11 wsl --install Old Way Link: https://docs.microsoft.com/zh-tw/windows/wsl/install-win10 Quick command: Enable WSL2 dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart Check system version X64:1903 with 18362 or up ARM64 : 2004 with 19041 or up Enable VM Platform dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart Reboot Download kernal update wsl_update_x64....

March 13, 2021 · 4 min · Justin Hung