当前位置: 首页 > Skill >

Huawei Cloud Cce Network Failure Diagnoser

Huawei Cloud Cce Network Failure Diagnoser

Huawei Cloud Cce Network Failure Diagnoser

华为云CCE网络故障诊断技能,使用Python SDK调度器。当用户想要:(1)诊断CCE网络连通性是否正常

0.1.1 2026.11.21 719
获取Skill文件查看使用说明
作 者:沈知 许可证: 更新时间:2026.11.21
本文目录展开

Huawei Cloud CCE Network Failure Diagnoser

⚠️ Execution Method (Must Read): This skill executes diagnosis via local Python scripts using a dispatcher pattern. Using hcloud, openstack, or other CLI tools or direct API calls is prohibited.

  • The dispatcher script is scripts/huawei-cloud.py, invoked as python3 scripts/huawei-cloud.py <action> <key=value 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 details and parameters, refer to references/workflow.md, references/risk-rules.md, and references/output-schema.md
  • 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.

Overview

This skill diagnoses CCE (Cloud Container Engine) network failures by performing a layered, read-only diagnosis across the full network stack — from node infrastructure, DNS, Service/EndpointSlice, NetworkPolicy, Ingress to cloud-side ELB/EIP/NAT/VPC security policies. It produces a complete Markdown diagnosis report that must include the investigation process, evidence, conclusions, confidence levels, and verification criteria.

Use this skill when:

  1. CCE Service connectivity is broken (Service unreachable, intermittent, or flapping)
  2. DNS/CoreDNS resolution failures (NXDOMAIN, timeout)
  3. Ingress 502/504 errors or ELB backend health issues
  4. NetworkPolicy blocking traffic between Pods
  5. VPC/Subnet/Security Group/ACL configuration affecting cluster networking
  6. EIP/NAT gateway affecting external access from the cluster

This skill does NOT handle:

  1. Creating, modifying, or deleting any resources
  2. Binding/unbinding EIP or modifying security groups/ACLs/ELB listeners
  3. Scaling workloads or restarting components
  4. Pod-level or Node-level root causes (cross-reference to huawei-cloud-cce-pod-failure-diagnoser, huawei-cloud-cce-node-failure-diagnoser, huawei-cloud-cce-workload-failure-diagnoser)

Prerequisites

You must run the environment check script first to complete environment validation and dependency installation in one step:

  • 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 order: Python >= 3.6 → install dependencies → validate SDK → validate credentials → validate service availability. If the environment check fails, fix the issues before proceeding.

Environment Variables:

Variable Required Description
HW_ACCESS_KEY Yes Huawei Cloud AK (Access Key)
HW_SECRET_KEY Yes Huawei Cloud SK (Secret Key)
HW_REGION_NAME No Default cn-north-4
HW_PROJECT_ID No Project ID (automatically obtained via IAM API when not set)
HW_SECURITY_TOKEN No Required when using temporary AK/SK
HW_CCE_CLUSTER_ID Yes CCE cluster ID for diagnosis target
KUBECONFIG No Kubernetes config; auto-obtained from CCE API if not set

Security Constraints:

  1. Never persist AK/SK/Token/Certificate to filesystem
  2. AK/SK exists only in the current call stack; released after call ends
  3. Only non-sensitive project IDs may be cached in process memory (never written to disk)
  4. All temporary certificate files must be deleted immediately after use
  5. Never leak AK/SK in logs, responses, or error messages
  6. Never send credentials to any third-party server

Do not output the values of environment variables.

IAM Permission Requirements

API Action Permission Purpose
cce:cluster:get Get cluster View cluster details
cce:cluster:list List clusters List CCE clusters
cce:node:list List nodes List cluster nodes
vpc:vpc:list List VPCs Query VPC details
vpc:subnet:list List subnets Query subnet details
elb:loadbalancer:list List ELBs Query ELB details
elb:listener:list List listeners Query ELB listeners
aom:*:get Read AOM Query AOM metrics and alarms

Permission Failure Handling:

  1. When any command fails due to permission errors, display required permission list
  2. Guide the user to create a custom policy in the IAM console
  3. Pause execution and wait for user confirmation

Core Tools

All actions are invoked via the Python dispatcher script:

python3 scripts/huawei-cloud.py <action> region=<region> cluster_id=<cluster_id> namespace=<namespace> [other_params...]

Execution via skill:

  • Linux / macOS: skill action=exec: skill://.venv/bin/python3 skill://scripts/huawei-cloud.py <action> <params>
  • Windows: skill action=exec: skill://.venv/Scripts/python3.exe skill://scripts/huawei-cloud.py <action> <params>

Primary Diagnosis Action

Action Description
huawei_network_failure_diagnose One-shot diagnosis: collects K8s and cloud-side read-only snapshots, returns structured findings + report_markdown

Kubernetes Evidence Actions

Action Description
huawei_get_cce_services List Services in a namespace
huawei_get_cce_ingresses List Ingresses in a namespace
huawei_get_cce_pods List Pods in a namespace
huawei_get_kubernetes_nodes List cluster Nodes
huawei_get_cce_events List cluster Events
huawei_get_pod_logs Retrieve Pod container logs

Cloud Network Evidence Actions

Action Description
huawei_get_elb_backend_status Read ELB pool/member/health monitor/load balancer status
huawei_get_elb_metrics Retrieve ELB monitoring metrics
huawei_list_elb List ELB load balancers
huawei_list_elb_listeners List ELB listeners
huawei_list_eip List EIP addresses
huawei_get_eip_metrics Retrieve EIP monitoring metrics
huawei_list_nat List NAT gateways
huawei_get_nat_gateway_metrics Retrieve NAT gateway metrics
huawei_list_security_groups List VPC security groups
huawei_list_vpc_acls List VPC ACLs

Legacy Compatibility Actions

Action Description
huawei_network_diagnose Legacy comprehensive network diagnosis
huawei_network_diagnose_by_alarm Diagnosis triggered by alarm correlation
huawei_network_verify_pod_scheduling Verify Pod scheduling constraints (read-only)

Parameter Reference

Required Parameters

Parameter Description
region Huawei Cloud region, e.g., cn-north-4
cluster_id CCE cluster ID
namespace Kubernetes namespace

Optional Parameters (provide as many as possible for accurate diagnosis)

Parameter Description
failure_symptom Symptom description: domain_unresolvable, in_cluster_service_unreachable, service_intermittent, external_access_failed, ingress_502_504
target_kind Resource type: Pod, Service, Ingress, etc.
target_name Resource name
service_name Target Service name
ingress_name Target Ingress name
source_pod Source Pod name or label
destination_pod Destination Pod name or label
domain Domain name for DNS diagnosis
elb_id ELB load balancer ID

Output Format

huawei_network_failure_diagnose returns structured JSON with an embedded report_markdown:

{
  "success": true,
  "action": "huawei_network_failure_diagnose",
  "region": "cn-north-4",
  "cluster_id": "cluster-id",
  "namespace": "default",
  "conclusion": "high signal conclusion",
  "confidence": "High",
  "pipeline_pruned": false,
  "findings": [
    {
      "stage": "Stage 3: East-West Routing and Policy Layer",
      "type": "NetworkPolicyBlocked",
      "title": "NetworkPolicy selects target Pod but does not allow source Pod labels or target port",
      "confidence": 1.0,
      "severity": "critical",
      "evidence": [],
      "recommendation": [],
      "prune": false
    }
  ],
  "top_causes": [],
  "snapshot": {
    "inputs": {},
    "nodes": [],
    "pods": [],
    "services": [],
    "ingresses": [],
    "endpoint_slices": [],
    "network_policies": [],
    "events": [],
    "logs": {},
    "cloud": {
      "elb_ids": [],
      "elbs": {},
      "eips": {},
      "nat": {},
      "security_groups": {},
      "vpc_acls": {}
    }
  },
  "report_markdown": "# CCE Network Failure Automated Diagnosis Reportn..."
}

Markdown Report Sections

The report_markdown must contain the following headings:

  1. Diagnosis Overview — target, symptom, conclusion, confidence, collection time, pruned stages
  2. Investigation Process — per-stage status (checked, abnormal, pruned/skipped)
  3. Link Topology — DNS path, east-west path, or north-south path based on failure type
  4. Key Object Snapshot — Service, EndpointSlice, Backend Pods, Ingress, NetworkPolicy, Cloud ELB
  5. Evidence Matrix — stage, type, confidence, evidence summary
  6. Diagnosis Conclusion — top root causes (max 3), each backed by evidence
  7. Recommended Actions and Verification Criteria — read-only verification steps or change suggestions to hand off to huawei-cloud-cce-auto-remediation-runner

Finding Types

Common type values in findings:

Type Description
NodeUnhealthy Node Ready=False or Ready=Unknown
NodePressure Memory/Disk/PID/Network pressure on node
PodDNSConfigMissing Pod dnsPolicy=None with no dnsConfig
KubeDnsNoEndpoint kube-dns EndpointSlice has 0 ready endpoints
CoreDNSRestarting CoreDNS pods showing OOMKilled/LivenessProbe failures
CoreDNSNxDomain CoreDNS logs showing NXDOMAIN responses
CoreDNSUpstreamTimeout CoreDNS logs showing upstream i/o timeout
NetworkPolicyBlocked NetworkPolicy blocks source Pod traffic (confidence 100%)
ServiceNoReadyEndpoint Service has 0 ready endpoints in EndpointSlice
ServiceSelectorMismatch Service selector matches no Pods
ReadinessFlapping Backend Pod readiness probe flapping
BackendOverloaded Application logs show OOM/connection pool exhausted
LoadBalancerProvisioningFailed LoadBalancer Ingress status empty with CCM errors
ELBBackendUnhealthy ELB member unhealthy while K8s backend Pod is Ready
IngressUpstreamError Ingress controller logs show 502/504

Verification

  1. Run the environment check script to confirm dependencies and credentials are available
  2. Execute huawei_network_failure_diagnose with a known-healthy cluster and verify the report structure
  3. Cross-reference findings with Huawei Cloud console data (ELB health, security groups, VPC ACLs)
  4. Verify pipeline_pruned flag is set correctly when node-level issues prune upper layers
  5. Confirm that confidence and severity values are present in all findings

Best Practices

  1. Always provide failure_symptom to direct the diagnosis pipeline to the relevant stage (DNS, east-west, or north-south)
  2. Provide as many optional parameters as possible (service_name, ingress_name, source_pod, destination_pod, domain) for more precise diagnosis
  3. Start with huawei_network_failure_diagnose for one-shot comprehensive diagnosis; use individual actions only for targeted follow-up queries
  4. When evidence is insufficient, state "evidence insufficient" explicitly — never present guesses as conclusions
  5. For north-south (external access) issues, always supplement with huawei_get_elb_backend_status and huawei_list_security_groups to check cloud-side configuration
  6. When node-level issues are found, note that upper-layer diagnosis may be pruned; cross-reference with huawei-cloud-cce-node-failure-diagnoser

Reference Documents

  • Diagnosis workflow, reuse priorities, and layered pipeline: references/workflow.md
  • Risk rules and action boundaries: references/risk-rules.md
  • Output schema and finding type reference: references/output-schema.md

Notes

  1. This skill is strictly read-only; it never modifies Service, Ingress, NetworkPolicy, CoreDNS ConfigMap, security groups, ACLs, ELB listeners/backends, EIP bindings, or NAT rules
  2. Never execute kubectl exec, packet capture, stress testing, or active traffic injection unless the user explicitly requests and acknowledges the risk
  3. huawei_network_verify_pod_scheduling is for verification only; it does not replace scaling actions
  4. Any network change suggestion must describe impact scope, rollback method, and verification criteria, and be handed off to huawei-cloud-cce-auto-remediation-runner for preview
  5. Do not output the values of environment variables such as HW_ACCESS_KEY, HW_SECRET_KEY, HW_SECURITY_TOKEN
  6. All scripts must be executed via skill action=exec; do not run them directly in a shell

Common Pitfalls

  1. Missing cluster_id: The cluster_id parameter is required for all CCE actions. If the user only provides a cluster name, query huawei_list_cce_clusters first to resolve the ID
  2. Wrong failure_symptom: Using a wrong symptom category (e.g., ingress_502_504 for an in-cluster issue) may misdirect the pipeline. Always confirm the symptom type with the user
  3. Ignoring node-level root cause: If nodes are NotReady, upper-layer diagnosis may be pruned. Do not skip the node-layer check even when the symptom appears to be Service/DNS-level
  4. Confusing K8s-side and cloud-side: ELB backend unhealthy does not always mean the K8s Pod is unhealthy — check both huawei_get_elb_backend_status and huawei_get_cce_pods together
  5. Over-interpreting insufficient evidence: When EndpointSlice has 0 ready endpoints, it could be selector mismatch, readiness flapping, or Pod crash. Do not jump to conclusions without checking Pod events and logs
  6. Not checking NetworkPolicy for east-west issues: NetworkPolicy blocking has 100% confidence when confirmed, but is easily overlooked. Always check NetworkPolicy in the target namespace

推荐文章

更多
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,019
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,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

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

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • Huawei Cloud CCE Network Failure Diagnoser
    • Overview
    • Prerequisites
      • IAM Permission Requirements
    • Core Tools
      • Primary Diagnosis Action
      • Kubernetes Evidence Actions
      • Cloud Network Evidence Actions
      • Legacy Compatibility Actions
    • Parameter Reference
      • Required Parameters
      • Optional Parameters (provide as many as possible for accurate diagnosis)
    • Output Format
      • Markdown Report Sections
      • Finding 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 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期