# Kubectl edit command will use this env var. export EDITOR=my_fav_editor # Should your editor deals with streamed vs on disk files differently, also set... export K9S_EDITOR=my_fav_editor
K9s 更喜欢最近的 kubernetes 版本,即 1.16+。
K9s 将其配置保存在 k9s 目录中,位置取决于您的操作系统, 其利用 XDG 加载其各种配置文件。 Unix : ~/.config/k9s Mac : ~/Library/Application Support/k9s Windows : %LOCALAPPDATA%\k9s
# $XDG_CONFIG_HOME/k9s/config.yml k9s: clusters: # Configures node shell on cluster blee blee: featureGates: # You must enable the nodeShell feature gate to enable shelling into nodes nodeShell: true # You can also further tune the shell pod specification shellPod: image: cool_kid_admin:42 namespace: blee limits: cpu: 100m memory: 100Mi
HotKey Support 设置: 允许用户定义自己的热键来激活他们最喜欢的资源视图。
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# $XDG_CONFIG_HOME/k9s/hotkey.yml cat <<'EOF' > ~/.config/k9s/hotkey.yml hotKey: # Hitting Shift-0 navigates to your pod view shift-0: shortCut: Shift-0 description: Viewing pods command: pods # Hitting Shift-1 navigates to your deployments shift-1: shortCut: Shift-1 description: View deployments command: dp EOF
# $XDG_CONFIG_HOME/k9s/skin.yml cat <<'EOF' > ~/.config/k9s/skin.yml # Skin InTheNavy... k9s: # General K9s styles body: fgColor: dodgerblue bgColor: '#ffffff' logoColor: '#0000ff' # ClusterInfoView styles. info: fgColor: lightskyblue sectionColor: steelblue # Help panel styles help: fgColor: white bgColor: black keyColor: cyan numKeyColor: blue sectionColor: gray frame: # Borders styles. border: fgColor: dodgerblue focusColor: aliceblue # MenuView attributes and styles. menu: fgColor: darkblue keyColor: cornflowerblue # Used for favorite namespaces numKeyColor: cadetblue # CrumbView attributes for history navigation. crumbs: fgColor: white bgColor: steelblue activeColor: skyblue # Resource status and update styles status: newColor: '#00ff00' modifyColor: powderblue addColor: lightskyblue errorColor: indianred highlightcolor: royalblue killColor: slategray completedColor: gray # Border title styles. title: fgColor: aqua bgColor: white highlightColor: skyblue counterColor: slateblue filterColor: slategray views: # TableView attributes. table: fgColor: blue bgColor: darkblue cursorColor: aqua # Header row styles. header: fgColor: white bgColor: darkblue sorterColor: orange # YAML info styles. yaml: keyColor: steelblue colonColor: blue valueColor: royalblue # Logs styles. logs: fgColor: white bgColor: black EOF
0x02 命令实践
命令参数
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
# List all available CLI options k9s help
# To get info about K9s runtime (logs, configs, etc..) k9s info # Configuration: /root/.config/k9s/config.yml # Logs: /tmp/k9s-root.log # Screen Dumps: /tmp/k9s-screens-root
# To run K9s in a given namespace k9s -n mycoolns
# Start K9s in an existing KubeConfig context k9s --context coolCtx
# Start K9s in readonly mode - with all cluster modification commands disabled k9s --readonly
简单使用
使用截图
Pulses - A top level dashboard of the state of affairs of your cluster
XRay - Dig in your cluster resources and view their dependencies
Pods - List out your pods status and resource consumption
RBAC - View the who/what/how of authorizations on your cluster
方式1.请访问本博主的B站【WeiyiGeek】首页关注UP主, 将自动随机获取解锁验证码。
Method 2.Please visit 【My Twitter】. There is an article verification code in the homepage.
方式3.扫一扫下方二维码,关注本站官方公众号
回复:验证码
将获取解锁(有效期7天)本站所有技术文章哟!