k8s

GitHub

通过执行kubectl命令管理Kubernetes资产,支持自动使用存储的kubeconfig、默认上下文及SSH跳板机配置。

internal/ai/skills/k8s/SKILL.md opskat/opskat

触发场景

查询集群状态或资源信息 查看Pod日志或描述 在Kubernetes环境中执行运维操作

安装

npx skills add opskat/opskat --skill k8s -g -y
更多选项

非标准路径

npx skills add https://github.com/opskat/opskat/tree/main/internal/ai/skills/k8s -g -y

不安装直接使用

npx skills use opskat/opskat@k8s

指定 Agent (Claude Code)

npx skills add opskat/opskat --skill k8s -a claude-code -g -y

安装 repo 全部 skill

npx skills add opskat/opskat --all -g -y

预览 repo 内 skill

npx skills add opskat/opskat --list

SKILL.md

Frontmatter
{
    "name": "k8s",
    "description": "Run kubectl commands against a Kubernetes asset via exec. Covers command syntax and the stored kubeconfig \/ jump-host behavior."
}

Kubernetes assets

Command syntax

Pass the kubectl command as command, with or without the leading kubectl:

  • get pods -A
  • describe pod api-0 -n prod
  • logs deploy/api --tail 100
  • kubectl get nodes -o wide

Notes

  • The asset's stored kubeconfig is used automatically. Do not pass --kubeconfig.
  • The asset's default context and namespace are applied when the command does not specify them.
  • If the asset has an SSH jump host configured, kubectl runs on that host; otherwise it runs locally.
  • The scope parameter is not used by Kubernetes assets.

Asset config (for put_asset)

field type required notes
kubeconfig string yes Write-only. Full YAML encrypted directly in the asset config; it does not create a managed credential
namespace string no Default namespace; must not contain whitespace or start with -
context string no Kubeconfig context to use; same character restrictions as namespace
ssh_asset_id number no SSH asset to tunnel through; 0 detaches
password string no Reserved compatibility key; any non-empty value is rejected as inapplicable
credential_id number no Reserved compatibility key; any non-zero value is rejected as inapplicable

Never echo kubeconfig. It remains direct encrypted asset material. K8s accepts no credential fields.

版本历史

  • b159e91 当前 2026-08-19 20:20

    更新资产配置说明,明确 kubeconfig 为只写且直接加密存储;新增 password 和 credential_id 兼容字段说明(拒绝使用)。

  • aeb4bc3 2026-07-24 16:28

同 Skill 集合

internal/ai/skills/database/SKILL.md
internal/ai/skills/etcd/SKILL.md
internal/ai/skills/kafka/SKILL.md
internal/ai/skills/local/SKILL.md
internal/ai/skills/mongodb/SKILL.md
internal/ai/skills/oss/SKILL.md
internal/ai/skills/rdp/SKILL.md
internal/ai/skills/redis/SKILL.md
internal/ai/skills/serial/SKILL.md
internal/ai/skills/ssh/SKILL.md
internal/ai/skills/vnc/SKILL.md
plugin/opsctl/skills/opsctl/SKILL.md

元信息

文件数
0
版本
d919872
Hash
565b9696
收录时间
2026-07-24 16:28

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-28 04:23
浙ICP备14020137号-1 $访客地图$