kubernetes cheatsheet
  • Obtain node join token
    $ kubeadm token list | awk 'NR==2{print $1}'
  • Get master hostname
    $ kubectl get nodes -l node-role.kubernetes.io/master -o jsonpath="{.items[*].metadata.name}"
  • List nodes
    $ kubectl get nodes -o jsonpath="{.items[*].metadata.name}"
  • Get master node ip
    $ kubectl cluster-info | head -1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"
  • Get master node port
    $ kubectl cluster-info | head -1 | grep -oE ':[0-9]+' | cut -f2 -d":"
  • Get master node ip and port string
    $ kubectl cluster-info | head -1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+"
  • Run a specified image
    $ kubectl run tempname --rm -it --image=python:2-alpine3.7 --command -- sh
  • Expose service to outside
    $ kubectl edit svc <service name> -n <namespace>
  • Add one of the node’s public IP to externalIPs e,g: externalIPs: 192.168.2.131, execute command for specific pod
    $ kubectl exec <pod name> <command name>
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇