kubectl command
kubectl/container相關筆記 (持續更新中)
Check Cluster Version
1 | kubectl version |
顯示/切換cluster
顯示有哪些cluster
1 | kubectl config get-contexts |
顯示目前操作的cluster/context
1 | kubectl config current-context |
切換目前的cluster/context
1 | kubectl config use-context <cluster-name> |
列出pod環境變數
1 | kubectl exec <pod-name> -- printenv |
debug image for kubernetes’ container
- add below in yaml file.
1
command: ["tail", "-f", "/dev/null"]