0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Kubernetesのcontext切り替えのTips

0
Posted at

複数のクラスターを管理してると、configの管理やcontextの切り替えが面倒になってくるので、楽にするTipsをまとめる

複数のconfigをマージする

export KUBECONFIG=~/.kube/config:~/.kube/config-dev

contextの切り替えを楽にする

aliasを貼っておけば少し手間が省ける

alias k='kubectl'
alias kctx='kubectx'
alias kns='kubens'
alias k-sample-dev='kctx sample-dev'

k-sample-dev
✔ Switched to context "sample-dev".

pecoを使って切り替えるのもあり

プロンプトにcontextを表示する

環境で色を変えるとわかりやすい

Oh My Zshを使ってるとこっちがいいかも

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?