Info | ||||
---|---|---|---|---|
| ||||
|
00. 개요
Info | ||
---|---|---|
|
01. krew Installation
01-01. krew 설치
- https://krew.sigs.k8s.io/docs/user-guide/setup/install/
- Run this command to download and install
krew
Code Block | ||||
---|---|---|---|---|
| ||||
(
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
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 &&
KREW=./krew-"${OS}_${ARCH}" &&
"$KREW" install krew
) |
Code Block | ||
---|---|---|
| ||
sansae@win10pro-worksp:/workspaces$ set -x; cd "$(mktemp -d)" &&
> OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
> 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 &&
REW=> KREW=./krew-"${OS}_${ARCH}" &&
> "$KREW" install krew
++ mktemp -d
+ cd /tmp/tmp.dz3ycln4i9
++ uname
++ tr '[:upper:]' '[:lower:]'
+ OS=linux
++ uname -m
++ sed -e s/x86_64/amd64/ -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/'
+ ARCH=amd64
+ curl -fsSLO https://github.com/kubernetes-sigs/krew/releases/latest/download/krew.tar.gz
+ tar zxvf krew.tar.gz
./LICENSE
./krew-darwin_amd64
./krew-darwin_arm64
./krew-linux_amd64
./krew-linux_arm
./krew-linux_arm64
./krew-windows_amd64.exe
+ KREW=./krew-linux_amd64
+ ./krew-linux_amd64 install krew
Adding "default" plugin index from https://github.com/kubernetes-sigs/krew-index.git.
Updated the local copy of plugin index.
Installing plugin: krew
Installed plugin: krew
\
| Use this plugin:
| kubectl krew
| Documentation:
| https://krew.sigs.k8s.io/
| Caveats:
| \
| | krew is now installed! To start using kubectl plugins, you need to add
| | krew's installation directory to your PATH:
| |
| | * macOS/Linux:
| | - Add the following to your ~/.bashrc or ~/.zshrc:
| | export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
| | - Restart your shell.
| |
| | * Windows: Add %USERPROFILE%\.krew\bin to your PATH environment variable
| |
| | To list krew commands and to get help, run:
| | $ kubectl krew
| | For a full list of available plugins, run:
| | $ kubectl krew search
| |
| | You can find documentation at
| | https://krew.sigs.k8s.io/docs/user-guide/quickstart/.
| /
/
sansae@win10pro-worksp:/tmp/tmp.dz3ycln4i9$ exit |
01-02. krew 환경변수 설정 및 설치 확인
Info | ||||||
---|---|---|---|---|---|---|
|
02. krew-index 설치
Code Block |
---|
sansae@win10pro-worksp:/workspaces$ kubectl krew index add kvaps https://github.com/kvaps/krew-index WARNING: You have added a new index from "https://github.com/kvaps/krew-index" The plugins in this index are not audited for security by the Krew maintainers. Install them at your own risk. sansae@win10pro-worksp:/workspaces$ kubectl krew install kvaps/node-shell Updated the local copy of plugin index. Updated the local copy of plugin index "kvaps". Installing plugin: node-shell Installed plugin: node-shell \ | Use this plugin: | kubectl node-shell | Documentation: | https://github.com/kvaps/kubectl-node-shell | Caveats: | \ | | You need to be allowed to start privileged pods in the cluster | / / |
03. Node Shell 접속
Code Block |
---|
sansae@win10pro-worksp:/workspaces$ kubectl get node NAME STATUS ROLES AGE VERSION aks-nodepool1-31236416-vmss000000 Ready agent 70d v1.18.14 sansae@win10pro-worksp:/workspaces$ sansae@win10pro-worksp:/workspaces$ kubectl node-shell aks-nodepool1-31236416-vmss000000 spawning "nsenter-fbbiu2" on "aks-nodepool1-31236416-vmss000000" If you don't see a command prompt, try pressing enter. root@aks-nodepool1-31236416-vmss000000:/# root@aks-nodepool1-31236416-vmss000000:/# date Wed Apr 7 10:10:51 UTC 2021 root@aks-nodepool1-31236416-vmss000000:/# exit logout pod "nsenter-fbbiu2" deleted |
참고
Info | ||
---|---|---|
| ||
https://github.com/kvaps/kubectl-node-shell |
...