728x90
반응형
홈페이지 : https://krew.sigs.k8s.io/docs/user-guide/quickstart/
1. 다운로드 & 설치
(
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/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
)
2. 환경변수 설정
vi .bashrc
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
# . /etc/bash_completion
#fi
source <(kubectl completion bash)
# krew 환경변수 추가
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
적용
source .bashrc
3. krew가 실행 되는지 확인
root@master:~# kubectl krew
krew is the kubectl plugin manager.
You can invoke krew through kubectl: "kubectl krew [command]..."
Usage:
kubectl krew [command]
Available Commands:
help Help about any command
index Manage custom plugin indexes
info Show information about an available plugin
install Install kubectl plugins
list List installed kubectl plugins
search Discover kubectl plugins
uninstall Uninstall plugins
update Update the local copy of the plugin index
upgrade Upgrade installed plugins to newer versions
version Show krew version and diagnostics
Flags:
-h, --help help for krew
-v, --v Level number for the log level verbosity
Use "kubectl krew [command] --help" for more information about a command.
4. 사용가능한 플러그인 검색
- kubectl krew update
- kubectl krew search
검색 키워드를 인수로 지정할 수 있습니다.
kubectl krew search pod
NAME DESCRIPTION INSTALLED
evict-pod Evicts the given pod no
pod-dive Shows a pod's workload tree and info inside a node no
pod-logs Display a list of pods to get logs from no
pod-shell Display a list of pods to execute a shell in no
rm-standalone-pods Remove all pods without owner references no
support-bundle Creates support bundles for off-cluster analysis no
플러그인에 대해 자세히 알아보기
플러그인에 대한 자세한 정보를 얻으려면 다음을 실행하세요 kubectl krew info <PLUGIN>.
kubectl krew info tree
NAME: tree
VERSION: v0.4.0
DESCRIPTION:
This plugin shows sub-resources of a specified Kubernetes API object in a
tree view in the command-line. The parent-child relationship is discovered
using ownerReferences on the child object.
...
root@master:~# kubectl krew search exec-as
NAME DESCRIPTION INSTALLED
exec-as Like kubectl exec, but offers a `user` flag to ... no
htpasswd Create nginx-ingress compatible basic-auth secrets no
/* 검색후 설치 */
kubectl krew install exec-as
728x90
반응형
'시스템 > 쿠버네티스' 카테고리의 다른 글
[쿠버네티스] 도커로 젠킨스 설치 (0) | 2024.01.12 |
---|---|
[쿠버네티스] Java PKIX path building failed: 에러 해결 (0) | 2024.01.12 |
[쿠버네티스] 깃랩 SSL certificate problem: unable to get local issuer certificate (0) | 2024.01.11 |
[쿠버네티스] 깃랩(Giglab) 설치 (0) | 2024.01.10 |
[쿠버네티스] Harbor(하버) 설치하기 TLS CA키 생성 (0) | 2024.01.10 |
댓글