BlueXIII's Blog

热爱技术,持续学习

0%

K9S常用操作

参考

https://i.cloudnative.to/toolkits/kubernetes/k9s

离线安装

https://k9scli.io/topics/install/

1
2
tar -zxvf k9s_Linux_amd64.tar.gz
cp ./k9s /usr/local/bin/

常用操作

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# 启动
k9s
k9s -n your_namespace
$ k9s --readonly
k9s info
# 帮助
?
# 显示所有别名
ctrl+a
# 查看资源
:po # pods
:dp # deployments
:rs # replicasets
:svc # services
:cm # configmap
:sec # secrets
:rb # rolebinding
:ns # namespaces
:node # nodes
:dp 或 :rs

# 快捷操作(界面上方有提示)
ctrl-d # 删除
a # attach
d # 查看描述
e # 编辑
l # 日志
s # shell
/ # 过滤


# 伸缩
按`:dp`进入deployments界面后,按`s`调整

# 端口转发
shift-f

# Pulses高级功能,资源总览
:pu

# XRay高级功能,显示资源关系图,支持探查:Pods, Deployments, StatefulSets, Services, DaemonSets
:x po
:x dp
:x sts
:x svc
:x ds

# Popeye功能,报告潜在问题
:popeye