About weibaohui/kom
weibaohui/kom is an MCP server published by weibaohui in the Cloud category: kom 是一个用于 Kubernetes 操作的工具,SDK级的kubectl、client-go的使用封装。并且支持作为管理k8s 的 MCP server。 它提供了一系列功能来管理 Kubernetes 资源,包括创建、更新、删除和获取资源,甚至使用SQL查询k8s资源。这个项目支持多种 Kubernetes 资源类型的操作,并能够处理自定义资源定义(CRD)。 通过使用 kom,你可以轻松地进行资源的增删改查和日志获取以及操作POD内文件等动作。. Conduid read 58 tools from its source: annotate_k8s_resource, cordon_k8s_node, delete_k8s_pod, delete_k8s_resource, delete_pod_file, describe_k8s_pod and 52 more. No package is published for it, so it installs from a source checkout.
The repository has 150 stars and 34 forks, is licensed MIT, and its last commit was on 29 Sep 2026. The latest release is v0.2.72 (14 Aug 2026): What's Changed fix(mcp): use *[]byte for ExecHandler dest (#81) @weibaohui mcp/tools/pod.ExecHandler declared var execResult string and called Execute(&execResult), but… It follows v0.2.71 (24 Jan 2026), and the 5 most recent releases go back to v0.2.68 (22 Nov 2025). It passes 5 of the 6 static checks Conduid ran on the repository; it does not pass Scoped permissions. Its topics include kubectl, sdk, client-go, crd, cluster and kom.
Install
git clone https://github.com/weibaohui/komTools (58)
annotate_k8s_resource为Kubernetes资源添加或删除注解 / Add or remove annotations for Kubernetes resource| Parameter | Type | Description |
|---|---|---|
| annotation | string | 要添加或删除的注解(使用key=value添加,key-删除)/ Annotation to add or remove (use key=value to add, key- to remove) |
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
| group | string | 资源的API组 / API group of the resource |
| kind | string | 资源的类型 / Kind of the resource |
| name | string | 资源的名称 / Name of the resource |
| namespace | string | 资源所在的命名空间(集群范围资源可选)/ Namespace of the resource (optional for cluster-scoped resources) |
| version | string | 资源的API版本 / API version of the resource |
cordon_k8s_node设置节点为不可调度状态,等同于kubectl cordon <node> / Mark node as unschedulable, equivalent to kubectl cordon <node>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 节点所在的集群 (使用空字符串表示默认集群)/ The cluster of the node |
| name * | string | 节点名称 / The name of the node |
delete_k8s_pod删除指定的Pod (类似命令: kubectl delete pod <pod-name> -n <namespace>) / Delete specified Pod| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Pod的集群(使用空字符串表示默认集群)/ Cluster where the Pod is running (use empty string for default cluster) |
| force | boolean | 强制删除Pod / Force delete the Pod |
| name * | string | Pod的名称 / Name of the Pod |
| namespace * | string | Pod所在的命名空间 / Namespace of the Pod |
delete_k8s_resource通过集群、命名空间和名称删除Kubernetes资源 / Delete Kubernetes resource by cluster, namespace, and name| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
| force | boolean | 强制删除资源 / Force delete the resource |
| group | string | 资源的API组 / API group of the resource |
| kind | string | 资源的类型 / Kind of the resource |
| name | string | 资源的名称 / Name of the resource |
| namespace | string | 资源所在的命名空间(集群范围资源可选)/ Namespace of the resource (optional for cluster-scoped resources) |
| version | string | 资源的API版本 / API version of the resource |
delete_pod_file删除Pod中的指定文件 (类似命令: kubectl exec <pod-name> -n <namespace> -c <container> -- rm <path>) / Delete file in pod| Parameter | Type | Description |
|---|---|---|
| cluster | string | 集群名称(使用空字符串表示默认集群)/Cluster name |
| container | string | 容器名称/Container name |
| name | string | Pod名称/Pod name |
| namespace | string | 命名空间/Namespace |
| path | string | 目标路径/Target path |
describe_k8s_pod描述Pod容器组,(类似命令: kubectl describe pod -n <namespace> pod_name )| Parameter | Type | Description |
|---|---|---|
| cluster | string | Pod所在集群(使用空字符串表示默认集群) |
| name * | string | Pod名称 |
| namespace * | string | Pod所在的命名空间(集群范围资源可选) |
describe_k8s_resource通过集群、命名空间和名称获取Kubernetes资源详情 / Retrieve Kubernetes resource details by cluster, namespace, and name| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
| group | string | 资源的API组 / API group of the resource |
| kind | string | 资源的类型 / Kind of the resource |
| name | string | 资源的名称 / Name of the resource |
| namespace | string | 资源所在的命名空间(集群范围资源可选)/ Namespace of the resource (optional for cluster-scoped resources) |
| version | string | 资源的API版本 / API version of the resource |
drain_k8s_node清空节点上的Pod并防止新的Pod调度,等同于kubectl drain <node> / Drain all pods from node and prevent new scheduling, equivalent to kubectl drain <node>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 节点所在的集群 (使用空字符串表示默认集群)/ The cluster of the node |
| name * | string | 节点名称 / The name of the node |
get_k8s_deployment_hpa_list查询Deployment的HPA列表。对应kubectl命令: kubectl get hpa -n <namespace> | grep <deployment-name> / Query deployment HPA list. Equivalent kubectl command: kubectl get hpa -n <namespace> | grep <deployment-name>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 / The cluster runs the deployment |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
get_k8s_deployment_rollout_history查询Deployment的升级历史。对应kubectl命令: kubectl rollout history deployment/<name> -n <namespace> / Query deployment rollout history. Equivalent kubectl command: kubectl rollout history deployment/<name> -n <namespace>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 (使用空字符串表示默认集群)/ The cluster runs the deployment |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
get_k8s_deployment_rollout_status查询Deployment的升级状态 / Query deployment rollout status| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 (使用空字符串表示默认集群)/ The cluster runs the deployment |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
get_k8s_node_ip_usage查询节点IP资源使用情况 (类似命令: kubectl describe node <node-name> | grep Allocated) / Query node IP resource usage| Parameter | Type | Description |
|---|---|---|
| cache_seconds | number | 缓存时间(默认20秒) / Cache duration in seconds,default 20 seconds |
| cluster | string | 节点所在的集群 (使用空字符串表示默认集群)/ The cluster of the node |
| name * | string | 节点名称 / The name of the node |
get_k8s_node_resource_usage查询节点资源使用情况统计,包括内存、CPU用量 (类似命令: kubectl describe node <node-name> | grep -A 5 Allocated) / Query node resource usage statistics| Parameter | Type | Description |
|---|---|---|
| cache_seconds | number | 缓存时间(默认20秒) / Cache duration in seconds,default 20 seconds |
| cluster | string | 节点所在的集群 (使用空字符串表示默认集群)/ The cluster of the node |
| name * | string | 节点名称 / The name of the node |
get_k8s_pod_count_running_on_node查询某个节点上运行的Pod数量统计 (类似命令: kubectl describe node <node-name> | grep Pods) / Query node Pod count statistics| Parameter | Type | Description |
|---|---|---|
| cache_seconds | number | 缓存时间(默认20秒) / Cache duration in seconds,default 20 seconds |
| cluster | string | 节点所在的集群 (使用空字符串表示默认集群)/ The cluster of the node |
| name * | string | 节点名称 / The name of the node |
get_k8s_pod_linked_env通过进入pod执行Env命令,获取Pod运行时的环境变量信息 (类似命令: kubectl exec -n <namespace> <pod-name> -- env) / Get pod runtime environment variables by executing Env command| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Pod的集群 (使用空字符串表示默认集群) / The cluster runs the pod |
| name | string | Pod的名称 / The name of the pod |
| namespace | string | Pod所在的命名空间 / The namespace of the pod |
get_k8s_pod_linked_pv获取与Pod关联的PersistentVolume (类似命令: kubectl get pv | grep <pod-name>)| Parameter | Type | Description |
|---|---|---|
| cluster | string | 集群名称(使用空字符串表示默认集群) |
| name * | string | Pod名称 |
| namespace * | string | Pod所在命名空间 |
get_k8s_pod_linked_pvc获取与Pod关联的PersistentVolumeClaim (类似命令: kubectl get pvc -n <namespace> | grep <pod-name>)| Parameter | Type | Description |
|---|---|---|
| cluster | string | 集群名称(使用空字符串表示默认集群) |
| name * | string | Pod名称 |
| namespace * | string | Pod所在命名空间 |
get_k8s_pod_linked_services获取与Pod关联的Service,通过集群、命名空间和Pod名称 (类似命令: kubectl get svc -n <namespace> -l app=<pod-label>) / Get services linked to pod by cluster, namespace and name| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Pod的集群 (使用空字符串表示默认集群) / The cluster runs the pod |
| name | string | Pod的名称 / The name of the pod |
| namespace | string | Pod所在的命名空间 / The namespace of the pod |
get_k8s_pod_logs获取Pod日志,通过集群、命名空间和名称,可限制返回行数 (类似命令: kubectl logs [-f] [-p] [-c container] [-n namespace] <pod-name> [--tail=N]) / Get pod logs by cluster, namespace and name with tail lines limit| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Pod的集群 (使用空字符串表示默认集群) (使用空字符串表示默认集群)/ The cluster runs the pod |
| container | string | Pod中容器的名称(如果Pod中有多个容器则必须指定,只有一个容器时可以为空) / Name of the container in the pod (must be specified if there are more than one container in Pod, only one container could use empty string) |
| name * | string | Pod的名称 / The name of the pod |
| namespace * | string | Pod所在的命名空间 / The namespace of the pod |
| previous | boolean | 是否获取上一个容器的日志(默认false) / Whether to get logs from the previous container (default false) |
| tail | number | 显示日志末尾的行数(默认100行) / Number of lines from the end of the logs to show (default 100) |
get_k8s_pod_resource_usage获取Pod的资源使用情况,包括CPU和内存的请求值、限制值、可分配值和使用比例 (类似命令: kubectl describe pod <pod-name> -n <namespace>, kubectl top pod <pod-name> -n <namespace>) / Get pod resource usage including CPU and memory request, limit, allocatable and usage ratio| Parameter | Type | Description |
|---|---|---|
| cache_seconds | number | 缓存时间(默认20秒) / Cache duration in seconds,default 20 seconds |
| cluster | string | 运行Pod的集群 (使用空字符串表示默认集群) / The cluster runs the pod |
| name * | string | Pod的名称 / The name of the pod |
| namespace * | string | Pod所在的命名空间 / The namespace of the pod |
get_k8s_resource通过集群、命名空间和名称获取Kubernetes资源详情 / Retrieve Kubernetes resource details by cluster, namespace, and name| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
| group | string | 资源的API组 / API group of the resource |
| kind | string | 资源的类型 / Kind of the resource |
| name | string | 资源的名称 / Name of the resource |
| namespace | string | 资源所在的命名空间(集群范围资源可选)/ Namespace of the resource (optional for cluster-scoped resources) |
| version | string | 资源的API版本 / API version of the resource |
get_k8s_storageclass_pv_count获取StorageClass下的PV数量 / Get PV count of StorageClass (等同于 kubectl get pv -l "storageclass.kubernetes.io/name=<storageclass-name>" --no-headers | wc -l)| Parameter | Type | Description |
|---|---|---|
| cluster | string | StorageClass所在的集群(使用空字符串表示默认集群) / The cluster of the StorageClass |
| name | string | StorageClass的名称 / The name of the StorageClass |
get_k8s_storageclass_pvc_count获取StorageClass下的PVC数量 / Get PVC count of StorageClass (等同于 kubectl get pvc -l "storageclass.kubernetes.io/name=<storageclass-name>" --no-headers | wc -l)| Parameter | Type | Description |
|---|---|---|
| cluster | string | StorageClass所在的集群(使用空字符串表示默认集群) / The cluster of the StorageClass |
| name | string | StorageClass的名称 / The name of the StorageClass |
get_k8s_top_node获取Node节点 CPU 内存 资源用量排名 列表 (类似命令 kubectl top nodes -n ns)| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
get_k8s_top_pod获取Pod CPU 内存 资源用量排名 列表 (类似命令 kubectl top pods -n ns)| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
| namespace | string | 资源所在的命名空间(集群范围资源可选)/ Namespace of the resources (optional for cluster-scoped resources) |
get_pod_linked_endpoints获取与Pod关联的Endpoints,通过集群、命名空间和Pod名称 (类似命令: kubectl get endpoints -n <namespace> | grep <pod-ip>) / Get endpoints linked to pod by cluster, namespace and name| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Pod的集群 (使用空字符串表示默认集群) / The cluster runs the pod |
| name | string | Pod的名称 / The name of the pod |
| namespace | string | Pod所在的命名空间 / The namespace of the pod |
get_pod_linked_env_from_yaml通过Pod yaml 定义 获取Pod定义中的环境变量信息 (类似命令: kubectl get pod <pod-name> -n <namespace> -o jsonpath='{.spec.containers[*].env}') / Get environment variables from pod definition| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Pod的集群 (使用空字符串表示默认集群) / The cluster runs the pod |
| name | string | Pod的名称 / The name of the pod |
| namespace | string | Pod所在的命名空间 / The namespace of the pod |
get_pod_linked_ingresses获取与Pod关联的Ingress,通过集群、命名空间和Pod名称 (类似命令: kubectl get ingress -n <namespace> -o wide | grep <service-name>) / Get ingresses linked to pod by cluster, namespace and name| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Pod的集群 (使用空字符串表示默认集群) / The cluster runs the pod |
| name | string | Pod的名称 / The name of the pod |
| namespace | string | Pod所在的命名空间 / The namespace of the pod |
label_k8s_resource为Kubernetes资源添加或删除标签 / Add or remove labels for Kubernetes resource| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
| group | string | 资源的API组 / API group of the resource |
| kind | string | 资源的类型 / Kind of the resource |
| label | string | 要添加或删除的标签(使用key=value添加,key-删除)/ Label to add or remove (use key=value to add, key- to remove) |
| name | string | 资源的名称 / Name of the resource |
| namespace | string | 资源所在的命名空间(集群范围资源可选)/ Namespace of the resource (optional for cluster-scoped resources) |
| version | string | 资源的API版本 / API version of the resource |
list_files_in_k8s_pod获取Pod中指定路径下的文件列表 (类似命令: kubectl exec <pod-name> -n <namespace> -c <container> -- ls <path>) / List files in pod path| Parameter | Type | Description |
|---|---|---|
| cluster | string | 集群名称(使用空字符串表示默认集群)/Cluster name |
| container | string | 容器名称/Container name |
| name | string | Pod名称/Pod name |
| namespace | string | 命名空间/Namespace |
| path | string | 目标路径/Target path |
list_k8s_clusters列出所有已注册的Kubernetes集群(可用集群、可操作集群) / List all registered Kubernetes clusterslist_k8s_deploy_event列出Deployment相关的事件。 kubectl get events -n <namespace> )| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行事件的集群(使用空字符串表示默认集群) |
| name * | string | Deploy名称 |
| namespace * | string | Deploy所在的命名空间 |
list_k8s_event按集群和命名空间列出Kubernetes事件 (等同于: kubectl get events -n <namespace>) / List Kubernetes events by cluster and namespace (equivalent to: kubectl get events [-n <namespace>])| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行事件的集群(使用空字符串表示默认集群)/ Cluster where the events are running (use empty string for default cluster) |
| involvedObjectName | string | 按涉及对象名称过滤事件 / Filter events by involved object name |
| namespace | string | 事件所在的命名空间(可选)/ Namespace of the events (optional) |
list_k8s_namespace获取命名空间列表| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
list_k8s_node获取Node列表 (类似命令 kubectl get node)| Parameter | Type | Description |
|---|---|---|
| cluster | string | Node所在集群(使用空字符串表示默认集群) |
list_k8s_pod获取Pod列表 (类似命令 kubectl get pods -n ns)| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
| fieldSelector | string | 用于过滤资源的字段选择器(例如:metadata.name=test-deploy)/ Field selector to filter resources (e.g. metadata.name=test-deploy) |
| namespace * | string | 资源所在的命名空间(集群范围资源可选)/ Namespace of the resources (optional for cluster-scoped resources) |
list_k8s_pod_event列出Pod相关的事件。 kubectl get events -n <namespace> )| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行事件的集群(使用空字符串表示默认集群) |
| name * | string | Pod名称 |
| namespace * | string | Pod所在的命名空间 |
list_k8s_resource按集群和资源类型列出Kubernetes资源,获取列表 / List Kubernetes resources by cluster and resource type| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
| fieldSelector | string | 用于过滤资源的字段选择器(例如:metadata.name=test-deploy)/ Field selector to filter resources (e.g. metadata.name=test-deploy) |
| group | string | 资源的API组 / API group of the resource |
| kind | string | 资源的类型 / Kind of the resource |
| labelSelector | string | 用于过滤资源的标签选择器(例如:app=k8m)/ Label selector to filter resources (e.g. app=k8m) |
| namespace | string | 资源所在的命名空间(集群范围资源可选)/ Namespace of the resources (optional for cluster-scoped resources) |
| version | string | 资源的API版本 / API version of the resource |
list_pod_all_files获取Pod中指定路径下的所有文件列表(包含子目录)(类似命令: kubectl exec <pod-name> -n <namespace> -c <container> -- find <path>) / List all files in pod path (including subdirectories)| Parameter | Type | Description |
|---|---|---|
| cluster | string | 集群名称(使用空字符串表示默认集群)/Cluster name |
| container | string | 容器名称/Container name |
| name | string | Pod名称/Pod name |
| namespace | string | 命名空间/Namespace |
| path | string | 目标路径/Target path |
patch_k8s_resource通过集群、命名空间和名称更新Kubernetes资源 / Patch Kubernetes resource by cluster, namespace, and name| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行资源的集群(使用空字符串表示默认集群)/ Cluster where the resources are running (use empty string for default cluster) |
| group | string | 资源的API组 / API group of the resource |
| kind | string | 资源的类型 / Kind of the resource |
| name | string | 资源的名称 / Name of the resource |
| namespace | string | 资源所在的命名空间(集群范围资源可选)/ Namespace of the resource (optional for cluster-scoped resources) |
| patch_data | string | JSON补丁数据,使用application/strategic-merge-patch+json格式,用于更新资源的配置,例如:{"spec":{"replicas":5},"metadata":{"labels":{"new-label":"new-value"}}} / JSON patch data in application/strategic-merge-patch+json format for updating resource configuration |
| version | string | 资源的API版本 / API version of the resource |
pause_k8s_deployment_rollout暂停Deployment的升级过程 / Pause deployment rollout| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 (使用空字符串表示默认集群)/ The cluster runs the deployment |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
register_k8s_cluster动态注册新的Kubernetes集群 / Dynamically register a new Kubernetes cluster| Parameter | Type | Description |
|---|---|---|
| cluster_id | string | 集群的唯一标识符 / Unique identifier for the cluster |
| is_default | boolean | 是否设置为默认集群 / Whether to set as default cluster |
| kubeconfig_content | string | kubeconfig内容(与kubeconfig_path二选一)/ Kubeconfig content (alternative to kubeconfig_path) |
| kubeconfig_path | string | kubeconfig文件路径 / Path to the kubeconfig file |
restart_k8s_daemonset通过集群、命名空间和名称,重启DaemonSet。对应kubectl命令: kubectl rollout restart daemonset/<name> -n <namespace> / Restart daemonset by cluster, namespace and name. Equivalent kubectl command: kubectl rollout restart daemonset/<name> -n <namespace>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行DaemonSet的集群 (使用空字符串表示默认集群)/ The cluster runs the daemonset |
| name | string | DaemonSet的名称 / The name of the daemonset |
| namespace | string | DaemonSet所在的命名空间 / The namespace of the daemonset |
restart_k8s_deployment通过集群、命名空间和名称,重启Deployment。对应kubectl命令: kubectl rollout restart deployment/<name> -n <namespace> / Restart deployment by cluster, namespace and name. Equivalent kubectl command: kubectl rollout restart deployment/<name> -n <namespace>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 (使用空字符串表示默认集群)/ The cluster runs the deployment |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
restore_k8s_deployment恢复Deployment副本数,(从注解中恢复原始副本数,如果没有注解则默认为1)。对应kubectl命令: kubectl scale deployment/<name> --replicas=<original_replicas> -n <namespace> / Restore deployment replicas from annotation, default to 1 if not found. Equivalent kubectl command: kubectl scale deployment/<name> --replicas=<original_replicas> -n <namespace>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 (使用空字符串表示默认集群)/ The cluster runs the deployment |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
resume_k8s_deployment_rollout恢复Deployment的升级过程 / Resume deployment rollout| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 (使用空字符串表示默认集群)/ The cluster runs the deployment |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
run_command_in_k8s_pod在Pod内执行命令,需指定容器名称 (类似命令: kubectl exec -n <namespace> <pod-name> -c <container-name> -- <command> [args...]) / Execute command in pod with container name| Parameter | Type | Description |
|---|---|---|
| args | array | 命令参数列表 / Command arguments |
| cluster | string | 集群名称 (使用空字符串表示默认集群)/ Cluster name |
| command * | string | 要执行的命令 / Command to execute |
| container | string | 容器名称(必填) / Container name (required) |
| name * | string | Pod名称 / Pod name |
| namespace * | string | 命名空间 / Namespace |
scale_k8s_deployment通过集群、命名空间、名称 扩缩容Deployment,设置副本数。对应kubectl命令: kubectl scale deployment/<name> --replicas=<number> -n <namespace> / Scale deployment by cluster, namespace, name and replicas. Equivalent kubectl command: kubectl scale deployment/<name> --replicas=<number> -n <namespace>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 (使用空字符串表示默认集群)/ The cluster runs the deployment |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
| replicas | number | 目标副本数 / Target number of replicas |
set_default_k8s_ingressclass设置IngressClass为默认 / Set IngressClass as default (kubectl annotate ingressclass <name> ingressclass.kubernetes.io/is-default-class=true)| Parameter | Type | Description |
|---|---|---|
| cluster | string | IngressClass所在的集群 (使用空字符串表示默认集群)/ The cluster of the IngressClass |
| name | string | IngressClass的名称 / The name of the IngressClass |
set_k8s_default_storageclass设置StorageClass为默认 ,等同于执行kubectl annotate storageclass <name> storageclass.kubernetes.io/is-default-class=true / Set StorageClass as default| Parameter | Type | Description |
|---|---|---|
| cluster | string | StorageClass所在的集群 (使用空字符串表示默认集群)/ The cluster of the StorageClass |
| name | string | StorageClass的名称 / The name of the StorageClass |
stop_k8s_deployment停止Deployment。(将副本数设置为0并记录原始副本数到注解中,恢复是可使用restore_deployment方法)。对应kubectl命令: kubectl scale deployment/<name> --replicas=0 -n <namespace> / Stop deployment by setting replicas to 0 and save original replicas to annotation. Equivalent kubectl command: kubectl scale deployment/<name> --replicas=0 -n <namespace>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 (使用空字符串表示默认集群)/ The cluster runs the deployment |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
taint_k8s_node为节点添加污点,等同于kubectl taint nodes <node> <key>=<value>:<effect> / Add taint to node, equivalent to kubectl taint nodes <node> <key>=<value>:<effect>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 节点所在的集群 (使用空字符串表示默认集群)/ The cluster of the node |
| name * | string | 节点名称 / The name of the node |
| taint | string | 污点表达式,格式为key=value:effect / Taint expression in format key=value:effect |
uncordon_k8s_node设置节点为可调度状态,等同于kubectl uncordon <node> / Mark node as schedulable, equivalent to kubectl uncordon <node>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 节点所在的集群 (使用空字符串表示默认集群)/ The cluster of the node |
| name * | string | 节点名称 / The name of the node |
undo_k8s_deployment_rollout回滚Deployment到指定版本,如果不指定版本则回滚到上一个版本 / Rollback deployment to specific revision, or previous revision if not specified| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 (使用空字符串表示默认集群)/ The cluster runs the deployment |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
| revision | number | 回滚到的版本号,可选 / Target revision number, optional |
unregister_k8s_cluster注销Kubernetes集群 / Unregister a Kubernetes cluster| Parameter | Type | Description |
|---|---|---|
| cluster_id | string | 要注销的集群标识符 / Cluster identifier to unregister |
untaint_k8s_node为节点移除污点,等同于kubectl taint nodes <node> <key>=<value>:<effect>- / Remove taint from node, equivalent to kubectl taint nodes <node> <key>=<value>:<effect>-| Parameter | Type | Description |
|---|---|---|
| cluster | string | 节点所在的集群 (使用空字符串表示默认集群)/ The cluster of the node |
| name * | string | 节点名称 / The name of the node |
| taint | string | 污点表达式,格式为key=value:effect / Taint expression in format key=value:effect |
update_k8s_deployment_image_tag更新Deployment中容器的镜像Tag。对应kubectl命令: kubectl set image deployment/<name> <container>=<image>:<tag> -n <namespace> / Update container image tag in deployment. Equivalent kubectl command: kubectl set image deployment/<name> <container>=<image>:<tag> -n <namespace>| Parameter | Type | Description |
|---|---|---|
| cluster | string | 运行Deployment的集群 (使用空字符串表示默认集群)/ The cluster runs the deployment |
| container | string | 容器名称 / Container name |
| name | string | Deployment的名称 / The name of the deployment |
| namespace | string | Deployment所在的命名空间 / The namespace of the deployment |
| tag | string | 新的镜像Tag / New image tag |
upload_file_to_k8s_pod上传文件到Pod容器内 (类似命令: kubectl cp <local-file> <namespace>/<pod-name>:<container-path>) / Upload file to pod container| Parameter | Type | Description |
|---|---|---|
| cluster | string | 集群名称 (使用空字符串表示默认集群)/ Cluster name |
| container | string | 容器名称(必填) / Container name (required) |
| content | string | 文件内容 / File content |
| file_path | string | 目标文件路径 / Target file path |
| name | string | Pod名称 / Pod name |
| namespace | string | 命名空间 / Namespace |
Security checks
Static checks derived from the repository 10 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 3.3K words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by go.sum.
- ✓No dynamic code executionScanned 142 source files and found no eval, dynamic Function or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdio and HTTP with SSEmcp/server.go:70, mcp/server.go:75
- Starts other programs
- 2 callskom/aws/exec.go:50, kom/aws/generator.go:149
- Outbound network calls
- 1 callcallbacks/port_forward.go:52
- Writes or deletes files
- 1 callkom/aws/generator.go:46
- Lockfile
- go.sum
Pattern matches on the source text of 142 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 3.3K words, fetched a month ago. The original in the repository is authoritative.
Read full README