首页 教程 如何优化Kubernetes的集群管理

如何优化Kubernetes的集群管理

提供标准的集群管理命令,例如log,scaling,port-forward,restart…

通过别名和热键自定义命令快捷方式。

支持扩展K9s插件以创建自己的集群命令。

强大的过滤模式:允许用户向下钻并查看与工作负载相关的资源。

误差放大:直接深入了解群集资源的问题。

外观可定制

通过K9s皮肤定义自己的终端外观。

按资源自定义/安排要显示的列。

提供查看最小或完整资源定义的切换

通过Pulses和XRay视图提供群集资源的概述。

RBAC

支持查看RBAC规则,例如群集/角色及其关联的绑定。

反向查找断言用户/组或ServiceAccount可以在集群上做什么。

可以直接从K9s内置的基准测试对HTTP services/pods进行基准测试,以查看应用程序的运行情况,并相应地调整资源请求/限制。

K9s提供方便地遍历Kubernetes资源及其相关资源。

安装

K9s可用于Linux、macOS和Windows平台,可直接参考K9s官方文档,因为非常简单这里就不再过多赘述。

命令

K9s是一个用于查看和管理Kubernetes集群的CLI。接下来我们一起学习一下它的使用方法,感受下它的便捷和强大。

帮助命令

k9s help:列出所有可用的CLI选项

# k9s help 

K9s is a CLI to view and manage your Kubernetes clusters. 

 

Usage: 

  k9s [flags] 

  k9s [command] 

 

Available Commands: 

  helpHelp about any command 

  infoPrint configuration info 

  version Print version/build info 

 

Flags: 

  -A, –all-namespaces Launch K9s in all namespaces

  –as string  Username to impersonate for the operation

  –as-group stringArray   Group to impersonate for the operation

  –certificate-authority string   Path to a cert file for the certificate authority

  –client-certificate string  Path to a client certificate file for TLS

  –client-key string  Path to a client key file for TLS

  –cluster string The name of the kubeconfig cluster to use

  -c, –command string Specify the default command to view when the application launches

  –context string The name of the kubeconfig context to use

  –demo   Enable demo mode to show keyboard commands

  –headless   Turn K9s header off

  -h, –help   help for k9s

  –insecure-skip-tls-verify   If true, the server's caCertFile will not be checked for validity

  –kubeconfig string  Path to the kubeconfig file to use for CLI requests

  -l, –logLevel stringSpecify a log level (info, warn, debug, error, fatal, panic, trace) (default "info")

  -n, –namespace string   If present, the namespace scope for this CLI request

  –readonly   Disable all commands that modify the cluster

  -r, –refresh intSpecify the default refresh rate as an integer (sec) (default 2)

  –request-timeout string The length of time to wait before giving up on a single server request

  –token string   Bearer token for authentication to the API server

  –user stringThe name of the kubeconfig user to use

 

Use "k9s [command] –help" for more information about a command. 

关于作者: dawei

【声明】:乐山站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

热门文章