K9s provides a terminal UI to interact with your Kubernetes clusters. The aim of this project is to make it easier to navigate, observe and manage your applications in the wild. K9s continually watches Kubernetes for changes and offers subsequent commands to interact with your observed resources.
K9s is not pimped out by a big corporation with deep pockets. It is a complex OSS project that demands a lot of my time to maintain and support. K9s will always remain OSS and therefore free! That said, if you feel k9s makes your day to day Kubernetes journey a tad brighter, saves you time and makes you more productive, please consider sponsoring us! Your donations will go a long way in keeping our servers lights on and beers in our fridge!
Thank you!
Please refer to our K9s documentation site for installation, usage, customization and tips.
Wanna discuss K9s features with your fellow K9sers
or simply show your support for this tool?
K9s is available on Linux, macOS and Windows platforms. Binaries for Linux, Windows and Mac are available as tarballs in the release page.
Via Homebrew for macOS or Linux
brew install derailed/k9s/k9s
Via MacPorts
sudo port install k9s
Via snap for Linux
snap install k9s --devmode
On Arch Linux
pacman -S k9s
On OpenSUSE Linux distribution
zypper install k9s
On FreeBSD
pkg install k9s
Via Winget for Windows
winget install k9s
Via Scoop for Windows
scoop install k9s
Via Chocolatey for Windows
choco install k9s
Via a GO install
# NOTE: The dev version will be in effect! go install github.com/derailed/k9s@latest
Via Webi for Linux and macOS
curl -sS https://webinstall.dev/k9s | bash
Via pkgx for Linux and macOS
pkgx k9s
Via Webi for Windows
curl.exe -A MS https://webinstall.dev/k9s | powershell
As a Docker Desktop Extension (for the Docker Desktop built in Kubernetes Server)
docker extension install spurin/k9s-dd-extension:latest
K9s is currently using GO v1.21.X or above. In order to build K9s from source you must:
Clone the repo
Build and run the executable
make build && ./execs/k9s
You can run k9s as a Docker container by mounting your KUBECONFIG
:
docker run --rm -it -v $KUBECONFIG:/root/.kube/config quay.io/derailed/k9s
For default path it would be:
docker run --rm -it -v ~/.kube/config:/root/.kube/config quay.io/derailed/k9s
You can build your own Docker image of k9s from the Dockerfile with the following:
docker build -t k9s-docker:v0.0.1 .
You can get the latest stable kubectl
version and pass it to the docker build
command with the --build-arg
option.
You can use the --build-arg
option to pass any valid kubectl
version (like v1.18.0
or v1.19.1
).
KUBECTL_VERSION=$(make kubectl-stable-version 2>/dev/null) docker build --build-arg KUBECTL_VERSION=${KUBECTL_VERSION} -t k9s-docker:0.1 .
Run your container:
docker run --rm -it -v ~/.kube/config:/root/.kube/config k9s-docker:0.1
K9s uses 256 colors terminal mode. On `Nix system make sure TERM is set accordingly.
export TERM=xterm-256color
In order to issue resource edit commands make sure your EDITOR and KUBE_EDITOR env vars are set.
# Kubectl edit command will use this env var. export KUBE_EDITOR=my_fav_editor
K9s prefers recent kubernetes versions ie 1.28+
k9s | k8s client |
---|---|
>= v0.27.0 | 1.26.1 |
v0.26.7 - v0.26.6 | 1.25.3 |
v0.26.5 - v0.26.4 | 1.25.1 |
v0.26.3 - v0.26.1 | 1.24.3 |
v0.26.0 - v0.25.19 | 1.24.2 |
v0.25.18 - v0.25.3 | 1.22.3 |
v0.25.2 - v0.25.0 | 1.22.0 |
<= v0.24 | 1.21.3 |
# List current version k9s version # To get info about K9s runtime (logs, configs, etc..) k9s info # List all available CLI options k9s help # 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
Given the nature of the ui k9s does produce logs to a specific location. To view the logs and turn on debug mode, use the following commands:
# Find out where the logs are stored k9s info
____ __.________ | |/ _/ __ \______ | < \____ / ___/ | | \ / /\___ \ |____|__ \ /____//____ > \/ \/ Version: vX.Y.Z Config: /Users/fernand/.config/k9s/config.yaml Logs: /Users/fernand/.local/state/k9s/k9s.log Dumps dir: /Users/fernand/.local/state/k9s/screen-dumps Benchmarks dir: /Users/fernand/.local/state/k9s/benchmarks Skins dir: /Users/fernand/.local/share/k9s/skins Contexts dir: /Users/fernand/.local/share/k9s/clusters Custom views file: /Users/fernand/.local/share/k9s/views.yaml Plugins file: /Users/fernand/.local/share/k9s/plugins.yaml Hotkeys file: /Users/fernand/.local/share/k9s/hotkeys.yaml Alias file: /Users/fernand/.local/share/k9s/aliases.yaml
tail -f /Users/fernand/.local/data/k9s/k9s.log
k9s -l debug
You can override the default log file destination either with the --logFile
argument:
k9s --logFile /tmp/k9s.log less /tmp/k9s.log
Or through the K9S_LOGS_DIR
environment variable:
K9S_LOGS_DIR=/var/log k9s less /var/log/k9s.log
K9s uses aliases to navigate most K8s resources.
Action | Command | Comment |
---|---|---|
Show active keyboard mnemonics and help | ? | |
Show all available resource alias | ctrl-a | |
To bail out of K9s | :quit , :q , ctrl-c | |
To go up/back to the previous view | esc | If you have crumbs on, this will go to the previous one |
View a Kubernetes resource using singular/plural or short-name | : pod⏎ | accepts singular, plural, short-name or alias ie pod or pods |
View a Kubernetes resource in a given namespace | : pod ns-x⏎ | |
View filtered pods (New v0.30.0!) | : pod /fred⏎ | View all pods filtered by fred |
View labeled pods (New v0.30.0!) | : pod app=fred,env=dev⏎ | View all pods with labels matching app=fred and env=dev |
View pods in a given context (New v0.30.0!) | : pod @ctx1⏎ | View all pods in context ctx1. Switches out your current k9s context! |
Filter out a resource view given a filter | / filter⏎ | Regex2 supported ie `fred |
Inverse regex filter | / ! filter⏎ | Keep everything that doesn't match. |
Filter resource view by labels | / -l label-selector⏎ | |
Fuzzy find a resource given a filter | / -f filter⏎ | |
Bails out of view/command/filter mode | <esc> | |
Key mapping to describe, view, edit, view logs,... | d ,v , e , l ,... | |
To view and switch to another Kubernetes context (Pod view) | : ctx⏎ | |
To view and switch directly to another Kubernetes context (Last used view) | : ctx context-name⏎ | |
To view and switch to another Kubernetes namespace | : ns⏎ | |
To view all saved resources | : screendump or sd⏎ | |
To delete a resource (TAB and ENTER to confirm) | ctrl-d | |
To kill a resource (no confirmation dialog, equivalent to kubectl delete --now) | ctrl-k | |
Launch pulses view | : pulses or pu⏎ | |
Launch XRay view | : xray RESOURCE [NAMESPACE]⏎ | RESOURCE can be one of po, svc, dp, rs, sts, ds, NAMESPACE is optional |
Launch Popeye view | : popeye or pop⏎ | See popeye |
K9s keeps its configurations as YAML files inside of a k9s
directory and the location depends on your operating system. K9s leverages XDG to load its various configurations files. For information on the default locations for your OS please see this link. If you are still confused a quick k9s info
will reveal where k9s is loading its configurations from. Alternatively, you can set K9S_CONFIG_DIR
to tell K9s the directory location to pull its configurations from.
Unix | macOS | Windows |
---|---|---|
~/.config/k9s | ~/Library/Application Support/k9s | %LOCALAPPDATA%\k9s |
NOTE: This is still in flux and will change while in pre-release stage!
You can now override the context portForward default address configuration by setting an env variable that can override all clusters portForward local address using K9S_DEFAULT_PF_ADDRESS=a.b.c.d
# $XDG_CONFIG_HOME/k9s/config.yaml k9s: # Enable periodic refresh of resource browser windows. Default false liveViewAutoRefresh: false # The path to screen dump. Default:
字节跳动发布的AI编程神器IDE
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。
全能AI智能助手,随时解答生活与工作的多样问题
问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。
实时语音翻译/同声传译工具
Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。
一键生成PPT和Word,让学习生活更轻松
讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。
深度推理能力全新升级,全面对标OpenAI o1
科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问 题,满足多样化使用场景。
一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型
Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。
AI助力,做PPT更简单!
咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群, 能高效制作出高品质 PPT,满足不同场景演示需求。
选题、配图、成文,一站式创作,让内容运营更高效
讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。
专业的AI公文写作平台,公文写作神器
AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。
OpenAI Agents SDK,助力开发者便捷使用 OpenAI 相关功能。
openai-agents-python 是 OpenAI 推出的一款强大 Python SDK,它为开发者提供了与 OpenAI 模型交互的高效工具,支持工具调用、结果处理、追踪等功能,涵盖多种应用场景,如研究助手、财务研究等,能显著提升开发效率,让开发者更轻松地利用 OpenAI 的技术优势。
最新AI工具、AI资讯
独家AI资源、AI项目落地
微信扫一扫关注公众号