节点 Shell
概述
通过为给定上下文启用 nodeShell 功能开关,K9s 允许您进入集群节点的 shell。启用后,在节点视图中,您将看到一个新的菜单选项 s
,代表 shell
。K9s 将使用一个特殊的 k9s_shell pod 在所选节点上启动一个 pod。此外,您还可以使用一个预装了您喜欢的 shell 工具的自定义 Docker 镜像来优化您的 shell pod。默认情况下,K9s 使用 BusyBox 镜像,但您可以按如下方式进行配置:
仍在开发中... 随着此功能的完善,选项和布局在未来的 K9s 版本中可能会发生变化。
示例
# $XDG_CONFIG_HOME/k9s/config.yaml
k9s:
...
# Customize your shell pod configuration here. This will be used by all your clusters.
shellPod:
image: cool_kid_admin:42
namespace: default
limits:
cpu: 100m
memory: 100Mi
...
然后在您的 blee
上下文配置中启用该功能开关。
# $XDG_DATA_HOME/k9s/clusters/clusterX/blee/config.yaml
k9s:
cluster: clusterX
readOnly: false
namespace:
active: kube-system
lockFavorites: false
favorites:
- all
- kube-system
- default
view:
active: pod
featureGates:
nodeShell: true # => enable nodeShell for this context. Defaults to false
portForwardAddress: localhost
