Kubesphere kubesphere-extension-management
KubeSphere extension management Skill. Use when user requests to install, configure, upgrade, uninstall extensions, or query extension info/troubleshoot issues. Includes extension discovery, dependency management, install configuration, version management.
git clone https://github.com/kubesphere/kubesphere
T=$(mktemp -d) && git clone --depth=1 https://github.com/kubesphere/kubesphere "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/kubesphere-extension-management" ~/.claude/skills/kubesphere-kubesphere-kubesphere-extension-management && rm -rf "$T"
skills/kubesphere-extension-management/SKILL.mdKubeSphere Extension Management
Architecture
┌──────────────────────┐ ┌─────────────────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐ │ Extension Museum │ │ Extension │ │ InstallPlan │ │ Deployed Extension │ │ (Local Chart Repo) │───────▶│ - description │───────▶│ - extension │───────▶│ │ │ │ (sync) │ - status │ │ - config │ │ Namespace: <target> │ └──────────────────────┘ │ ExtensionVersion │ │ - clusterScheduling │ │ └── Pods, Services │ │ - version │ └──────────────────────┘ └──────────────────────┘ │ - chartURL │ │ (reconcile) │ - externalDependencies │ | │ - installationMode │ | └─────────────────────────────┘ ▼ ┌──────────────────────┐ │ Job │ │ helm-upgrade-<name> │ │ - helm install/ │ │ upgrade/uninstall │ └──────────┬───────────┘ │ ▼ ┌──────────────────────┐ │ Pod │ │ (Helm execution) │ └──────────────────────┘
Core Concepts
Extension
Metadata and status for available/installed extensions.
| Field | Description | Example |
|---|---|---|
| Extension name | |
| Available versions | |
| Current state | // |
| Enabled status | / |
| Installed version | |
ExtensionVersion
Version-specific details: Helm chart location, dependencies, requirements.
| Field | Description | Example |
|---|---|---|
| Version resource name | |
| Version number | |
| Helm chart URL | |
| Target namespace | |
| Install mode | / |
| Required KS version | |
| Required extensions | |
InstallPlan
Trigger for install/upgrade/uninstall. Creates Helm Job to deploy components.
Spec:
| Field | Type | Required | Description |
|---|---|---|---|
| string | ✅ | Must match |
| string | ✅ | Extension name |
| string | ✅ | Exact version to install |
| bool | ✅ | Enable extension |
| string | ✅ | Use for production |
| string | ❌ | Custom YAML config |
| object | ❌ | Multi-cluster config (Multicluster mode only) |
Status:
| Field | Description |
|---|---|
| /// |
| Helm upgrade Job name |
| Target namespace |
| Status conditions with messages |
⚠️ CRITICAL:
=metadata.namespec.extension.name- Use EXACT version from user request
- Set
andenabled: trueupgradeStrategy: Manual
Step-by-Step Workflow
1. List and Inspect Extensions
# List all extensions kubectl get extensions # List by category for c in $(kubectl get categories.kubesphere.io -o jsonpath='{.items[*].metadata.name}'); do exts=$(kubectl get extensions.kubesphere.io -l kubesphere.io/category="$c" -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}') [ -n "$exts" ] && echo -e "$c:\n$exts" done # List extension available versions kubectl get extensionversions.kubesphere.io -l kubesphere.io/extension-ref=<extension-name> # View extension details kubectl describe extension <extension-name> kubectl describe extensionversion.kubesphere.io <extension-name>-<version>
2. Install Extension
⚠️ CRITICAL:
- InstallPlan
MUST matchmetadata.namespec.extension.name - Use EXACT version from user request (not
orrecommendedVersion
)latest
2.1 Verify Version Exists
# Verify the extension and version exist before creating InstallPlan kubectl get extension <extension-name> kubectl get extensionversion <extension-name>-<version> # Get version details (check installationMode, namespace, dependencies, etc.) kubectl describe extension <extension-name> kubectl describe extensionversion <extension-name>-<version>
2.2 Create InstallPlan
Based on the extension details above:
- config: Omit if user didn't request custom configuration
- clusterScheduling: Only include if
, specify clusters ininstallationMode=Multiclusterplacement.clusters
apiVersion: kubesphere.io/v1alpha1 kind: InstallPlan metadata: name: <extension-name> spec: # clusterScheduling: # Only for Multicluster extensions. # placement: # clusters: # - <cluster-name> # overrides: # host: |- # # Extension agent configuration: custom settings for the extension agent in the current cluster, with higher priority than the global extension configuration. # # custom: # key: override-value # config: | ## Omit if user didn't request custom config # # Custom configuration for the extension, serving as a global extension configuration that can override default settings. # # custom: # key: override-value enabled: true extension: name: <extension-name> # CRITICAL: MUST match metadata.name version: <version> # CRITICAL: Use EXACT version requested upgradeStrategy: Manual
kubectl apply -f installplan-<extension-name>.yaml
3. Track & Verify Installation
# Watch status kubectl get installplan <extension-name> -w # Get details kubectl describe installplan <extension-name> # Verify extension status kubectl describe extension <extension-name> # Check deployed resources NAMESPACE=$(kubectl get installplan <extension-name> -o jsonpath='{.status.targetNamespace}') kubectl get pods,svc -n $NAMESPACE
4. Update & Upgrade Extension
⚠️ CRITICAL: InstallPlan
MUST match metadata.namespec.extension.name
- Update: Modify
orspec.config
(version unchanged)spec.clusterScheduling - Upgrade: Modify
to new versionspec.extension.version
# Get current InstallPlan as template kubectl get installplan <extension-name> -o yaml > installplan-<extension-name>.yaml # Edit and apply: # - For Update: modify spec.config or spec.clusterScheduling # - For Upgrade: change spec.extension.version to target version kubectl apply -f installplan-<extension-name>.yaml kubectl get installplan <extension-name> -w
5. Uninstall Extension
kubectl delete installplan <extension-name>
Best Practices
- Use default config (omit
) unless custom values are neededspec.config - Always use
for productionupgradeStrategy: Manual - Use exact version (not
orrecommendedVersion
)latest - Test in staging before production
- Review changelogs before upgrades
- Document custom configurations
Troubleshooting
Issue 1: InstallPlan Failed (Job Execution Failed)
Symptoms: InstallPlan stuck in "Installing"/"Upgrading", Job pod shows Error/Failed
Diagnosis:
# Step 1: Check InstallPlan status kubectl describe installplan <extension-name> # Check status.state and status.conditions # Step 2: Check Job pod logs NAMESPACE=$(kubectl get installplan <extension-name> -o jsonpath='{.status.targetNamespace}') JOB_NAME=$(kubectl get installplan <extension-name> -o jsonpath='{.status.jobName}') kubectl logs -n $NAMESPACE -l job-name=$JOB_NAME --tail=100 # Step 3: For Multicluster - check cluster scheduling status kubectl get installplan <extension-name> -o jsonpath='{.status.clusterSchedulingStatuses}' | jq . # Check each cluster's state and conditions, then get job name and logs
Solutions:
- Verify extension version exists
- Check dependencies are installed
- Check config syntax
Issue 2: InstallPlan Status Not Updated (Job Completed)
Symptoms: Job pod completed successfully, but InstallPlan stays in "Installing"/"Upgrading"
Diagnosis:
# Check if job completed NAMESPACE=$(kubectl get installplan <extension-name> -o jsonpath='{.status.targetNamespace}') JOB_NAME=$(kubectl get installplan <extension-name> -o jsonpath='{.status.jobName}') kubectl get pods -n $NAMESPACE -l job-name=$JOB_NAME # Check job completion time vs current time kubectl get job $JOB_NAME -n $NAMESPACE -o jsonpath='{.status.completionTime}'
Cause: Clock skew between nodes (NTP not synchronized)
Solution: Check and synchronize NTP across all cluster nodes
Quick Reference
| Action | Command |
|---|---|
| List all extensions | |
| List extension versions | |
| View extension details | |
| View version details | |
| Install extension | |
| Track installation | |
| Upgrade extension | Modify version in InstallPlan, then |
| Uninstall extension | |
References
Related Skills
- Core platform architecturekubesphere-core
- Cluster operationskubesphere-cluster-management