⚠️ 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 diagnoses CCE autoscaling link failures across two closed-loop layers: (1) whether HPA increases workload replica count from N to N+1, and (2) whether CCE elastic engine / Cluster Autoscaler increases node count from M to M+1 after resource-insufficient Pending Pods appear. It outputs a complete Markdown diagnosis report with process, evidence, root cause conclusion, confidence, data gaps, and recommendations.
Architecture: Python dispatcher ( scripts/huawei-cloud.py) → Huawei Cloud Python SDK + Kubernetes client → HPA/CA/Addon/NodePool/Pod/Events/Metrics → Gateway intent routing → Path A/B/C diagnosis → Structured evidence + Markdown report
Related Skills:
SkillPurposehuawei-cloud-cce-pod-failure-diagnoserPod runtime failure diagnosis (CrashLoopBackOff, OOMKilled, Pending)huawei-cloud-cce-node-failure-diagnoserNode-level failure diagnosis (NotReady, disk/memory pressure)huawei-cloud-cce-workload-failure-diagnoserWorkload rollout failure diagnosishuawei-cloud-cce-auto-remediation-runnerExecute remediation actions (HPA config, nodepool resize)huawei-cloud-cce-root-cause-analyzerCross-resource root cause correlationhuawei-cloud-cce-alarm-correlation-engineAlarm correlation and diagnosis triggeringhuawei-cloud-cce-capacity-trend-forecasterCapacity trend and HPA coverage analysishuawei-cloud-cce-cost-optimization-advisorResource governance and cost optimization
Capabilities:
huawei_autoscaling_diagnose)huawei_list_cce_hpas)huawei_list_cce_addons, huawei_list_cce_nodepools)huawei_get_cce_pods, huawei_get_cce_events)huawei_get_aom_metrics)Typical Use Cases:
huaweicloudsdkcore, huaweicloudsdkcce, huaweicloudsdkaom, kubernetespython3 --versionpip3 install huaweicloudsdkcore huaweicloudsdkcce huaweicloudsdkaom 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_clusters, huawei_list_cce_nodepoolsCCE addon readCCEhuawei_list_cce_addons, huawei_get_cce_addon_detailCCE HPA readCCE (kubeconfig)huawei_list_cce_hpasCCE workload readCCE (kubeconfig)huawei_get_cce_deployments, huawei_list_cce_statefulsetsCCE Pod readCCE (kubeconfig)huawei_get_cce_podsCCE Pod logsCCE (kubeconfig)huawei_get_pod_logsCCE Events readCCE (kubeconfig)huawei_get_cce_eventsAOM metrics readAOMhuawei_get_aom_metrics, huawei_get_cce_pod_metrics_topN, huawei_get_cce_node_metrics_topN
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 ...]
bash
python3 scripts/huawei-cloud.py huawei_autoscaling_diagnose \
region=cn-north-4 cluster_id=<cluster_id> \
namespace=default workload_name=my-app workload_type=Deployment \
question="Why isn't HPA scaling my workload?"
Returns structured evidence + report_markdown (complete Markdown diagnosis report). When report_markdown is present, use it as the final report body. You may add clarifications the user requests, but do not discard evidence tables.
ActionRequired ParamsDescriptionhuawei_list_cce_hpas``region, cluster_idList HPA specs, current/desired replicas, conditions, metricshuawei_list_cce_addons``region, cluster_idIdentify CCE elastic engine, metrics/AOM/Prometheus addonshuawei_get_cce_addon_detail``region, cluster_id, addon_idGet addon detail (version, status)huawei_list_cce_nodepools``region, cluster_idList nodepools: autoscaling enable, min/max, current node counthuawei_get_cce_pods``region, cluster_idList Pod phase, owner, container state, resources.requests/limits, annotationshuawei_get_cce_deployments``region, cluster_idRead Deployment desired/current/ready replicashuawei_list_cce_statefulsets``region, cluster_idRead StatefulSet desired/current/ready replicashuawei_get_cce_events``region, cluster_idRead HPA, Pod, Scheduler events (FailedScheduling, FailedGetResourceMetric)huawei_get_cce_pod_metrics_topN``region, cluster_idPod resource metric rankinghuawei_get_cce_node_metrics_topN``region, cluster_idNode resource metric rankinghuawei_get_aom_metrics``region, cluster_idAOM/Prometheus custom metric queries
bash
# Step 1: Locate CA component Pods in kube-system
python3 scripts/huawei-cloud.py huawei_get_cce_pods \
region=cn-north-4 cluster_id=<cluster_id> namespace=kube-system
# Step 2: Retrieve CA Pod logs (find pods with names containing autoscaler/cce-elastic/elastic-engine)
python3 scripts/huawei-cloud.py huawei_get_pod_logs \
region=cn-north-4 cluster_id=<cluster_id> namespace=kube-system \
pod_name=cce-cluster-autoscaler-abc123 container=autoscaler tail_lines=200
CA Log Signal Quick Reference:
SignalMeaningSeverityNo expansion optionsNo available expansion options for node pool specs/AZ/subnetcriticalmax node group size reachedNode group reached max_nodes limitcriticalScale-up: final scale-up plan is emptyAll node groups skipped in expansion plancriticalQuota exceeded / quota limitCloud resource (ECS/EVS/EIP) quota insufficientcriticalsubnet ip exhausted / no available ipVPC subnet available IP exhaustedcriticaliam / permission denied / agency / forbiddenIAM agency or permission abnormalitycriticalFailed to refresh / cannot connectCA cannot connect to cloud API or control planehighskipping node groupCA skipped a node group (reason in log)highpod ... is unschedulableCA identified an unschedulable PodinfoScaleDown: no candidatesNo candidate nodes for scale-downinfonode ... is not suitable for removalNode does not meet scale-down conditionshighnot safe to evict / safe-to-evict=falsePDB or annotation protection blocking evictionhigh
huawei_autoscaling_diagnose (Primary Action)#ParameterRequiredDefaultDescriptionregionYes-Huawei Cloud region (e.g., cn-north-4)cluster_idYes-CCE cluster IDnamespaceNo-Target namespace (narrows scope)workload_nameNo-Target workload name (Deployment/StatefulSet)workload_typeNo-Workload type ( Deployment or StatefulSet)questionNo-User's original question (improves intent routing)
ParameterRequiredDescriptionDefaultregionYesHuawei Cloud region-cluster_idYes (most actions)CCE cluster ID-namespaceAction-dependentKubernetes namespace-workload_nameAction-dependentDeployment/StatefulSet name-pod_nameRequired for logsPod name-containerRequired for logsContainer name-tail_linesNoLog tail lines count200top_nNoNumber of top results for metrics10
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_autoscaling_diagnose returns structured evidence and a Markdown report. See Output Schema for the full JSON response schema.
Key output fields:
FieldDescriptionsuccessWhether the diagnosis completed successfullyintent.targetRouting target: WORKLOAD, NODE, or UNKNOWN``intent.scale_directionScale direction: scale_up, scale_down, or unknown``routeDiagnosis path: A, B, C, or BLOCKED``discoveryHas_HPA, Has_CA, metric addon detected, nodepool autoscaling enabledissuesList of diagnosed issues with code, severity, layer, evidence, recommendationevidenceList of evidence items with layer, source, summarydata_gapsData collection failures or unconfirmed itemsconclusionRoot cause conclusion summaryconfidenceConfidence level ( High, Medium, Low)report_markdownComplete Markdown diagnosis report (use as final output)
Required Markdown report sections:
# CCE Autoscaling Automated Diagnosis Report## 1. Diagnosis Overview: region, cluster, intent, scale direction, route, conclusion, confidence## 2. Capability Discovery & Routing: Has_HPA, Has_CA, metric link, routing basis## 3. Investigation Process: Gateway, Path A/B/C actual execution steps## 4. Key Evidence: HPA status, nodepool/addon, Pending Pod, FailedScheduling evidence## 5. Issues & Root Cause Convergence: issues ranked by severity with evidence and recommendations## 6. Next-Step Recommendations: read-only verification and remediation suggestions only## 7. Data Gaps: collection failures and items that could not be confirmedSee Verification Method for step-by-step verification.
huawei_autoscaling_diagnose first; use manual fallback only if the primary action failsresources.requests on Pod containers; missing requests are a common critical root causehuawei-cloud-cce-auto-remediation-runner and require user confirmationDocumentDescriptionWorkflowGateway routing, Path A/B/C diagnosis trees, manual fallback tool sequenceOutput SchemaJSON response schema and required Markdown report sectionsCapability MapReusable tool capabilities, current gaps, and recommended atomic tool additionsRisk RulesAllowed read actions, prohibited write actions, mutation boundary rules
huawei_autoscaling_diagnose is the primary tool; raw queries are for targeted evidence when the user requests specific information or when the primary tool failsPitfallSymptomQuick FixSkipping Gateway routingDiagnosis enters wrong path or misses capabilityAlways run intent + capability discovery before Path A/B/CMissing CPU/Memory requestHPA cannot calculate utilization; FailedGetResourceMetricCheck resources.requests on all target Pod containersIgnoring CA Pod logsCA root cause remains unknownPrioritize CA Pod log retrieval (kube-system autoscaler Pods)Treating tolerance as failureHPA not scaling when metrics within ~10% toleranceVerify current metric ratio vs target threshold and tolerance windowIsolated HPA/CA analysisMissing HPA→CA cascade linkageUse Path C when both HPA and CA are present and intent is UNKNOWNWrong cluster_idAPI returns 404 or empty resultsVerify cluster ID via huawei_list_cce_clustersCredential permission deniedAPI returns 403Check IAM permissions for CCE HPA/Pod/Event/Addon accessNot checking maxReplicasHPA stuck at max replicas with ScalingLimited conditionCompare currentReplicas vs maxReplicas in HPA statusNot checking nodepool max_nodesCA not expanding despite Pending PodsCheck max_nodes vs current node count in nodepoolMetrics API unavailableHPA shows FailedGetResourceMetricEnsure metrics-server or AOM addon is installed in cluster