huawei-cloud-cce-cluster-management
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHuawei Cloud CCE Cluster Management
华为云CCE集群管理
Overview
概述
Manage CCE (Cloud Container Engine) cluster lifecycle, including cluster creation/deletion/hibernation/awakening, node pool management, node scheduling control, and addon management.
The skill executes Huawei Cloud API calls through hcloud (KooCLI) and Kubernetes node operations (cordon/uncordon/drain/status) through kubectl cce (the kubectl-cce plugin). The plugin connects to the CCE API Gateway using AK/SK credentials — no cluster EIP or manual kubeconfig required. Two operations (create cluster, create node pool) fall back to the Python SDK because of a known hcloud metadata parsing defect — see cce-api-guide.md.
Dependency: This skill requires and the plugin. Install them via the huawei-cloud-kubectl-cce-installer skill.
kubectlkubectl-cce管理CCE(云容器引擎)集群生命周期,包括集群创建/删除/休眠/唤醒、节点池管理、节点调度控制以及插件管理。
本技能通过hcloud(KooCLI)执行华为云API调用,通过kubectl cce(kubectl-cce插件)执行Kubernetes节点操作(cordon/uncordon/drain/status)。该插件使用AK/SK凭证连接到CCE API网关——无需集群EIP或手动配置kubeconfig。由于已知的hcloud元数据解析缺陷,两项操作(创建集群、创建节点池)会回退使用Python SDK——详情请参考cce-api-guide.md。
依赖项:本技能需要和插件。可通过huawei-cloud-kubectl-cce-installer技能进行安装。
kubectlkubectl-cce⛔ Security Constraints
⛔ 安全约束
Dangerous Operation Confirmation Mechanism
危险操作确认机制
This skill strictly enforces a two-step confirmation mechanism for all dangerous operations to prevent accidental service disruption or data loss.
All dangerous operations require parameter to execute. Otherwise, they return a preview and confirmation prompt.
confirm=true本技能对所有危险操作严格执行两步确认机制,以防止意外中断服务或数据丢失。
所有危险操作需要传入参数才能执行。否则,将返回操作预览和确认提示。
confirm=trueOperations Requiring Confirmation
需要确认的操作
| Tool | Operation Type | Risk Level | Description |
|---|---|---|---|
| Delete | 🔴 Critical | Deletes entire CCE cluster, irreversible |
| Hibernate | 🟠 High | Stops all workloads, pauses control plane billing |
| Awake | 🟠 High | Resumes cluster from hibernation |
| Scale | 🟡 Medium | Adjusts node pool size, affects capacity |
| Delete | 🟠 High | Deletes node pool, affects business capacity |
| Delete | 🟠 High | Removes node from cluster, affects scheduling |
| Uninstall | 🟠 High | Removes addon, may affect cluster functionality |
| Cordon | 🟡 Medium | Marks node unschedulable, new pods won't be assigned |
| Uncordon | 🟡 Medium | Marks node schedulable, new pods may be assigned immediately |
| Drain | 🟠 High | Cordons + evicts all pods from node, affects running workloads |
| 工具 | 操作类型 | 风险等级 | 描述 |
|---|---|---|---|
| 删除 | 🔴 严重 | 删除整个CCE集群,操作不可逆 |
| 休眠 | 🟠 高 | 停止所有工作负载,暂停控制面计费 |
| 唤醒 | 🟠 高 | 将集群从休眠状态恢复 |
| 扩容/缩容 | 🟡 中等 | 调整节点池大小,影响集群容量 |
| 删除 | 🟠 高 | 删除节点池,影响业务容量 |
| 删除 | 🟠 高 | 从集群移除节点,影响调度 |
| 卸载 | 🟠 高 | 移除插件,可能影响集群功能 |
| 标记不可调度 | 🟡 中等 | 标记节点为不可调度,新Pod不会被分配到该节点 |
| 标记可调度 | 🟡 中等 | 标记节点为可调度,新Pod可能立即被分配 |
| 驱逐Pod | 🟠 高 | 标记节点不可调度并驱逐所有Pod,影响运行中的工作负载 |
Workflow
工作流程
Step 1: Preview Operation - Call without parameter
confirmbash
undefined步骤1:预览操作 - 调用时不传入参数
confirmbash
undefinedExample: Preview cluster deletion
示例:预览集群删除操作
python3 huawei-cloud.py huawei_delete_cce_cluster
region=cn-north-4
cluster_id=xxx
region=cn-north-4
cluster_id=xxx
Returns: operation preview, risk warning, confirmation example
**Step 2: Confirm Execution** - Call with `confirm=true`
```bashpython3 huawei-cloud.py huawei_delete_cce_cluster
region=cn-north-4
cluster_id=xxx
region=cn-north-4
cluster_id=xxx
返回内容:操作预览、风险警告、确认示例
**步骤2:确认执行** - 调用时传入`confirm=true`
```bashExample: Confirm and execute deletion
示例:确认并执行删除操作
python3 huawei-cloud.py huawei_delete_cce_cluster
region=cn-north-4
cluster_id=xxx
confirm=true
region=cn-north-4
cluster_id=xxx
confirm=true
undefinedpython3 huawei-cloud.py huawei_delete_cce_cluster
region=cn-north-4
cluster_id=xxx
confirm=true
region=cn-north-4
cluster_id=xxx
confirm=true
undefinedCredential Security
凭证安全
✅ This skill strictly follows these security rules:
- No persistent credential storage - Never saves AK/SK, tokens, or certificates to disk
- No long-term memory cache - AK/SK exists only during API call, released afterward
- Only project ID memory cache - Non-sensitive project ID cached in process memory
- No credential leakage - Never includes AK/SK in logs, responses, or errors
- Temporary file cleanup - Temporary kubeconfig files are deleted immediately after use
- Config-first credential passing - If hcloud CLI config has credentials, AK/SK are not passed as CLI arguments (avoids exposure). Environment variables are only set for subprocesses if not already present in the parent environment.
ps aux
Credentials are resolved from parameters or environment variables (process-level, never written to disk):
- Permanent credentials: +
HW_ACCESS_KEYHW_SECRET_KEY - Temporary credentials (recommended for CI/CD / IAM temporary access keys): +
HW_ACCESS_KEY+HW_SECRET_KEYHW_SECURITY_TOKEN - is optional — auto-fetched via
HW_PROJECT_IDwhen not provided (only for hcloud API calls; kubectl-cce node operations do not need it)hcloud IAM KeystoneListProjects - Per-call /
akparameters override the environment variables for that single callsk
Security hardening tip: Set / in the parent process environment (e.g., or systemd environment file) so they are inherited by subprocesses without explicit passing. The skill detects existing env vars and skips passing AK/SK as CLI arguments to hcloud, preventing credential exposure in process listings (). kubectl-cce reads these env vars directly from the process environment.
HW_ACCESS_KEYHW_SECRET_KEY~/.bashrcps auxbash
undefined✅ 本技能严格遵循以下安全规则:
- 不持久化存储凭证 - 绝不将AK/SK、令牌或证书保存到磁盘
- 无长期内存缓存 - AK/SK仅在API调用期间存在,调用后立即释放
- 仅缓存非敏感项目ID - 非敏感的项目ID缓存在进程内存中
- 不泄露凭证 - 绝不将AK/SK包含在日志、响应或错误信息中
- 清理临时文件 - 临时kubeconfig文件使用后立即删除
- 优先通过配置传递凭证 - 如果hcloud CLI配置中已有凭证,则不会将AK/SK作为CLI参数传递(避免在中暴露)。仅当父环境中不存在相关环境变量时,才会为子进程设置环境变量。
ps aux
凭证通过参数或环境变量(进程级,绝不写入磁盘)解析:
- 永久凭证:+
HW_ACCESS_KEYHW_SECRET_KEY - 临时凭证(推荐用于CI/CD / IAM临时访问密钥):+
HW_ACCESS_KEY+HW_SECRET_KEYHW_SECURITY_TOKEN - 为可选参数——未提供时,将通过
HW_PROJECT_ID自动获取(仅用于hcloud API调用;kubectl-cce节点操作不需要该参数)hcloud IAM KeystoneListProjects - 单次调用中的/
ak参数会覆盖本次调用的环境变量sk
安全加固提示:在父进程环境中设置/(例如或systemd环境文件),这样子进程会自动继承这些变量,无需显式传递。技能会检测现有环境变量,避免将AK/SK作为CLI参数传递给hcloud,防止凭证在进程列表()中暴露。kubectl-cce直接从进程环境读取这些变量。
HW_ACCESS_KEYHW_SECRET_KEY~/.bashrcps auxbash
undefinedPermanent
永久凭证
export HW_ACCESS_KEY="your-access-key-id"
export HW_SECRET_KEY="your-secret-access-key"
export HW_REGION_NAME="cn-north-4"
export HW_ACCESS_KEY="your-access-key-id"
export HW_SECRET_KEY="your-secret-access-key"
export HW_REGION_NAME="cn-north-4"
Temporary (add security token)
临时凭证(添加安全令牌)
export HW_SECURITY_TOKEN="your-security-token"
undefinedexport HW_SECURITY_TOKEN="your-security-token"
undefinedNode Login Password Security
节点登录密码安全
When creating nodes or node pools, the login credential is resolved with the following three-level priority:
- parameter — SSH key pair name (preferred when available). Mutually exclusive with password.
ssh_key - parameter — raw node login password passed per call (8–26 chars, ≥3 of: uppercase / lowercase / digits / special).
password - environment variable — used when neither
CCE_NODE_PASSWORDnorssh_keyis provided.password - Auto-generated random password — when none of the above is supplied, the skill generates a strong random password automatically.
⚠️ The auto-generated password is NEVER returned in the tool response (not in, not indata, not in logs). To access the node afterwards, the user must reset the node password via the CCE console or the ECS API. The success message only contains a hint instructing the user to reset the password.message
The raw password is never sent to the CCE API directly; the skill applies SHA-512 salted encryption + base64 encoding internally (see cce-cluster-parameters.md).
创建节点或节点池时,登录凭证按以下三级优先级解析:
- 参数 — SSH密钥对名称(优先使用,与密码互斥)。
ssh_key - 参数 — 单次调用传入的节点登录明文密码(8–26字符,需包含大写/小写/数字/特殊字符中的至少3种)。
password - 环境变量 — 当未提供
CCE_NODE_PASSWORD和ssh_key时使用。password - 自动生成随机密码 — 当以上均未提供时,技能会自动生成强随机密码。
⚠️ 自动生成的密码绝不会在工具响应中返回(不在、data或日志中)。后续如需访问节点,用户必须通过CCE控制台或ECS API重置节点密码。成功消息仅包含提示用户重置密码的内容。message
明文密码不会直接发送到CCE API;技能内部会对其进行SHA-512加盐加密+base64编码(详情请参考cce-cluster-parameters.md)。
Prerequisites
前置条件
CLI Tools
CLI工具
-
(Huawei Cloud KooCLI 7.2+) — drives all Huawei Cloud API calls. Install:
hcloudbashcurl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh hcloud version # verify install+kubectlplugin — required for node scheduling operations (cordon/uncordon/drain/status). Install via the huawei-cloud-kubectl-cce-installer skill:kubectl-ccebash# Check if already installed bash ../huawei-cloud-kubectl-cce-installer/scripts/install_kubectl_cce.sh --check # Install (after confirming the plan) sudo bash ../huawei-cloud-kubectl-cce-installer/scripts/install_kubectl_cce.sh --execute --bin-dir /usr/local/binTheplugin connects through the CCE API Gateway using AK/SK credentials — no cluster EIP or manual kubeconfig needed.kubectl cce
-
(华为云KooCLI 7.2+)——驱动所有华为云API调用。安装命令:
hcloudbashcurl -sSL https://cn-north-4-hdn-koocli.obs.cn-north-4.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && bash ./hcloud_install.sh hcloud version # 验证安装+kubectl插件——节点调度操作(cordon/uncordon/drain/status)必需。通过huawei-cloud-kubectl-cce-installer技能安装:kubectl-ccebash# 检查是否已安装 bash ../huawei-cloud-kubectl-cce-installer/scripts/install_kubectl_cce.sh --check # 安装(确认计划后执行) sudo bash ../huawei-cloud-kubectl-cce-installer/scripts/install_kubectl_cce.sh --execute --bin-dir /usr/local/bin插件使用AK/SK凭证连接到CCE API网关——无需集群EIP或手动配置kubeconfig。kubectl cce
Python Environment
Python环境
-
Python 3.8+
-
Install SDK packages (retained for create-cluster / create-nodepool fallback) and helpers:bash
pip install huaweicloudsdkcce huaweicloudsdkcore huaweicloudsdkiam passlib pyyamlprovides SHA-512 salting.passlib+huaweicloudsdkcce+huaweicloudsdkcoreare used by the two SDK fallback functions (create cluster, create node pool) and IAM project-ID resolution.huaweicloudsdkiamparses hcloud JSON output.pyyaml
-
Python 3.8+
-
安装SDK包(用于创建集群/创建节点池的回退逻辑)及辅助库:bash
pip install huaweicloudsdkcce huaweicloudsdkcore huaweicloudsdkiam passlib pyyaml提供SHA-512加盐功能。passlib+huaweicloudsdkcce+huaweicloudsdkcore用于两个SDK回退函数(创建集群、创建节点池)以及IAM项目ID解析。huaweicloudsdkiam用于解析hcloud的JSON输出。pyyaml
Environment Variables
环境变量
The skill detects existing environment variables before passing credentials to subprocesses:
- hcloud CLI calls: if /
HW_ACCESS_KEYare already inHW_SECRET_KEY, the skill skips passingos.environ/--cli-access-keyas CLI arguments, preventing exposure in--cli-secret-key.ps aux - kubectl-cce calls: the plugin reads /
HW_ACCESS_KEYfrom the process environment directly. If these variables are already set, the subprocess inherits them naturally — the skill does not set them again.HW_SECRET_KEY
🔒 Security Tip: Set/HW_ACCESS_KEYat the system or session level (e.g., inHW_SECRET_KEYor a systemd environment file) so the skill never needs to pass them as explicit CLI arguments. This eliminates the risk of credential exposure in process listings (~/.bashrc) and shell history.ps aux
bash
undefined技能在将凭证传递给子进程前,会检测现有环境变量:
- hcloud CLI调用:如果/
HW_ACCESS_KEY已存在于HW_SECRET_KEY中,技能会跳过传递os.environ/--cli-access-key作为CLI参数,避免在--cli-secret-key中暴露。ps aux - kubectl-cce调用:插件直接从进程环境读取/
HW_ACCESS_KEY。如果这些变量已设置,子进程会自动继承——技能不会重复设置。HW_SECRET_KEY
🔒 安全提示:在系统或会话级别设置/HW_ACCESS_KEY(例如HW_SECRET_KEY或systemd环境文件),这样技能永远不需要将它们作为显式CLI参数传递。这消除了凭证在进程列表(~/.bashrc)和shell历史中暴露的风险。ps aux
bash
undefinedSet credentials at session level (the skill detects these and skips
在会话级别设置凭证(技能会检测到这些变量,跳过将其作为显式CLI参数传递给hcloud/kubectl-cce)
passing them as explicit CLI arguments to hcloud/kubectl-cce)
—
export HW_ACCESS_KEY="your-access-key-id"
export HW_SECRET_KEY="your-secret-access-key"
export HW_REGION_NAME="cn-north-4"
export HW_ACCESS_KEY="your-access-key-id"
export HW_SECRET_KEY="your-secret-access-key"
export HW_REGION_NAME="cn-north-4"
Optional, for temporary credentials:
可选,临时凭证使用:
export HW_SECURITY_TOKEN="your-security-token"
export HW_SECURITY_TOKEN="your-security-token"
Optional, for node login when ssh_key is not used:
可选,未使用ssh_key时用于节点登录:
export CCE_NODE_PASSWORD="your-password"
undefinedexport CCE_NODE_PASSWORD="your-password"
undefinedIAM Permission Policies
IAM权限策略
Ensure the IAM user has the minimum required permissions:
| Permission | Description |
|---|---|
| List clusters |
| Get cluster details |
| Create clusters |
| Delete clusters |
| Update clusters (hibernate/awake/bind EIP) |
| List nodes |
| Get node details |
| Create nodes |
| Delete nodes |
| Update nodes (cordon/uncordon/drain) |
| List node pools |
| Create node pools |
| Delete node pools |
| Update node pools (resize) |
| List addons |
| Get addon details |
| Install addons |
| Update addons |
| Uninstall addons |
确保IAM用户拥有以下最低必要权限:
| 权限 | 描述 |
|---|---|
| 列出集群 |
| 获取集群详情 |
| 创建集群 |
| 删除集群 |
| 更新集群(休眠/唤醒/绑定EIP) |
| 列出节点 |
| 获取节点详情 |
| 创建节点 |
| 删除节点 |
| 更新节点(cordon/uncordon/drain) |
| 列出节点池 |
| 创建节点池 |
| 删除节点池 |
| 更新节点池(调整大小) |
| 列出插件 |
| 获取插件详情 |
| 安装插件 |
| 更新插件 |
| 卸载插件 |
参数确认
参数确认
Before executing any command, confirm the following parameters with the user:
执行任何命令前,请与用户确认以下参数:
认证参数
认证参数
| Parameter | Env Variable | Required | Description |
|---|---|---|---|
| Access Key ID | | ✅ | Huawei Cloud AK, permanent or temporary credential |
| Secret Access Key | | ✅ | Huawei Cloud SK, permanent or temporary credential |
| Region | | ✅ | Region, e.g. |
| Security Token | | ❌ | Temporary credential security token, STS only |
| Node Password | | ❌ | Node login password, auto-generated if not set |
| 参数 | 环境变量 | 必填 | 描述 |
|---|---|---|---|
| Access Key ID | | ✅ | 华为云AK,永久或临时凭证 |
| Secret Access Key | | ✅ | 华为云SK,永久或临时凭证 |
| Region | | ✅ | 区域,例如 |
| Security Token | | ❌ | 临时凭证安全令牌,仅STS使用 |
| Node Password | | ❌ | 节点登录密码,未设置时自动生成 |
集群参数
集群参数
| Parameter | Required | Default | Description |
|---|---|---|---|
| ✅ | — | Cluster name, recommended |
| ❌ | | Cluster type (Turbo/VirtualMachine) |
| ❌ | | Container network type, |
| ❌ | API latest | Kubernetes version, auto-select latest if omitted |
| ✅ | — | VPC ID |
| ✅ | — | Subnet ID |
| ✅ | — | Node flavor, e.g. |
| ❌ | | Danger confirmation flag, required |
| 参数 | 必填 | 默认值 | 描述 |
|---|---|---|---|
| ✅ | — | 集群名称,推荐格式 |
| ❌ | | 集群类型(Turbo/VirtualMachine) |
| ❌ | | 容器网络类型,Turbo集群推荐使用 |
| ❌ | API最新版本 | Kubernetes版本,省略时自动选择最新版本 |
| ✅ | — | VPC ID |
| ✅ | — | 子网ID |
| ✅ | — | 节点规格,例如 |
| ❌ | | 危险操作确认标志,删除/休眠/调整大小操作需要设置为 |
节点池参数
节点池参数
| Parameter | Required | Default | Description |
|---|---|---|---|
| ✅ | — | Node pool name, recommended |
| ❌ | | Initial node count, ≥2 recommended for HA |
| ❌ | — | Auto-scaling minimum |
| ❌ | — | Auto-scaling maximum |
| ❌ | — | SSH key pair name, takes priority over password |
| ❌ | | Root disk size (GB) |
| ❌ | | Data disk size (GB) |
| 参数 | 必填 | 默认值 | 描述 |
|---|---|---|---|
| ✅ | — | 节点池名称,推荐格式 |
| ❌ | | 初始节点数量,为了高可用性推荐≥2 |
| ❌ | — | 自动扩缩容最小值 |
| ❌ | — | 自动扩缩容最大值 |
| ❌ | — | SSH密钥对名称,优先级高于密码 |
| ❌ | | 系统盘大小(GB) |
| ❌ | | 数据盘大小(GB) |
其他参数
其他参数
| Parameter | Required | Default | Description |
|---|---|---|---|
| ❌ | | Kubeconfig validity period (days), pass as integer |
| ❌ | auto | EIP ID, auto-find or create if not provided |
| ❌ | — | Addon ID (UID), required for detail query |
| 参数 | 必填 | 默认值 | 描述 |
|---|---|---|---|
| ❌ | | kubeconfig有效期(天),传入整数 |
| ❌ | auto | EIP ID,未提供时自动查找或创建 |
| ❌ | — | 插件ID(UID),查询详情时必需 |
Core Commands
核心命令
Cluster Query
集群查询
| Tool | Function | Parameters |
|---|---|---|
| List all CCE clusters in region | |
| Get detailed node information | |
| Get cluster kubeconfig | |
| 工具 | 功能 | 参数 |
|---|---|---|
| 列出区域内所有CCE集群 | |
| 获取节点详细信息 | |
| 获取集群kubeconfig | |
Cluster Management
集群管理
| Tool | Function | Risk Level | Requires Confirmation |
|---|---|---|---|
| Create CCE cluster | 🟢 Low | No |
| Delete CCE cluster | 🔴 Critical | Yes |
| Hibernate cluster | 🟠 High | Yes |
| Awake cluster | 🟠 High | No |
| Bind cluster EIP (auto-find/create if no eip_id) | 🟢 Low | No |
| Unbind cluster EIP | 🟡 Medium | No |
Dynamic EIP Binding:supports dynamic EIP assignment. Ifhuawei_bind_cce_cluster_eipis not provided, the skill automatically: (1) lists existing EIPs and finds an unbound one (status=DOWN), (2) if none available, creates a new EIP (traffic billing, 5Mbps, PER share type), (3) binds it to the cluster. The response includeseip_id(true/false),eip_created,eip_id, andeip_address(the External API URL).public_endpoint
Recommended defaults:
- Cluster type: (best performance with ENI network)
Turbo - Container network: for Turbo clusters (default in this skill)
eni - Cluster version: omit to let the API pick the latest supported version; specify it only when the user requires a specific Kubernetes version
cluster_version - Naming format: (e.g.,
<env>-<app>-cluster)prod-web-cluster
| 工具 | 功能 | 风险等级 | 是否需要确认 |
|---|---|---|---|
| 创建CCE集群 | 🟢 低 | 否 |
| 删除CCE集群 | 🔴 严重 | 是 |
| 休眠集群 | 🟠 高 | 是 |
| 唤醒集群 | 🟠 高 | 否 |
| 绑定集群EIP(未提供eip_id时自动查找/创建) | 🟢 低 | 否 |
| 解绑集群EIP | 🟡 中等 | 否 |
动态EIP绑定:支持动态分配EIP。如果未提供huawei_bind_cce_cluster_eip,技能会自动执行:(1) 列出现有EIP并找到未绑定的EIP(状态=DOWN);(2) 如果没有可用EIP,创建新的EIP(流量计费,5Mbps,共享型);(3) 将其绑定到集群。响应内容包含eip_id(true/false)、eip_created、eip_id和eip_address(外部API地址)。public_endpoint
推荐默认值:
- 集群类型:(搭配ENI网络性能最佳)
Turbo - 容器网络:Turbo集群使用(本技能默认值)
eni - 集群版本:省略让API选择最新支持版本;仅当用户需要特定Kubernetes版本时才指定
cluster_version - 命名格式:(例如
<env>-<app>-cluster)prod-web-cluster
Node Pool Management
节点池管理
| Tool | Function | Risk Level | Requires Confirmation |
|---|---|---|---|
| List node pools | 🟢 Low | No |
| Create node pool | 🟢 Low | No |
| Delete node pool | 🟠 High | Yes |
| Resize node pool | 🟡 Medium | Yes |
Recommended defaults:
- Naming format: (e.g.,
<env>-<role>-pool)prod-worker-pool - Initial node count: 2 for HA, or 0 with autoscaling
- Enable autoscaling for dynamic scaling
- For Turbo clusters, use ENI-compatible flavors (e.g., )
c7.large.2
| 工具 | 功能 | 风险等级 | 是否需要确认 |
|---|---|---|---|
| 列出节点池 | 🟢 低 | 否 |
| 创建节点池 | 🟢 低 | 否 |
| 删除节点池 | 🟠 高 | 是 |
| 调整节点池大小 | 🟡 中等 | 是 |
推荐默认值:
- 命名格式:(例如
<env>-<role>-pool)prod-worker-pool - 初始节点数量:为了高可用性设置为2,或设置为0并启用自动扩缩容
- 启用自动扩缩容以实现动态调度
- Turbo集群使用兼容ENI的规格(例如)
c7.large.2
Node Management
节点管理
| Tool | Function | Risk Level | Requires Confirmation |
|---|---|---|---|
| List cluster nodes | 🟢 Low | No |
| Create nodes directly | 🟢 Low | No |
| Delete node | 🟠 High | Yes |
| Mark node unschedulable | 🟡 Medium | Yes |
| Mark node schedulable | 🟡 Medium | Yes |
| Cordon + evict all pods from node | 🟠 High | Yes |
| Query node scheduling status | 🟢 Low | No |
Node scheduling operations (, , , ) are executed via kubectl cce — the kubectl-cce plugin connects to the CCE API Gateway using AK/SK credentials. No cluster EIP or manual kubeconfig required. The plugin handles cordon, eviction, PodDisruptionBudget (PDB) compliance, and DaemonSet pod skipping natively.
cordonuncordondrainstatushuawei_cce_node_drainPodDisruptionBudgetfailed_podsNote: Prefer node pools for managed scaling. Direct node creation is for special cases.
| 工具 | 功能 | 风险等级 | 是否需要确认 |
|---|---|---|---|
| 列出集群节点 | 🟢 低 | 否 |
| 直接创建节点 | 🟢 低 | 否 |
| 删除节点 | 🟠 高 | 是 |
| 标记节点不可调度 | 🟡 中等 | 是 |
| 标记节点可调度 | 🟡 中等 | 是 |
| 标记不可调度并驱逐节点上所有Pod | 🟠 高 | 是 |
| 查询节点调度状态 | 🟢 低 | 否 |
节点调度操作(、、、)通过kubectl cce执行——kubectl-cce插件使用AK/SK凭证连接到CCE API网关。无需集群EIP或手动配置kubeconfig。插件原生支持cordon、驱逐、PodDisruptionBudget(PDB)合规性检查以及跳过DaemonSet Pod。
cordonuncordondrainstatushuawei_cce_node_drainPodDisruptionBudgetfailed_pods注意:优先使用节点池进行托管式扩缩容。直接创建节点仅适用于特殊场景。
Addon Management
插件管理
| Tool | Function | Risk Level | Requires Confirmation |
|---|---|---|---|
| List cluster addons | 🟢 Low | No |
| Get addon details | 🟢 Low | No |
| Install addon | 🟢 Low | No |
| Uninstall addon | 🟠 High | Yes |
| Update addon | 🟡 Medium | No |
Common addons:
- - DNS service
coredns - - Monitoring metrics
metrics-server - - Storage driver
everest
Addon notes (from E2E verification):
andhuawei_get_cce_addon_detailrequire the addon UID (fromhuawei_uninstall_cce_addon→huawei_list_cce_addons), not the addon name.metadata.uid- Addon status is in the
field (e.g.,status.status,running,upgrading), notabnormal.spec.status- After
, the addon may enterhuawei_update_cce_addonstate. Wait for it to return toupgradingbefore performing subsequent operations (e.g., uninstall).running
| 工具 | 功能 | 风险等级 | 是否需要确认 |
|---|---|---|---|
| 列出集群插件 | 🟢 低 | 否 |
| 获取插件详情 | 🟢 低 | 否 |
| 安装插件 | 🟢 低 | 否 |
| 卸载插件 | 🟠 高 | 是 |
| 更新插件 | 🟡 中等 | 否 |
常用插件:
- - DNS服务
coredns - - 监控指标
metrics-server - - 存储驱动
everest
插件注意事项(来自端到端验证):
和huawei_get_cce_addon_detail需要插件UID(来自huawei_uninstall_cce_addon→huawei_list_cce_addons),而非插件名称。metadata.uid- 插件状态位于
字段(例如status.status、running、upgrading),而非abnormal。spec.status 执行后,插件可能进入huawei_update_cce_addon状态。需等待其恢复到upgrading状态后再执行后续操作(例如卸载)。running
Network Prerequisites
网络前置条件
| Tool | Function | Parameters |
|---|---|---|
| List VPCs with CIDR info | |
| List subnets with AZ info | |
| List EIPs (shows bound/unbound status) | |
| Delete an EIP (frees public IP) | |
Use these tools to find VPC/subnet IDs before cluster creation.
| 工具 | 功能 | 参数 |
|---|---|---|
| 列出包含CIDR信息的VPC | |
| 列出可用区信息的子网 | |
| 列出EIP(显示绑定/未绑定状态) | |
| 删除EIP(释放公网IP) | |
创建集群前,使用这些工具查找VPC/子网ID。
Supported Regions
支持的区域
| Region Code | Region Name |
|---|---|
| cn-north-4 | North China-Beijing 4 |
| cn-north-1 | North China-Beijing 1 |
| cn-north-2 | North China-Beijing 2 |
| cn-east-3 | East China-Shanghai 1 |
| cn-south-1 | South China-Guangzhou |
| cn-south-2 | South China-Guangzhou Friendly |
| cn-east-4 | East China II |
| cn-southwest-2 | Guiyang 1 |
| ap-southeast-1 | Asia-Pacific-Hong Kong |
| ap-southeast-2 | Asia-Pacific-Bangkok |
| ap-southeast-3 | Asia-Pacific-Singapore |
| 区域代码 | 区域名称 |
|---|---|
| cn-north-4 | 华北-北京四 |
| cn-north-1 | 华北-北京一 |
| cn-north-2 | 华北-北京二 |
| cn-east-3 | 华东-上海一 |
| cn-south-1 | 华南-广州 |
| cn-south-2 | 华南-广州友好区 |
| cn-east-4 | 华东二区 |
| cn-southwest-2 | 贵阳一 |
| ap-southeast-1 | 亚太-香港 |
| ap-southeast-2 | 亚太-曼谷 |
| ap-southeast-3 | 亚太-新加坡 |
Output Format
输出格式
All tools return JSON-formatted results containing:
- : operation result (
status/success)error - : operation-specific response (cluster info, node list, addon details, etc.)
data - : human-readable description of the result
message - : risk warning for dangerous operations (preview mode only)
warning
所有工具返回JSON格式的结果,包含:
- : 操作结果(
status/success)error - : 操作特定响应(集群信息、节点列表、插件详情等)
data - : 结果的可读描述
message - : 危险操作的风险警告(仅预览模式)
warning
Verification
验证
See verification-method.md for detailed verification steps. Quick checklist:
- (should be 7.2+)
hcloud version kubectl version --client- Verify /
HW_ACCESS_KEYenv vars are set (addHW_SECRET_KEYfor temporary credentials)HW_SECURITY_TOKEN - (connectivity test)
hcloud CCE ListClusters --cli-region=cn-north-4 - Test dangerous operation preview (call without )
confirm=true
详细验证步骤请参考verification-method.md。快速检查清单:
- (版本应为7.2+)
hcloud version kubectl version --client- 验证/
HW_ACCESS_KEY环境变量已设置(临时凭证需添加HW_SECRET_KEY)HW_SECURITY_TOKEN - (连通性测试)
hcloud CCE ListClusters --cli-region=cn-north-4 - 测试危险操作预览(调用时不传入)
confirm=true
Best Practices
最佳实践
- Use environment variables (/
HW_ACCESS_KEY) for credentials — avoid hardcoding; addHW_SECRET_KEYfor temporary credentialsHW_SECURITY_TOKEN - Always preview dangerous operations before confirming with
confirm=true - Prefer Turbo clusters () — the default — for high-performance workloads
container_network_type=eni - Omit unless the user requires a specific Kubernetes version
cluster_version - Resize node pools during low-traffic periods to minimize business impact
- Keep node pools at ≥2 nodes for production workloads to ensure redundancy
- Regularly check cluster health via
huawei_list_cce_clusters
- 使用环境变量(/
HW_ACCESS_KEY)存储凭证——避免硬编码;临时凭证添加HW_SECRET_KEYHW_SECURITY_TOKEN - 执行危险操作前始终先预览,再传入确认
confirm=true - 优先使用Turbo集群()——本技能默认值,适用于高性能工作负载
container_network_type=eni - 除非用户需要特定Kubernetes版本,否则省略参数
cluster_version - 在低流量时段调整节点池大小,以最小化对业务的影响
- 生产环境工作负载的节点池保持≥2个节点,确保冗余
- 通过定期检查集群健康状态
huawei_list_cce_clusters
References
参考文档
| Document | Description |
|---|---|
| task-cluster-management.md | Cluster lifecycle operations |
| task-nodepool-management.md | Node pool operations |
| task-node-management.md | Node scheduling operations |
| iam-policies.md | IAM permission policies |
| verification-method.md | Verification steps |
| troubleshooting.md | Troubleshooting guide |
| cce-api-guide.md | hcloud operation reference |
| cce-cluster-parameters.md | Cluster/nodepool creation parameters |
| 文档 | 描述 |
|---|---|
| task-cluster-management.md | 集群生命周期操作 |
| task-nodepool-management.md | 节点池操作 |
| task-node-management.md | 节点调度操作 |
| iam-policies.md | IAM权限策略 |
| verification-method.md | 验证步骤 |
| troubleshooting.md | 故障排查指南 |
| cce-api-guide.md | hcloud操作参考 |
| cce-cluster-parameters.md | 集群/节点池创建参数 |
Notes
注意事项
- Ensure AK/SK (and for temporary credentials) has correct IAM permissions
HW_SECURITY_TOKEN - Different regions may have different resource availability
- All dangerous operations require confirmation
- Deletion operations are irreversible
- Hibernate cluster stops all workloads - use during non-business hours
- Node drain uses natively: handles cordon + eviction + PDB compliance + DaemonSet skip automatically. Use
kubectl drainflags.--ignore-daemonsets --delete-emptydir-data - Turbo clusters recommended for best performance with ENI network
- Create cluster / create node pool use the Python SDK fallback due to a known hcloud metadata parsing defect; all other operations use hcloud CLI
- 确保AK/SK(临时凭证需包含)拥有正确的IAM权限
HW_SECURITY_TOKEN - 不同区域的资源可用性可能不同
- 所有危险操作需要确认
- 删除操作不可逆
- 休眠集群会停止所有工作负载——建议在非业务时段使用
- 节点驱逐原生使用:自动处理标记不可调度+驱逐+PDB合规性+跳过DaemonSet。使用
kubectl drain标志。--ignore-daemonsets --delete-emptydir-data - 推荐使用Turbo集群搭配ENI网络以获得最佳性能
- 创建集群/创建节点池因已知的hcloud元数据解析缺陷回退使用Python SDK;其他所有操作使用hcloud CLI