当前位置: 首页 > Skill >

Huawei Cloud Cce Workload Failure Diagnoser

Huawei Cloud Cce Workload Failure Diagnoser

Huawei Cloud Cce Workload Failure Diagnoser

华为云CCE工作负载故障诊断技能,基于Python SDK调度器。适用于诊断Deployment/StatefulSet/DaemonSet等负载故障的场景。

0.1.0 2026.11.27 857
获取Skill文件查看使用说明
作 者:林澄 许可证: 更新时间:2026.11.27
本文目录展开

Huawei Cloud CCE Workload Failure Diagnoser

⚠️ Execution Method (Must Read): This skill executes diagnosis via local Python scripts using the scripts/huawei-cloud.py dispatcher. Using hcloud, kubectl, or other CLI tools or direct API calls is prohibited.

  • All actions are dispatched through scripts/huawei-cloud.py with --action <action_name> and --params <json_params>
  • All scripts and environment check scripts are inside the skill package. You must use skill action=exec to execute them; do not run them directly in a shell
  • For action names and parameters, see the Core Commands section below
  • Do not attempt hcloud, kubectl, curl IAM, or other CLI/API methods. This skill does not depend on these tools
  • All paths are relative to the skill directory, which is the directory where this SKILL.md resides

Overview

This skill diagnoses CCE workload rollout failures, replica availability issues, and probe-related readiness failures for Deployment, StatefulSet, and DaemonSet workloads. It builds evidence from controller state, version ownership, and event trees, then drills down into abnormal Pods using Pod diagnosis logic.

Architecture: Python SDK dispatcher (scripts/huawei-cloud.py) → Huawei Cloud CCE API / Kubernetes API → Workload + ReplicaSet + Pod + Event data → Rollout funnel analysis → Top causes ranking → Handoff recommendations

Related Skills:

  • huawei-cloud-cce-pod-failure-diagnoser - Pod-level failure diagnosis (CrashLoop, ImagePull, OOM, Pending, etc.) for drill-down from workload diagnosis
  • huawei-cloud-cce-node-failure-diagnoser - Node-level failure diagnosis (NotReady, DiskPressure, MemoryPressure, etc.) for scheduling/node pressure handoff
  • huawei-cloud-cce-root-cause-analyzer - Multi-domain root cause analysis converging workload, alarm, change, and dependency evidence
  • huawei-cloud-cce-auto-remediation-runner - Remediation execution (rollback, scale, resize, cordon, drain, reboot) with preview-confirm-verify workflow
  • huawei-cloud-cce-alarm-correlation-engine - AOM alarm correlation, deduplication, and severity grouping for alarm-related evidence
  • huawei-cloud-cce-cce-workload-manager - CCE workload lifecycle management (create, query, scale, update, delete)

Capabilities:

  • Diagnose Deployment/StatefulSet/DaemonSet rollout failures (rollout stuck, rollback issues)
  • Analyze workload replica shortages (unavailable replicas, updated replicas below expected)
  • Diagnose probe failures (startup, liveness, readiness probe failures causing Pod not Ready)
  • Identify ReplicaSet creation blocked by quota, admission, or webhook rejection
  • Detect control-plane-not-observed issues (observedGeneration lagging behind generation)
  • Collect workload rollout context (Workload, ReplicaSet, Pod, and UID-filtered Events)
  • Drill down into Pod-level failures for abnormal Pods
  • Cross-domain handoff to node, network, storage, and root-cause skills

Typical Use Cases:

  • "My Deployment rollout is stuck, diagnose the failure"
  • "Replicas are unavailable, find the root cause"
  • "Pods are Running but not Ready, check probe failures"
  • "New ReplicaSet has zero replicas, check quota or admission blocking"
  • "Deployment observedGeneration is lagging, check control plane pressure"
  • "Collect workload rollout context for manual analysis"
  • "Drill down into Pod-level failures from workload diagnosis"
  • "Check PVC/PV for storage-related workload issues"
  • "Hand off to node or network diagnosis for cross-domain failures"

Prerequisites

1. Python Requirements (MANDATORY)

  • Python >= 3.6 installed
  • Run the environment check script before any diagnosis action

Environment Check:

  • Linux / macOS: skill action=exec: bash skill://scripts/check_env.sh
  • Windows: skill action=exec: powershell -ExecutionPolicy Bypass -File skill://scripts/check_env.ps1

Windows Note: Do not use && to chain commands (PowerShell 5.x does not support it). Use semicolons if you need to change directories first.

The script will check in sequence: Python >= 3.6 → install dependencies → validate SDK → validate credentials → validate service availability. If the environment check fails, fix the issues before continuing with other actions.

2. Credential Configuration

  • Valid Huawei Cloud credentials (AK/SK mode)
  • Security Rules:
    • 🚫 Never expose AK/SK values in code, conversation, or commands
    • 🚫 Never use echo $HW_ACCESS_KEY or echo $HW_SECRET_KEY to check credentials
    • ✅ Use environment variables: HW_ACCESS_KEY, HW_SECRET_KEY, HW_REGION_NAME
    • ✅ Prefer IAM users over root account for cloud operations
    • ✅ Enable MFA for sensitive operations
    • ✅ Never persist credentials (AK/SK/Token/Certificate) to the filesystem
    • ✅ All temporary certificate files must be deleted immediately after use

Configuration Method (Environment Variables Only):

export HW_ACCESS_KEY=<your-ak>
export HW_SECRET_KEY=<your-sk>
export HW_REGION_NAME=cn-north-4
export HW_PROJECT_ID=<your-project-id>

Optional for temporary AK/SK:

export HW_SECURITY_TOKEN=<your-security-token>

⚠️ Important Security Notes:

  • AK/SK exist only within the current request call stack; released after use
  • Only non-sensitive project IDs are cached in process memory (never written to disk)
  • Never commit credentials to version control
  • Use IAM users with minimal required permissions
  • Rotate AK/SK regularly
  • Do not output the values of environment variables

3. IAM Permission Requirements

API Action Permission Purpose
cce:cluster:get Get cluster Obtain CCE cluster details and kubeconfig
cce:cluster:createCert Create certificate Obtain CCE cluster kubeconfig for API access
cce:node:list List nodes Query cluster node information
cce:workload:get Get workload Read Deployment/StatefulSet/DaemonSet status
cce:pod:list List pods Query Pod status and container state
cce:event:list List events Query Kubernetes Events for diagnosis
aom:metric:get Get metrics Query Pod/Node CPU/memory metrics

Permission Failure Handling:

  1. When any action fails due to IAM permission errors, verify the permissions listed above
  2. Guide the user to create a custom policy in the IAM console for Huawei Cloud permissions
  3. Pause execution and wait for user confirmation that permissions have been granted

Core Commands

All actions are dispatched through scripts/huawei-cloud.py using skill action=exec:

python3 scripts/huawei-cloud.py --action <action_name> --params '<json_params>'

1. Primary Diagnosis

See Workflow for detailed evidence collection and diagnosis flow.

# Diagnose Deployment rollout failure
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_workload_rollout_diagnose --params '{"region":"cn-north-4","cluster_id":"<cluster-id>","namespace":"default","kind":"Deployment","name":"api"}'

# Diagnose StatefulSet rollout failure
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_workload_rollout_diagnose --params '{"region":"cn-north-4","cluster_id":"<cluster-id>","namespace":"default","kind":"StatefulSet","name":"my-db"}'

# Diagnose DaemonSet rollout failure
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_workload_rollout_diagnose --params '{"region":"cn-north-4","cluster_id":"<cluster-id>","namespace":"default","kind":"DaemonSet","name":"log-agent"}'

2. Context Collection (Evidence Only)

# Collect raw workload rollout context without diagnosis ranking
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_get_workload_rollout_context --params '{"region":"cn-north-4","cluster_id":"<cluster-id>","namespace":"default","kind":"Deployment","name":"api"}'

3. Pod-Level Drill-Down

# Diagnose Pod-level failures (CrashLoop, ImagePull, OOM, Pending, etc.)
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_pod_failure_diagnose --params '{"region":"cn-north-4","cluster_id":"<cluster-id>"}'

# List Pods in the cluster
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_get_cce_pods --params '{"region":"cn-north-4","cluster_id":"<cluster-id>"}'

# Retrieve container logs for a specific Pod
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_get_pod_logs --params '{"region":"cn-north-4","cluster_id":"<cluster-id>","pod_name":"<pod-name>"}'

4. Supporting Evidence

# List Kubernetes Events in the cluster
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_get_cce_events --params '{"region":"cn-north-4","cluster_id":"<cluster-id>"}'

# Get CPU/memory metrics for a specific Pod
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_get_cce_pod_metrics --params '{"region":"cn-north-4","cluster_id":"<cluster-id>","pod_name":"<pod-name>"}'

# Get top-N Pod metrics by resource usage
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_get_cce_pod_metrics_topN --params '{"region":"cn-north-4","cluster_id":"<cluster-id>"}'

5. Cross-Domain Drill-Down

# List PVCs for storage-related issues
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_get_cce_pvcs --params '{"region":"cn-north-4","cluster_id":"<cluster-id>"}'

# List PVs for storage-related issues
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_get_cce_pvs --params '{"region":"cn-north-4","cluster_id":"<cluster-id>"}'

# Diagnose node-level failures (scheduling, pressure)
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_node_diagnose --params '{"region":"cn-north-4","cluster_id":"<cluster-id>"}'

# Diagnose network-level failures (Service, Ingress connectivity)
skill action=exec: python3 scripts/huawei-cloud.py --action huawei_network_diagnose --params '{"region":"cn-north-4","cluster_id":"<cluster-id>"}'

Parameter Reference

Common Parameters

Parameter Required Description Default
region Yes Huawei Cloud region, e.g., cn-north-4 HW_REGION_NAME
cluster_id Yes CCE cluster ID HW_CLUSTER_ID
namespace Yes* Kubernetes namespace N/A
kind Yes* Workload type: Deployment, StatefulSet, or DaemonSet N/A
name Yes* Workload name N/A

*Required only for huawei_workload_rollout_diagnose and huawei_get_workload_rollout_context.

Workload-Specific Parameters

Parameter Required Description Constraints
kind Yes Workload type Deployment, StatefulSet, or DaemonSet only
name Yes Workload name Must reference existing workload in the namespace

Optional Parameters (passed via --params JSON)

Parameter Description Default
ak Override AK (uses HW_ACCESS_KEY by default) env var
sk Override SK (uses HW_SECRET_KEY by default) env var
project_id Override project ID (auto-obtained via IAM when not set) env var
label_selector Pod label selector for filtering None
hours Metric query time range in hours 1
top_n Number of top results for metrics 10

Supported Regions

Region Name Region ID
North China - Beijing 4 cn-north-4
North China - Beijing 1 cn-north-1
East China - Shanghai 1 cn-east-3
East China - Shanghai 2 cn-east-2
South China - Guangzhou cn-south-1
Southwest China - Guiyang 1 cn-southwest-2
Asia Pacific - Bangkok ap-southeast-2
Asia Pacific - Singapore ap-southeast-1
Asia Pacific - Hong Kong ap-southeast-3
Europe - Paris eu-west-0

Output Format

See Output Schema for detailed response format examples.

Primary Diagnosis: huawei_workload_rollout_diagnose

{
  "success": true,
  "action": "workload_rollout_diagnose",
  "target": {
    "namespace": "default",
    "kind": "Deployment",
    "name": "api"
  },
  "selector": {
    "value": "app=api",
    "source": "matchLabels"
  },
  "summary": {
    "status": "control_plane_not_observed | new_version_not_created | rollout_blocked | replicas_unavailable | probe_failure | healthy",
    "headline": "human-readable diagnosis; may note when old-version replicas remain available",
    "expected_replicas": 3,
    "ready_replicas": 1,
    "available_replicas": 1,
    "top_cause": "ProbeFailure | ContainerCommandNotFound | CrashLoopOrAppExit | ..."
  },
  "generation_check": {
    "generation": 5,
    "observed_generation": 5,
    "observed": true
  },
  "workload": {
    "kind": "Deployment",
    "uid": "workload-uid",
    "desired_replicas": 3,
    "updated_replicas": 3,
    "ready_replicas": 1,
    "available_replicas": 1,
    "conditions": []
  },
  "version": {
    "strategy": "DeploymentReplicaSet",
    "new_rs": {},
    "old_rs": []
  },
  "funnel": [
    {"layer": "workload_current", "expected": 3, "actual": 3, "status": "pass"},
    {"layer": "new_pods_ready", "expected": 3, "actual": 1, "status": "fail"}
  ],
  "events": {
    "filtered_count": 5,
    "timeline": [],
    "filter": {
      "uid_count": 6,
      "before_count": 40,
      "after_count": 5,
      "events_without_involved_uid": 0
    }
  },
  "pod_diagnosis": {
    "diagnosed_pods": 1,
    "pods": []
  },
  "top_causes": [
    {
      "rank": 1,
      "type": "ProbeFailure",
      "title": "New version Pods are Running but probe checks fail or Pods are not Ready",
      "confidence": 0.88,
      "evidence": [],
      "recommendation": []
    }
  ],
  "handoff": [
    {
      "skill": "huawei-cloud-cce-pod-failure-diagnoser",
      "reason": "Probe failure requires Pod logs and health check configuration analysis"
    }
  ],
  "warnings": []
}

Context-Only: huawei_get_workload_rollout_context

{
  "success": true,
  "action": "get_workload_rollout_context",
  "workload": {},
  "replicasets": [],
  "pods": [],
  "events": [],
  "event_filter": {},
  "warnings": []
}

Summary Status Values

Status Description
healthy All replicas ready and available; rollout complete
control_plane_not_observed observedGeneration < generation; controller lagging
new_version_not_created New ReplicaSet has zero current replicas or no owned Pods
rollout_blocked Rollout funnel layer fails; replicas below expected
replicas_unavailable Updated/ready/available replicas below desired count
probe_failure Pod Running but not Ready; Unhealthy probe events present

Top Cause Types

Top Cause Type Description
ProbeFailure Startup/liveness/readiness probe failing
ContainerCommandNotFound Executable not found in container $PATH
CrashLoopOrAppExit Container crashing or exiting unexpectedly
ImagePullBackOff Container image cannot be pulled
OOMKilled Container killed by OOM
QuotaOrAdmissionRejected ReplicaSet creation blocked by quota/admission/webhook
SchedulingFailure Pod Pending due to FailedScheduling
StorageMountFailure Pod FailedMount/FailedAttachVolume

Verification

See Verification Method for step-by-step verification.

Best Practices

  1. Always start with primary diagnosis — Use huawei_workload_rollout_diagnose before collecting raw context; it provides the rollout funnel and ranked Top causes
  2. Drill down from workload layer — Identify which funnel layer first fails before drilling into Pod-level diagnosis; do not skip the workload layer
  3. Use Pod diagnosis for drill-down — When NewRS Pods exist but are not Ready, use huawei_pod_failure_diagnose and huawei_get_pod_logs for deeper analysis
  4. Only use UID-filtered Events — Only accept Events whose involvedObject.uid belongs to Workload, ReplicaSet, or Pod objects; do not treat all namespace Warning events as relevant
  5. Check generation before Pod analysis — If observedGeneration < generation, diagnose control-plane pressure before looking at Pods
  6. Distinguish old vs new version replicas — A Deployment with old ReplicaSet replicas still available is not "healthy"; the funnel tracks new-version readiness specifically
  7. Cite specific evidence — Always cite specific objects, events, log segments, or API fields in diagnosis output; never present guesses as conclusions
  8. Write "insufficient evidence" when lacking — When evidence is insufficient, write "insufficient evidence" explicitly; never fabricate diagnosis results
  9. Hand off cross-domain failures — When evidence points to scheduling/node pressure, hand off to huawei-cloud-cce-node-failure-diagnoser; for Service/Ingress/ELB issues, hand off to huawei-cloud-cce-network-failure-diagnoser
  10. Remediation as recommendations only — All remediation actions (scale, resize, delete, cordon/drain/reboot) must be output as recommendations and handed off to huawei-cloud-cce-auto-remediation-runner

Reference Documents

Document Description
Workflow Evidence collection order, failure rules, and diagnosis flow
Output Schema Response format specification for primary and context actions
Risk Rules Allowed/not-allowed operations and handoff mapping
Verification Method Step-by-step verification procedures
Huawei Cloud CCE Documentation Official CCE documentation
Huawei Cloud Python SDK Documentation CCE API reference

Notes

  • This skill is read-only diagnosis only — no write, scale, delete, cordon, drain, or reboot operations
  • Do not output credential values — never expose HW_ACCESS_KEY, HW_SECRET_KEY, HW_SECURITY_TOKEN values in logs, responses, or error messages
  • All scripts must be executed via skill action=exec — do not run them directly in a shell
  • Do not call remediation actions — huawei_scale_cce_workload, huawei_resize_cce_workload, huawei_delete_cce_workload are out of scope
  • Do not add confirm=true — this skill never confirms remediation actions; it only outputs recommendations
  • Run environment check first — the check script must be executed before any diagnosis action
  • Temporary AK/SK requires HW_SECURITY_TOKEN — set this environment variable when using temporary credentials
  • Cross-skill handoff uses prefixed names — handoff targets use huawei-cloud-cce- prefix convention (e.g., huawei-cloud-cce-pod-failure-diagnoser)

Common Pitfalls

Pitfall Symptom Quick Fix
Treating all namespace Warning events as evidence False-positive diagnosis with irrelevant events Only use UID-filtered events whose involvedObject.uid belongs to Workload/RS/Pod
Skipping generation check Misdiagnosing Pod failures when controller is lagging If observedGeneration < generation, diagnose control-plane pressure first
Confusing old-version replicas with health Declaring workload "healthy" when old RS still active The rollout funnel tracks new-version readiness specifically
Diagnosing Pod failures directly without funnel Missing the workload-layer root cause Start from workload layer; identify which funnel layer first fails
Attempting remediation from this skill Unauthorized scale/delete/cordon/drain actions All changes must be handed off to huawei-cloud-cce-auto-remediation-runner
Ignoring ReplicaSetCreateBlocked subtype Missing quota/admission/webhook rejection evidence Check FailedCreate events mentioning quota, LimitRange, admission, webhook, forbidden
Using unfiltered namespace events Too many irrelevant Warning events in diagnosis Apply UID-based event filtering per workflow step 5
Not running environment check script first SDK import errors or credential failures Run check_env.sh / check_env.ps1 before any action
Hardcoding cluster_id instead of environment variable Wrong cluster or repeated manual entry Use HW_CLUSTER_ID env var or pass cluster_id per action
Confusing Deployment RS vs StatefulSet version model Wrong version analysis for StatefulSet/DaemonSet Deployment uses ReplicaSet revision; StatefulSet/DaemonSet use workload itself

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • Huawei Cloud CCE Workload Failure Diagnoser
    • Overview
    • Prerequisites
      • 1. Python Requirements (MANDATORY)
      • 2. Credential Configuration
      • 3. IAM Permission Requirements
    • Core Commands
      • 1. Primary Diagnosis
      • 2. Context Collection (Evidence Only)
      • 3. Pod-Level Drill-Down
      • 4. Supporting Evidence
      • 5. Cross-Domain Drill-Down
    • Parameter Reference
      • Common Parameters
      • Workload-Specific Parameters
      • Optional Parameters (passed via --params JSON)
      • Supported Regions
    • Output Format
      • Primary Diagnosis: huawei_workload_rollout_diagnose
      • Context-Only: huawei_get_workload_rollout_context
      • Summary Status Values
      • Top Cause Types
    • Verification
    • Best Practices
    • Reference Documents
    • Notes
    • Common Pitfalls
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期