kubesphere-gateway
它能做什么
这个技能帮助 AI 智能体在 KubeSphere 中安装、检查和排查入口网关。适合使用基于 ingress-nginx 的网关,将外部流量路由到服务的运维人员。
适用场景
- ✓当你想在 KubeSphere 中安装或卸载网关扩展时。
- ✓当网关卡在 Creating 或 Faulted 等状态,并且你需要找出原因时。
- ✓当通过 Helm 安装网关失败,或其 Pod 状态异常时。
技能链接
https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-gateway/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们的项目网关卡在 Creating 状态。请帮我查明原因,并告诉我下一步该怎么做。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会读取网关对象及其状态和条件。然后它会检查 Helm 发布版本以及网关背后的 Pod,并提出修复建议。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
KubeSphere Gateway
Overview
Provides external access management (ingress) for KubeSphere using ingress-nginx. Supports three-tier gateway management:
| Tier | Scope | Name Pattern | Namespace | Label |
|---|---|---|---|
| Cluster | Entire cluster | kubesphere-router-cluster | kubesphere-controls-system | kubesphere.io/gateway-type=cluster |
| Workspace | Single workspace | kubesphere-router-workspace-{workspace} | kubesphere-controls-system | kubesphere.io/gateway-type=workspace |
| Project | Single project/namespace | kubesphere-router-{namespace} | kubesphere-controls-system | kubesphere.io/gateway-type=project |
Each gateway is a standalone Helm release of ingress-nginx. The gateway-controller-manager manages the lifecycle (install/upgrade/uninstall) via Helm.
Core CRDs
Gateway(gateway.kubesphere.io/v2alpha2) — represents a single ingress-nginx deployment. Key fields:spec.appVersion— the Helm chart version (e.g.kubesphere-nginx-ingress-<version>)spec.values— Helm values for ingress-nginx (controller config, service type, resources, etc.)status.state—Creating,Updating,Running,Faulted,Stoppedstatus.conditions[].type=GatewayReady— True when fully operationalstatus.loadBalancer— LB ingress IPs/hostnamesstatus.service— Service type, ports, external IPs
UpgradePlan(gateway.kubesphere.io/v2alpha2) — batch gateway upgrade job. Key fields:spec.gatewayReferences— list of{name, namespace}to upgradespec.targetAppVersion— target versionstatus.state—Pending,Running,Succeeded,Failed
Monitoring Integration
Gateway exposes NGINX metrics (requests, 4xx/5xx, latency P50/P90/P99) via Prometheus. Requires the whizard-monitoring extension (optional dependency).
Before You Start
Check if Gateway extension is already installed:
kubectl get installplans.kubesphere.io gateway --ignore-not-found
If found, upgrading is supported — just select a newer version in Step 1.
Installation
Step 1: Detect and Select Version
ALL_VERSIONS=$(kubectl get extensionversions.kubesphere.io \
-l kubesphere.io/extension-ref=gateway \
-o jsonpath='{range .items[*]}{.spec.version}{"\n"}{end}' | sort -V)
LATEST_STABLE=$(echo "$ALL_VERSIONS" | grep -v -E 'alpha|beta|rc' | tail -1)
if [ -z "$LATEST_STABLE" ]; then
LATEST_STABLE=$(echo "$ALL_VERSIONS" | tail -1)
fi
echo "Available versions:"
echo "$ALL_VERSIONS"
echo ""
echo "Latest stable: $LATEST_STABLE"
This sets ALL_VERSIONS and LATEST_STABLE. Use SELECTED_VERSION for the version chosen.
Use the question tool:
$LATEST_STABLE (Recommended)— accept the auto-detected version- (custom) — type a specific version; validate it against the printed list
Step 2: Detect and Select Clusters
CLUSTER_DATA=$(kubectl get clusters.cluster.kubesphere.io \
-o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.conditions[?(@.type=="Ready")].status}{"\n"}{end}')
READY_CLUSTERS=$(echo "$CLUSTER_DATA" | awk -F'\t' '$2 == "True" {print $1}')
CLUSTER_COUNT=$(echo "$READY_CLUSTERS" | wc -l)
HOST_CLUSTER=$(kubectl get clusters.cluster.kubesphere.io \
-l 'cluster-role.kubesphere.io/host' \
-o jsonpath='{.items[0].metadata.name}' || echo "")
echo "Ready clusters:"
echo "$READY_CLUSTERS"
echo ""
echo "Cluster count: $CLUSTER_COUNT"
echo "Host cluster: $HOST_CLUSTER"
This sets READY_CLUSTERS, CLUSTER_COUNT, HOST_CLUSTER.
- 1 cluster → skip selection, auto-use it. Set
TARGET_CLUSTERS="$HOST_CLUSTER" - Multiple clusters → use
questionwithmultiple: true:- All clusters →
TARGET_CLUSTERS="$READY_CLUSTERS" - Host cluster only →
TARGET_CLUSTERS="$HOST_CLUSTER" - (custom) — validate each name against
$READY_CLUSTERS
- All clusters →
Step 3: Generate and Apply InstallPlan
./scripts/generate-installplan.sh "$SELECTED_VERSION" "$TARGET_CLUSTERS"
This generates the YAML to /tmp/gateway-installplan.yaml, runs --dry-run=server, then prints the apply command.
For configurable extension values (ingress-nginx default settings, image registry, upgrade tool config, etc.), see references/extension-values.md.
Apply it:
kubectl apply -f /tmp/gateway-installplan.yaml
Tell the user "Installing". Then ask if they want to check status. If yes:
./scripts/check-s
常见问题
存在哪些网关层级?
集群、工作区和项目。每个层级都作为独立的 ingress-nginx 发布版本运行。
智能体会读取哪个对象?
它会读取网关对象,包括其状态、条件和负载均衡器详情。
这与 Gateway API 技能相同吗?
不同。本技能使用基于 ingress-nginx 的网关,另一个技能使用 Gateway API。
详情
作者的原始描述
KubeSphere Gateway extension management Skill (ingress-nginx based, uses Kubernetes Ingress API + Gateway CRD gateway.kubesphere.io/v2alpha2). For the newer Kubernetes Gateway API (Traefik + GatewayProxy CRD), see the kubesphere-gateway-api skill instead. Covers installation, uninstallation, status checks, gateway status inspection, and troubleshooting (gateway stuck states, Helm failures, pod issues).
repo: kubesphere/kubesphere
热度
- GitHub 星标
- 17k
- 排名
- #10776
- 许可证
- —
- 更新时间
- 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,设置集群巡检规则和计划,并阅读巡检报告。