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?

More than 3 years have passed since last update.

kubernetes操作が便利になるプラグイン

Posted at

krew

  • kubernetes系のプラグインマネージャー
  • fishです

インストール

begin
  set -x; set temp_dir (mktemp -d); cd "$temp_dir" &&
  set OS (uname | tr '[:upper:]' '[:lower:]') &&
  set ARCH (uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/') &&
  curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz" &&
  tar zxvf krew.tar.gz &&
  set KREWNAME krew-$OS"_"$ARCH &&
  ./$KREWNAME install krew &&
  set -e KREWNAME; set -e temp_dir
end

シェル起動時に読み込むようにする

~/.config/fish/conf.d/krew.fish
set -gx PATH $PATH $HOME/.krew/bin

kubectx

  • コンテキストの切り替えが楽
kubectl krew install ctx

使い方

kubectl-ctx <context>

kubens

  • namespaceの切り替えが楽
kubectl krew install ns

使い方

kubectl-ns nginx

今のNamespace

kubectl-ns -c

iexec

  • execで長いコマンド打たなくてすむ
  • いい感じにシェルに入ってくれる
kubectl krew install iexec 

使い方

kubectl-iexec nginx

open-svc

  • svcをPortForwardせずに利用できる
kubectl krew install open-svc

使い方

  • ブラウザが立ち上がる
kubectl-open_svc kibana
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?