kubesphere-openkruise
它能做什么
这个技能帮助 AI 智能体使用 OpenKruise,这是一款面向 KubeSphere 的高级工作负载管理扩展。适合希望更安全地进行滚动更新,或为大量 Pod 添加 Sidecar 容器的运维人员。
适用场景
- ✓当你想在 KubeSphere 中安装或升级 OpenKruise 扩展时。
- ✓当你需要通过 SidecarSet 为大量 Pod 添加 Sidecar 时。
- ✓当你想为无状态工作负载进行原地更新或批量发布时。
技能链接
https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-openkruise/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我设置一个 SidecarSet,为所有带有 app 标签的 Pod 添加我们的日志 Sidecar,并检查发布情况。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查扩展及其 Pod,然后为你编写 SidecarSet 或 CloneSet 清单。如果出现问题,它可以检查发布情况以及 Webhook 或 CRD 的状态。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Skill: kubesphere-openkruise
KubeSphere OpenKruise Management
Use this skill for the full OpenKruise lifecycle in KubeSphere:
- Install or upgrade the OpenKruise extension through
InstallPlan - Query extension status, CRDs, Pods, and logs
- Generate
SidecarSetmanifests for sidecar injection and rolling updates - Generate
CloneSetmanifests for advanced stateless workloads, in-place updates, and batch rollout - Uninstall the OpenKruise extension
- Troubleshoot failed Pods, missing CRDs, and webhook problems
Out of scope by default:
- Advanced OpenKruise CRDs not requested by the user, such as
BroadcastJob,NodeImage,UnitedDeployment, orAdvancedPodAutoscaler - Deep chart-value design without cluster evidence
If the user explicitly asks for those CRDs, acknowledge that they are OpenKruise capabilities but treat them as a follow-up task instead of assuming they belong in the default workflow.
Response Rules
- Prefer executable output:
InstallPlanYAML,SidecarSetYAML,CloneSetYAML,kubectlcommands, or a short ordered procedure. - Verify the extension name and exact version before generating a final
InstallPlan. - Default the extension name to
openkruiseonly if the user context or cluster output does not expose a different resource name. - In this KubeSphere environment, the observed mapping is:
- KubeSphere extension version
1.0.3 - OpenKruise runtime version
1.4.0
- KubeSphere extension version
- Distinguish two version concepts before generating
InstallPlan:- KubeSphere extension version: used by
spec.extension.version - OpenKruise runtime version: the controller or component version seen in Pods or docs
- KubeSphere extension version: used by
- For this environment, if the user asks to install the current OpenKruise plugin and does not provide another extension version, prefer
spec.extension.version: 1.0.3. - If the user only provides the OpenKruise runtime version, first ask them to confirm the matching KubeSphere extension version.
- Never invent a version. If the version is missing, first show how to list versions and ask the user to confirm one.
InstallPlan.metadata.nameMUST equalInstallPlan.spec.extension.name.InstallPlanis cluster-scoped in KubeSphere. Do not add a namespace tokubectl get|describe|delete installplan.- Use
upgradeStrategy: Manualunless the user explicitly asks for something else. - Omit optional fields instead of guessing values.
- Before generating
SidecarSetorCloneSet, prefer checking the installed API versions:
kubectl api-resources --api-group apps.kruise.io
- If the cluster version is unknown and the user only wants an example, prefer:
SidecarSet:apps.kruise.io/v1alpha1CloneSet:apps.kruise.io/v1alpha1
- For uninstall requests, warn that deleting CRDs or CR instances can remove application configuration. Do not suggest deleting CRDs unless the user explicitly asks for full cleanup.
Version Mapping Discovery
Treat the 1.0.3 -> 1.4.0 mapping as environment evidence, not a universal rule. When the user asks for precision, prove it first:
# Discover KubeSphere extension version
kubectl get extensionversions.kubesphere.io -l kubesphere.io/extension-ref=openkruise
kubectl get extensionversion openkruise-1.0.3 -o yaml
# Discover deployed runtime image or controller version
kubectl get pods -n kruise-system -o wide
kubectl get deploy -n kruise-system kruise-manager -o jsonpath='{.spec.template.spec.containers[*].image}'
kubectl describe pod -n kruise-system <kruise-manager-pod>
If these commands disagree with the assumed mapping, prefer cluster output over the baked-in default.
Discovery Commands
This section provides two approaches for querying OpenKruise status:
- KubeSphere API (curl) - for extension management and multi-cluster queries
- kubectl - for direct Kubernetes resource operations
Option 1: Using KubeSphere API (curl)
Use curl with environment variables for querying KubeSphere extension status and multi-cluster resources.
Environment Variables:
export KS_HOST="http://<kubesphere-host>" # KubeSphere console URL (required)
export KS_USERNAME="admin" # Username (default: admin)
export KS_PASSWORD="<password>" # Password (required)
Helper Functions (add to ~/.bashrc or use directly):
# Get OAuth token
ks_token() {
curl -s -X POST "$KS_HOST/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant
常见问题
它涵盖哪些工作负载类型?
涵盖用于注入 Sidecar 的 SidecarSet,以及用于高级无状态工作负载的 CloneSet。
智能体会猜测 Chart 的值吗?
没有集群证据时不会。它会把高级 Chart 设计视为单独的任务。
它能移除 OpenKruise 吗?
可以。该技能涵盖卸载该扩展。
详情
作者的原始描述
KubeSphere OpenKruise management Skill. Use when user asks to install or enable OpenKruise, check OpenKruise status, view kruise pods/logs/CRDs, create or update SidecarSet, manage sidecar injection, create or update CloneSet, perform in-place update or batch rollout, uninstall or remove OpenKruise, or troubleshoot Kruise Pod, CRD, and webhook issues in KubeSphere.
repo: kubesphere/kubesphere
热度
- GitHub 星标
- 17k
- 排名
- #10779
- 许可证
- —
- 更新时间
- 2026/7/14
评论
- …
同一仓库的更多技能
frontend-forge-fe-operations
17k帮你的智能体在 KubeSphere 中管理 FrontendExtension 资源,包括构建、发布和调试。
frontend-forge-fi-operations
17k帮你的智能体在 KubeSphere 中创建、更新、启用、禁用和检查 FrontendIntegration 资源及 frontend-forge 扩展。
frontend-integration-yaml
17k帮你的智能体为一个菜单及其一个或多个页面,创建可直接提交的 FrontendIntegration YAML。
kubeeye
17k帮你的智能体安装 KubeEye,设置集群巡检规则和计划,并阅读巡检报告。