⚠️ Execution Method (Must Read): This skill executes queries via the local Python dispatcher script. Using hcloud, openstack, or other CLI tools or direct API calls is prohibited.
- The dispatcher script is located at
scripts/huawei-cloud.pywithin the skill directory- All scripts and environment check scripts are inside the skill package. You must use
skill action=execto execute them. Do not run them directly in a shell.- Do not attempt hcloud, openstack, curl IAM, or any other CLI/API methods. This skill does not depend on those tools.
- All paths are relative to the skill directory, which is the directory where this SKILL.md is located.
This skill scans Huawei Cloud CCE clusters for availability risks. It performs read-only checks, produces risk-rated reports, and generates remediation plans with YAML suggestions. It does NOT directly modify workloads, PDBs, affinity rules, probes, node pools, or cluster configuration.
Architecture: Python dispatcher ( scripts/huawei-cloud.py) → Huawei Cloud Python SDK + Kubernetes client → Nodes, Pods, Deployments, StatefulSets, DaemonSets, PDBs, Services, Ingresses, Events, Metrics → Risk classification → Remediation plan → Reports
Related Skills:
SkillPurposehuawei-cloud-cce-pod-failure-diagnoserPod-level failure diagnosis (CrashLoopBackOff, OOMKilled, Pending)huawei-cloud-cce-node-failure-diagnoserNode-level failure diagnosis (NotReady, pressure)huawei-cloud-cce-network-failure-diagnoserNetwork failure diagnosis (Service, DNS, Ingress, ELB)huawei-cloud-cce-root-cause-analyzerCross-resource root cause correlationhuawei-cloud-cce-auto-remediation-runnerExecute remediation actions (scale, PDB, affinity, probes)huawei-cloud-cce-cce-workload-managerWorkload lifecycle management (Deployment/StatefulSet operations)
Capabilities:
huawei_scan_cce_availability_risk)Typical Use Cases:
huaweicloudsdkcore, huaweicloudsdkcce, huaweicloudsdkaom, huaweicloudsdkhss, huaweicloudsdkvpc, huaweicloudsdkecs, huaweicloudsdkces, huaweicloudsdkevs, huaweicloudsdkeip, huaweicloudsdkelb, huaweicloudsdkiam, kubernetespython3 --versionpip3 install huaweicloudsdkcore huaweicloudsdkcce huaweicloudsdkaom huaweicloudsdkhss huaweicloudsdkvpc huaweicloudsdkecs huaweicloudsdkces huaweicloudsdkevs huaweicloudsdkeip huaweicloudsdkelb huaweicloudsdkiam kubernetesValid Huawei Cloud credentials (AK/SK mode)
Security Rules:
echo $HUAWEI_AK or echo $HUAWEI_SK to check credentialsHUAWEI_AK, HUAWEI_SK, HUAWEI_REGIONConfiguration Method (Environment Variables Only):
bash
export HUAWEI_AK=<your-ak>
export HUAWEI_SK=<your-sk>
export HUAWEI_REGION=cn-north-4
Additional Variables:
VariableRequiredDescriptionHUAWEI_AKYesHuawei Cloud Access KeyHUAWEI_SKYesHuawei Cloud Secret KeyHUAWEI_REGIONNoDefault region (overrides region param if set)HUAWEI_PROJECT_IDNoProject ID (auto-obtained via IAM API when not set)HUAWEI_SECURITY_TOKENNoRequired when using temporary AK/SK
API ActionServicePurposeCCE cluster readCCEhuawei_list_cce_clustersCCE node readCCEhuawei_get_kubernetes_nodes, huawei_get_cce_nodesCCE workload readCCEhuawei_get_cce_pods, huawei_get_cce_deploymentsCCE nodepool readCCEhuawei_list_cce_nodepoolsCCE addon readCCEhuawei_list_cce_addonsAOM metrics readAOMhuawei_get_cce_node_metrics, huawei_get_cce_node_metrics_topN, huawei_get_aom_metricsKubernetes API readCCE (kubeconfig)huawei_get_cce_pods, huawei_get_cce_deployments, huawei_list_cce_statefulsets, huawei_list_cce_daemonsets
Permission Failure Handling:
All actions are invoked via the dispatcher script:
bash
python3 scripts/huawei-cloud.py <action> region=<region> cluster_id=<cluster_id> [key=value ...]
The primary scan command that collects all availability risk data in a single call and outputs a risk-rated report.
bash
python3 scripts/huawei-cloud.py huawei_scan_cce_availability_risk \
region=cn-north-4 cluster_id=<cluster_id> \
exclude_namespaces=kube-system \
gateway_keywords=nginx,gateway,ingress,proxy,kong,apisix,traefik \
metrics_hours=24 \
output_dir=./output
Returns: risk-rated issues, severity classification, inventory summary, data gaps, remediation suggestions, and optionally availability-risk-summary.json and availability-risk-report.md files.
ActionRequired ParamsDescriptionhuawei_get_kubernetes_nodes``region, cluster_idQuery v1.Node Ready/conditions/AZ distributionhuawei_get_cce_pods``region, cluster_idList Pod phase/reason/state/node/AZhuawei_get_cce_deployments``region, cluster_idList Deployments with replicas/PDB/affinityhuawei_get_cce_services``region, cluster_idList Services for workload correlationhuawei_get_cce_ingresses``region, cluster_idList Ingresses for gateway identificationhuawei_list_cce_nodepools``region, cluster_idList node pools with AZ distributionhuawei_list_cce_daemonsets``region, cluster_idList DaemonSets for probe/affinity checkhuawei_list_cce_statefulsets``region, cluster_idList StatefulSets for PDB/single-replica checkhuawei_get_cce_node_metrics_topN``region, cluster_idTop-N node CPU/memory metricshuawei_get_aom_metrics``regionAOM metric data for master/node trendshuawei_list_cce_clusters``regionList CCE clusters (for cluster selection)
For targeted evidence when the user requests specific information:
bash
# Node AZ distribution detail
python3 scripts/huawei-cloud.py huawei_get_kubernetes_nodes \
region=cn-north-4 cluster_id=<cluster_id>
# Pod distribution across AZs
python3 scripts/huawei-cloud.py huawei_get_cce_pods \
region=cn-north-4 cluster_id=<cluster_id> namespace=default
# Deployment detail with PDB and affinity
python3 scripts/huawei-cloud.py huawei_get_cce_deployments \
region=cn-north-4 cluster_id=<cluster_id> namespace=default
# Node pool AZ distribution
python3 scripts/huawei-cloud.py huawei_list_cce_nodepools \
region=cn-north-4 cluster_id=<cluster_id>
# Node metrics trend
python3 scripts/huawei-cloud.py huawei_get_cce_node_metrics_topN \
region=cn-north-4 cluster_id=<cluster_id> top_n=10
huawei_scan_cce_availability_risk (Primary Action)#ParameterRequiredDefaultDescriptionregionYes-Huawei Cloud region (e.g., cn-north-4)cluster_idYes-CCE cluster IDexclude_namespacesNokube-systemNamespaces excluded from business risk scanning; core addons still checkedgateway_keywordsNonginx,gateway,ingress,proxy,kong,apisix,traefikKeywords for identifying gateway-class workloadsmetrics_hoursNo24Lookback window for master/node CPU/memory trend metricsoutput_dirNo-Directory for availability-risk-summary.json and availability-risk-report.md output
ParameterRequiredDescriptionDefaultregionYesHuawei Cloud region-cluster_idYes (most actions)CCE cluster ID-namespaceContext-dependentKubernetes namespace-top_nNoNumber of top results10metrics_hoursNoMetric lookback hours24
Region NameRegion IDNorth China - Beijing 4cn-north-4North China - Beijing 1cn-north-1East China - Shanghai 1cn-east-3East China - Shanghai 2cn-east-2South China - Guangzhoucn-south-1South China - Shenzhencn-south-4Southwest China - Guiyang 1cn-southwest-2Asia Pacific - Bangkokap-southeast-2Asia Pacific - Singaporeap-southeast-1Asia Pacific - Hong Kongap-southeast-3Europe - Pariseu-west-0
The primary action huawei_scan_cce_availability_risk returns structured risk data. See Output Schema for the full JSON response schema.
Key Output Fields:
FieldDescriptionsuccessWhether the scan completed successfullyscopeScan scope (region, cluster_id, excluded namespaces, gateway keywords)inventoryCollected resource counts (nodes, workloads, pods, PDBs, services, ingresses) and AZ distributioncluster.control_planeMaster HA status, visible node count, zone distribution, metricscluster.resourcesCPU/memory request/limit allocatable ratios, missing request containers countissues[]Risk issues with severity, category, resource, message, recommendationsummary.risk_levelOverall risk level: critical, high, medium, lowsummary.issue_countTotal issues with severity breakdownrecommendationsRemediation recommendations listremediation_planAuthorized execution plan itemsdata_gapsData gaps when control-plane or metrics are unavailablefilesOptional output file paths (summary JSON, report Markdown, raw inventory)
Issue Severity Levels:
SeverityCriteriacriticalSingle replica gateway, no master HA, single-AZ concentration of all Ready nodeshighMulti-replica workload missing PDB, Pod concentration on single node/AZ, missing health probesmediumMissing resource requests, memory overcommit ratio > 2x, core addon single replicalowCPU overcommit ratio > 4x (may be intentional burst), minor affinity gaps
Issue Categories:
CategoryDescriptionsingle-replicaWorkload or gateway running with < 2 replicaspdbMulti-replica workload missing PodDisruptionBudgethealth-checkWorkload missing readinessProbe or livenessProbeaffinityHard affinity pinning to single AZ/node/nodepool, missing anti-affinityaz-distributionNodes or Pods concentrated in a single AZgatewayGateway workload risk (concentration, missing PDB, missing probes)resourcesMissing requests, overcommit, or capacity illusion
See Verification Method for step-by-step verification.
huawei_scan_cce_availability_risk first; use manual inventory queries only if the primary scan fails or the user requests specific detailkube-system is in exclude_namespaces, CoreDNS, nginx-ingress, and ingress-nginx are still individually identified and checkedgateway_keywords to identify gateway-class workloads; adjust keywords for custom gateway implementationshuawei-cloud-cce-auto-remediation-runner with proper safeguards and user confirmationDocumentDescriptionWorkflowScan workflow, evidence collection steps, and risk classification rulesRisk RulesSafety constraints, mutation boundaries, and authorization requirementsOutput SchemaComplete JSON response format for scan resultsVerification MethodStep-by-step verification for skill setup and scan executionCommon PitfallsTroubleshooting guides for scan pitfalls
huawei-cloud-cce-auto-remediation-runner with requires_confirmation: truepython3 scripts/huawei-cloud.py <action>; do not use hcloud CLI or direct API callsgateway_keywords parameterkube-system exclusion — business risk scanning excludes kube-system by default, but core addons (CoreDNS, nginx-ingress, ingress-nginx) are still individually checked for anti-affinity and distribution risksSee Common Pitfalls & Solutions for detailed troubleshooting guides.
Quick Reference:
PitfallSymptomQuick FixAssuming master HAReport concludes "master HA OK" with no visible master nodesMark as data gap; recommend CCE console/API verificationSkipping PDB checkMissing PDB for multi-replica gateway not flaggedInclude gateway keywords and check PDB for all multi-replica workloadsIgnoring gateway concentrationAll gateway Pods on one node/AZUse gateway_keywords and check Pod distribution across nodes/AZsTreating CPU overcommit as criticalCPU limit/request ratio > 4x flagged as criticalMark as low risk; confirm whether intentional burst designMissing resource requestsContainers with no CPU/memory requests not flaggedAlways check request/limit presence; mark missing requests as medium riskExcluding core addonskube-system excluded removes CoreDNS from checksCore addons are individually identified regardless of namespace exclusionWrong cluster_idAPI returns 404 or empty resultsVerify cluster ID via huawei_list_cce_clustersCredential permission deniedAPI returns 403Check IAM permissions for CCE node/workload/metrics accessMetrics API unavailableNode/Pod metrics query failsEnsure metrics-server addon is installed in cluster