본문으로 건너뛰기
cccskills
무료GitHub에 공개

kubesphere-servicemesh

Manage the KubeSphere ServiceMesh extension built on Istio, Kiali, and Jaeger. Install or remove it, check deployment status, and investigate problems with staged releases, proxy injection, service topology, traffic metrics, and tracing across application components.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

KubeSphere ServiceMesh extension management Skill (Istio + Kiali + Jaeger). Use this skill for the ServiceMesh extension Configuration (covers installation, uninstallation, status checks), troubleshooting (covers grayscale release, sidecar injection, topology/metrics, and tracing for Composed Apps Aka Custom Applications).

연동 도구Kubernetes
설치 방법 보기

이럴 때 유용합니다

  • Installing, upgrading, or removing ServiceMesh
  • Investigating staged release routing problems
  • Checking missing Istio proxy containers
  • Diagnosing missing topology, metrics, or tracing data

포함된 파일(5)

  • SKILL.md9.5 KB
  • references/extension-values.md678 B
  • scripts/check-status.sh2.3 KB
  • scripts/generate-installplan.sh1.3 KB
  • scripts/verify-uninstall.sh938 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

KubeSphere ServiceMesh

Overview

Integrates Istio, Kiali, and Jaeger to provide traffic governance for microservices. They operate on Composed App (backed by applications.app.k8s.io). A Service is governed when it has the annotation servicemesh.kubesphere.io/enabled: "true" and belongs to a Composed App.

Defines two core CRDs:

  • Strategy — grayscale release task (canary, blue-green, traffic mirroring)
  • ServicePolicy — traffic management (load balancing, connection pools, circuit breaking, etc.) via Istio DestinationRule

Istio handles traffic routing, Kiali provides topology visualization, and Jaeger enables tracing.

Before You Start

Check if ServiceMesh is already installed:

kubectl get installplans.kubesphere.io servicemesh --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=servicemesh \
  -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 question with multiple: true:
    • All clusters → TARGET_CLUSTERS="$READY_CLUSTERS"
    • Host cluster only → TARGET_CLUSTERS="$HOST_CLUSTER"
    • (custom) — validate each name against $READY_CLUSTERS

Step 3: Check gateway-api Compatibility

if kubectl get installplans.kubesphere.io gateway-api --ignore-not-found &>/dev/null; then
  GW_API_EXISTS=true
  echo "gateway-api InstallPlan exists → will set PILOT_ENABLE_GATEWAY_API=false"
else
  GW_API_EXISTS=false
  echo "gateway-api not found → no compatibility config needed"
fi

echo "GW_API_EXISTS=$GW_API_EXISTS"

If GW_API_EXISTS=true, the InstallPlan config will include PILOT_ENABLE_GATEWAY_API: "false" to avoid conflicts.

Step 4: Generate and Apply InstallPlan

./scripts/generate-installplan.sh "$SELECTED_VERSION" "$TARGET_CLUSTERS" "$GW_API_EXISTS"

This generates the YAML to /tmp/servicemesh-installplan.yaml, runs --dry-run=server, then prints the apply command.

For configurable extension values (tracing sampling rate, storage backend, credentials, etc.), see references/extension-values.md.

Apply it:

kubectl apply -f /tmp/servicemesh-installplan.yaml

Tell the user "Installing". Then ask if they want to check status. If yes:

./scripts/check-status.sh poll

Status Checking

PurposeCommand
Single snapshot./scripts/check-status.sh quick
Wait until complete (5min timeout)./scripts/check-status.sh poll

Logic:

  • All Installed → ✓ success
  • Any Failed → ✗ prints full status
  • Timeout (300s) → ⚠ prints current status
  • In progress → prints every 10s

Uninstallation

⚠ Always confirm with the user before proceeding.

Uninstall from all clusters

if ! kubectl get installplans.kubesphere.io servicemesh --ignore-not-found &>/dev/null; then
  echo "ServiceMesh is not installed."
  exit 0
fi

Confirm with the user, then delete:

kubectl delete installplans.kubesphere.io servicemesh --ignore-not-found

Verify cleanup:

./scripts/verify-uninstall.sh

Success criteria:

  1. InstallPlan is deleted
  2. No active ServiceMesh pods remain in extension-servicemesh

Uninstall from specific clusters

WARNING: Do NOT delete the InstallPlan. Only remove target clusters from the placement list.

Confirm which clusters to remove, compute remaining clusters, then patch:

kubectl patch installplans.kubesphere.io servicemesh --type='json' \
  -p='[{"op": "replace", "path": "/spec/clusterScheduling/placement/clusters", "value": ["<REMAINING_CLUSTER_1>", "<REMAINING_CLUSTER_2>"]}]'

Success: patch returns OK + removed clusters no longer in .status.clusterSchedulingStatuses.

Troubleshooting

All scenarios below assume the namespace of the Composed App is known. Set it as NAMESPACE before proceeding.

Prerequisites (common steps for all scenarios)

# 1. Check Composed App status and governance annotation
kubectl -n $NAMESPACE get applications.app.k8s.io -o yaml
#    Key things to verify:
#    - .status: health of composed components
#    - annotation servicemesh.kubesphere.io/enabled=true

# 2. Verify pods with the injection annotation actually have istio-proxy sidecar
kubectl -n $NAMESPACE get pods \
  -l 'app.kubernetes.io/name,app.kubernetes.io/version,app,version' \
  -o custom-columns='NAME:.metadata.name,APPLICATION:.metadata.labels.app\.kubernetes\.io/name,SHOULD_INJECT_ISTIO_PROXY:.metadata.annotations.sidecar\.istio\.io/inject,CONTAINERS:.spec.containers[*].name'

# 3. If sidecar missing, check istiod injection logs
kubectl logs -n extension-servicemesh -l app=istiod --tail=100

After completing the prerequisites, proceed to the specific scenario below.

Grayscale release task (Strategy) not working as expected

When asking the user for <strategy-name>, refer to it as "grayscale release task name", not "strategy name".

Data flow: Strategy → VirtualService → Istio Proxy Sidecar → traffic routing.

After prerequisites:

# 1. Check Strategy reconciliation status and events
kubectl -n $NAMESPACE describe strategies.servicemesh.kubesphere.io <strategy-name>

# 2. Check the VirtualService controlled by this Strategy (linked via label)
kubectl -n $NAMESPACE get virtualservice \
  -l "servicemesh.kubesphere.io/controlled-by-strategy=<strategy-name>" -o yaml

# The controller copies strategy.spec.template.spec to the VirtualService spec,
# injecting only route.destination.host, route.destination.port.number, and match.port.
# Compare key fields to verify sync:
#   spec.template.spec.hosts  ↔ spec.hosts
#   spec.template.spec.http   ↔ spec.http  (port/host injected by controller)
#   spec.template.spec.tcp    ↔ spec.tcp   (port/host injected by controller)
# When spec.governor is set, controller overrides all routes to 100% → governor version.
# If the VirtualService spec does not reflect the template, sync failed.

# 3. Verify actual workloads match the routing rules
# (e.g., if routing to version: v2, check pods with that label exist)
kubectl -n $NAMESPACE get pods -l "app=<app-name>,version=<target-version>"

# 4. Check controller-manager sync logs for errors (last 100 lines)
kubectl logs -n extension-servicemesh -l app=servicemesh-controller-manager \
  --tail=100 | grep -iE "(error|reconcile|strategy|<strategy-name>)"

Traffic Monitoring (Topology and metrics) shows no data

Before running commands, confirm with the user:

  1. Whether there is actual traffic reaching the Composed App
  2. Whether expanding the time range still shows no data

After prerequisites:

# Check servicemesh-apiserver logs for Kiali access errors
kubectl logs -n extension-servicemesh -l app=servicemesh-apiserver --tail=100
# Check Prometheus / whizard-agent-proxy (only one will exist)
kubectl get pods -n kubesphere-monitoring-system -l 'app.kubernetes.io/name in (prometheus, whizard-agent-proxy)'

Tracing shows no data

Before running commands, confirm with the user:

  1. Whether there is actual traffic reaching the Composed App
  2. Whether expanding the time range still shows no data

After prerequisites:

# Check servicemesh-apiserver logs for Jaeger query errors
kubectl logs -n extension-servicemesh -l app=servicemesh-apiserver --tail=100
# Check jaeger-query logs for storage backend connectivity
kubectl logs -n extension-servicemesh -l app.kubernetes.io/component=query --tail=100
# Check jaeger-collector logs for storage backend connectivity
kubectl logs -n extension-servicemesh -l app.kubernetes.io/component=collector --tail=100
# If backend.jaeger.storage.options.es.server-urls is the default, check opensearch
kubectl get pods -n kubesphere-logging-system -l 'app.kubernetes.io/name=opensearch-data'

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Manage FrontendExtension resources in frontend-forge, from creation and package generation to downloading, publishing, and unpublishing. Inspect generated files, Kubernetes jobs, and status information to diagnose packaging or publishing failures.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Create or update a FrontendExtension
  • Rebuild and download an extension package
  • Publish, unpublish, or remove an extension
kubesphere/kubesphere1.7만2026년 7월 15일 업데이트

Operate FrontendIntegration resources from existing YAML definitions using kubectl, the Kubernetes command-line tool. Manage updates and enabled state, inspect build output, troubleshoot failures, and install or manage the frontend-forge extension.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Create a FrontendIntegration from existing YAML
  • Update, enable, or disable a FrontendIntegration
  • Inspect build output and troubleshoot failures
kubesphere/kubesphere1.7만2026년 7월 15일 업데이트

Generate FrontendIntegration YAML for frontend-forge from a simplified configuration containing one menu and one or more pages. Define resource tables or embedded iframe pages, with the bundled generator expanding menu placements into the required YAML structure.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Generating integration YAML for a CRD resource table
  • Defining an embedded iframe page
  • Converting a single-menu configuration into canonical YAML
kubesphere/kubesphere1.7만2026년 7월 15일 업데이트

kubeeye

무료

Set up KubeEye in KubeSphere to inspect Kubernetes clusters. Define checks for configurations, nodes, and services, schedule recurring or one-time inspections, and retrieve findings as HTML or spreadsheet reports.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Install KubeEye for cluster inspections
  • Create checks for node health and configuration
  • Schedule recurring cluster inspections
kubesphere/kubesphere1.7만2026년 7월 15일 업데이트

Inspect KubeSphere clusters with read-only commands. List clusters, view detailed configuration, identify host and member roles, and review connection types, readiness indicators, and KubeSphere and Kubernetes versions without changing cluster resources.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • List clusters registered in KubeSphere
  • Check cluster readiness
  • Review KubeSphere and Kubernetes versions
kubesphere/kubesphere1.7만2026년 7월 15일 업데이트

Understand KubeSphere architecture and call its APIs with a script that handles authentication. This skill also directs cluster, user, workspace, and extension management requests to the relevant specialist skills.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Understand KubeSphere core components
  • Choose API paths for Kubernetes and KubeSphere operations
  • Send API requests to a specific member cluster
kubesphere/kubesphere1.7만2026년 7월 15일 업데이트

kubesphere의 스킬 모두 보기

이 스킬의 문제 신고