](https://smithery.ai/server/@bourbonkk/k8s-pilot) 
Kubernetes舰队的中心飞行员✈️✈️
k8s_pilot 是一个轻量级的集中式控制平面服务器,用于管理 多个Kubernetes集群 马上。\ 借助强大的工具和直观的API,您可以从一个驾驶舱观察和控制所有集群。
______________________________________________________________________
🚀 概述
- 🔄 支持 多集群上下文切换
- 🔧 使能够 CRUD操作 在最常见的Kubernetes资源上
- 🔒 只读模式 用于安全集群检查
- ⚙️ 由...驱动 主控程序 Claude AI及其他
______________________________________________________________________
🧰 先决条件
- python 3.13 或更高
uv包管理器- 访问Kubernetes集群(
~/.kube/config或在集群配置中)
# Install uv (if not installed)
# For MacOS
brew install uv
# For Linux
curl -LsSf https://astral.sh/uv/install.sh | sh安装
# Clone the repository
git clone https://github.com/bourbonkk/k8s-pilot.git
cd k8s-pilot
# Launch with uv + MCP
uv run --with mcp[cli] mcp run k8s_pilot.py用法
正常模式(完全访问)
# Start with full read/write access
uv run --with mcp[cli] mcp run k8s_pilot.py只读模式(安全检查)
# Start in readonly mode - only read operations allowed
uv run --with mcp[cli] python k8s_pilot.py --readonly命令行选项
# Show help
uv run --with mcp[cli] python k8s_pilot.py --help只读模式
这 --readonly flag启用安全模式,防止对Kubernetes集群进行任何写入操作。这非常适合:
- 集群检查 没有意外变化的风险
- 审计场景 您需要查看但不需要修改的位置
- 学习环境 你想安全探索的地方
- 生产监控 修改风险为零
受保护的操作(在只读模式下被阻止)
pod_create,pod_update,pod_deletedeployment_create,deployment_update,deployment_deleteservice_create,service_update,service_deleteconfigmap_create,configmap_update,configmap_deletesecret_create,secret_update,secret_deletenamespace_create,namespace_delete- 所有其他创建/更新/删除操作
允许的操作(始终可用)
pod_list,pod_detail,pod_logsdeployment_list,deployment_getservice_list,service_getconfigmap_list,configmap_getsecret_list,secret_getnamespace_list,namespace_get- 所有其他列表/获取操作
使用Claude Desktop
使用此配置从Claude中运行k8s_pilot MCP服务器:
{
"mcpServers": {
"k8s_pilot": {
"command": "uv",
"args": [
"--directory",
"
/k8s-pilot",
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"k8s_pilot.py"
]
}
}
}对于只读模式,请使用以下配置:
{
"mcpServers": {
"k8s_pilot_readonly": {
"command": "uv",
"args": [
"--directory",
"
/k8s-pilot",
"run",
"--with",
"mcp[cli]",
"python",
"k8s_pilot.py",
"--readonly"
]
}
}
}替换 使用您克隆存储库的实际目录。
场景
使用pypy命名空间中的nginx:latest映像创建部署,并创建连接到它的服务。
主要特点
多集群管理
- 与多个Kubernetes集群无缝交互
- 执行上下文感知操作
- 通过MCP提示轻松切换集群
资源控制
- 查看、创建、更新、删除:
- 部署、服务、Pod - 伪装、秘密、入口 - 状态集、守护集 - 角色,集群角色 - 持续数量和索赔
命名空间操作
- 创建/删除命名空间
- 列出命名空间中的所有资源
- 管理标签和资源配额
节点管理
- 查看节点详细信息和条件
- 带/不带、标签/污染节点
- 列出每个节点的Pod
许可证
该项目根据MIT许可证获得许可。请参阅 许可证 文件以获取详细信息。

