huawei-cloud-ucs-cluster-onboarding-manager
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHuawei Cloud UCS Cluster Onboarding Manager
华为云UCS集群纳管管理器
Overview
概述
This skill provides cluster onboarding, lifecycle, and fleet grouping management capabilities for Huawei Cloud UCS (Ubiquitous Cloud Native Service) using the CLI.
hcloudArchitecture: hcloud CLI → UCS Service API → Cluster/ClusterGroup/AccessConfig/KubeConfig resources
Related Skills:
- - UCS policy governance, compliance, and audit management
huawei-cloud-ucs-policy-governor
Capabilities:
- Register self-managed or CCE clusters to UCS for unified management
- Remove clusters from UCS management (deregistration)
- Query cluster details, list managed clusters
- Update cluster properties and metadata
- Create, delete, update, and query fleet groups for cluster organization
- Add/remove clusters from fleet groups (join/leave)
- Retry cluster activation
- Obtain cluster access information and kubeconfig credentials
- Download federation kubeconfig for multi-cluster access
- Check UCS resource quotas
Typical Use Cases:
- "Register my CCE cluster to UCS"
- "List all clusters managed by UCS"
- "Remove a cluster from UCS management"
- "Create a fleet group for production clusters"
- "Get kubeconfig for my UCS-managed cluster"
- "Download federation kubeconfig for multi-cluster access"
- "Check my UCS quota usage"
- "Update cluster metadata"
- "Query cluster access information"
- "Add a cluster to a fleet group"
- "Remove a cluster from a fleet group"
- "Retry cluster activation"
本技能通过 CLI为华为云UCS(Ubiquitous Cloud Native Service,无处不在的云原生服务)提供集群纳管、生命周期管理及舰队组分组管理能力。
hcloud架构:hcloud CLI → UCS服务API → Cluster/ClusterGroup/AccessConfig/KubeConfig资源
相关技能:
- - UCS策略治理、合规性及审计管理
huawei-cloud-ucs-policy-governor
功能:
- 将自管理或CCE集群注册至UCS进行统一管理
- 将集群从UCS管理中移除(注销)
- 查询集群详情、列出已纳管集群
- 更新集群属性及元数据
- 创建、删除、更新及查询用于集群组织的舰队组
- 在舰队组中添加/移除集群(加入/退出)
- 重试集群激活
- 获取集群访问信息及kubeconfig凭证
- 下载用于多集群访问的联邦kubeconfig
- 查看UCS资源配额
典型用例:
- "将我的CCE集群注册至UCS"
- "列出UCS纳管的所有集群"
- "将集群从UCS管理中移除"
- "为生产集群创建舰队组"
- "获取我的UCS纳管集群的kubeconfig"
- "下载用于多集群访问的联邦kubeconfig"
- "查看我的UCS配额使用情况"
- "更新集群元数据"
- "查询集群访问信息"
- "将集群添加至舰队组"
- "将集群从舰队组中移除"
- "重试集群激活"
Prerequisites
前置条件
1. hcloud CLI Requirements (MANDATORY)
1. hcloud CLI要求(必填)
- hcloud CLI installed (version >= 7.2.2)
- Run to verify installation
hcloud version - First-time usage: to accept privacy statement
printf "y\n" | hcloud version
- 已安装hcloud CLI(版本 >= 7.2.2)
- 运行验证安装
hcloud version - 首次使用:执行以接受隐私声明
printf "y\n" | hcloud version
2. Credential Configuration
2. 凭证配置
hcloud CLI supports two credential modes via environment variables, automatically detected at runtime:
Mode A — Long-term AK/SK (permanent access):
bash
export HUAWEI_CLOUD_AK=<your-ak>
export HUAWEI_CLOUD_SK=<your-sk>
export HUAWEI_CLOUD_REGION=cn-north-4Mode B — Temporary AK/SK + SecurityToken (recommended for temporary or delegated access):
bash
export HUAWEI_CLOUD_AK=<your-temp-ak>
export HUAWEI_CLOUD_SK=<your-temp-sk>
export HUAWEI_CLOUD_SECURITY_TOKEN=<your-security-token>
export HUAWEI_CLOUD_REGION=cn-north-4Whenis present, hcloud CLI automatically uses temporary credential authentication. When only AK/SK are set, it uses long-term credential authentication.HUAWEI_CLOUD_SECURITY_TOKEN
- Security Rules:
- 🚫 Never expose AK/SK/SecurityToken values in code, conversation, or commands
- 🚫 Never use or
echo $HUAWEI_CLOUD_AKto check credentialsecho $HUAWEI_CLOUD_SK - ✅ Use environment variables: ,
HUAWEI_CLOUD_AK,HUAWEI_CLOUD_SK,HUAWEI_CLOUD_REGIONHUAWEI_CLOUD_SECURITY_TOKEN - ✅ Prefer IAM users over root account for cloud operations
- ✅ Enable MFA for sensitive operations
⚠️ Important Security Notes:
- Never commit credentials to version control
- Use IAM users with minimal required permissions
- Enable MFA for sensitive operations
- Rotate AK/SK regularly
hcloud CLI支持通过环境变量配置两种凭证模式,运行时会自动检测:
模式A — 长期AK/SK(永久访问):
bash
export HUAWEI_CLOUD_AK=<your-ak>
export HUAWEI_CLOUD_SK=<your-sk>
export HUAWEI_CLOUD_REGION=cn-north-4模式B — 临时AK/SK + SecurityToken(推荐用于临时或委托访问):
bash
export HUAWEI_CLOUD_AK=<your-temp-ak>
export HUAWEI_CLOUD_SK=<your-temp-sk>
export HUAWEI_CLOUD_SECURITY_TOKEN=<your-security-token>
export HUAWEI_CLOUD_REGION=cn-north-4当存在时,hcloud CLI自动使用临时凭证认证;仅设置AK/SK时,使用长期凭证认证。HUAWEI_CLOUD_SECURITY_TOKEN
- 安全规则:
- 🚫 切勿在代码、对话或命令中暴露AK/SK/SecurityToken值
- 🚫 切勿使用或
echo $HUAWEI_CLOUD_AK检查凭证echo $HUAWEI_CLOUD_SK - ✅ 使用环境变量:、
HUAWEI_CLOUD_AK、HUAWEI_CLOUD_SK、HUAWEI_CLOUD_REGIONHUAWEI_CLOUD_SECURITY_TOKEN - ✅ 优先使用IAM用户而非根账户进行云操作
- ✅ 对敏感操作启用MFA
⚠️ 重要安全提示:
- 切勿将凭证提交至版本控制系统
- 使用具有最小必要权限的IAM用户
- 对敏感操作启用MFA
- 定期轮换AK/SK
3. K8s Version Compatibility (CRITICAL)
3. K8s版本兼容性(关键)
⚠️ UCS has a maximum supported Kubernetes version limit. CCE clusters created with default settings may use a version that exceeds UCS support range. Registering an unsupported version will fail with error (verified: CCE default creates v1.35, UCS supports up to v1.34 as of 2025-07). Always query the supported versions dynamically — do not hardcode version numbers, as UCS updates its support range over time:
UCS.01030012: Register cce cluster error - cce cluster version not support in UCS servicebash
hcloud UCS ListRegisteredClusterVersions --cli-region=cn-north-4Pre-registration Version Check:
bash
undefined⚠️ UCS有最大支持的Kubernetes版本限制。默认设置创建的CCE集群可能使用超出UCS支持范围的版本。注册不支持的版本会失败并返回错误(验证:截至2025-07,CCE默认创建v1.35版本,UCS最高支持v1.34)。请始终动态查询支持的版本 — 不要硬编码版本号,因为UCS会随时间更新其支持范围:
UCS.01030012: Register cce cluster error - cce cluster version not support in UCS servicebash
hcloud UCS ListRegisteredClusterVersions --cli-region=cn-north-4注册前版本检查:
bash
undefinedList unimported CCE clusters to check their versions
列出未导入的CCE集群以检查其版本
hcloud UCS ListManagedClusters --unimported=true --cli-region=cn-north-4
hcloud UCS ListManagedClusters --unimported=true --cli-region=cn-north-4
Or check specific CCE cluster version via CCE API
或通过CCE API检查特定CCE集群版本
hcloud CCE ShowCluster --clusterid=<cce-cluster-id> --cli-region=cn-north-4
If the cluster K8s version exceeds UCS support range, either:
- Downgrade the CCE cluster K8s version to within UCS support range, OR
- Wait for UCS to support the newer versionhcloud CCE ShowCluster --clusterid=<cce-cluster-id> --cli-region=cn-north-4
如果集群K8s版本超出UCS支持范围,可选择:
- 将CCE集群K8s版本降级至UCS支持范围内,或
- 等待UCS支持新版本4. IAM Permission Requirements
4. IAM权限要求
| API Action | Permission | Purpose |
|---|---|---|
| Register cluster | Register cluster to UCS |
| Delete cluster | Remove cluster from UCS |
| Get cluster | View cluster details |
| List clusters | List all managed clusters |
| Update cluster | Modify cluster properties |
| Create group | Create fleet group |
| Delete group | Remove fleet group |
| Get group | View fleet group details |
| Update group | Update fleet group description |
| Get access info | Obtain cluster access information |
| Get quota | Check UCS resource quotas |
| Create kubeconfig | Obtain cluster kubeconfig |
| Get federation | Download federation kubeconfig |
See IAM Permission Policies for complete policy JSON.
Permission Failure Handling:
- When any command fails due to permission errors, read
references/iam-policies.md - Display the required permission list and policy JSON to the user
- Guide the user to create a custom policy in the IAM console and grant authorization
- Pause execution and wait for user confirmation that permissions have been granted
| API操作 | 权限 | 用途 |
|---|---|---|
| 注册集群 | 将集群注册至UCS |
| 删除集群 | 将集群从UCS管理中移除 |
| 获取集群 | 查看集群详情 |
| 列出集群 | 列出所有已纳管集群 |
| 更新集群 | 修改集群属性 |
| 创建组 | 创建舰队组 |
| 删除组 | 移除舰队组 |
| 获取组 | 查看舰队组详情 |
| 更新组 | 更新舰队组描述 |
| 获取访问信息 | 获取集群访问信息 |
| 获取配额 | 查看UCS资源配额 |
| 创建kubeconfig | 获取集群kubeconfig |
| 获取联邦kubeconfig | 下载联邦kubeconfig |
完整的策略JSON请参见IAM权限策略。
权限失败处理:
- 当任何命令因权限错误失败时,阅读
references/iam-policies.md - 向用户显示所需权限列表及策略JSON
- 指导用户在IAM控制台创建自定义策略并授予权限
- 暂停执行并等待用户确认权限已授予
Core Commands
核心命令
1. Cluster Registration & Deregistration
1. 集群注册与注销
See Task: Cluster Registration for detailed workflows.
RegisterCluster uses Kubernetes API-style parameters (apiVersion, kind, metadata., spec.).
bash
undefined详细工作流请参见任务:集群注册。
RegisterCluster使用Kubernetes API风格的参数(apiVersion、kind、metadata.、spec.)。
bash
undefinedRegister a CCE cluster to UCS (⚠️ paid service: requires user confirmation)
将CCE集群注册至UCS(⚠️ 付费服务:需用户确认)
Confirm with user before executing — UCS cluster onboarding is a paid service, costs will be incurred
执行前请与用户确认 — UCS集群纳管是付费服务,会产生费用
hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=prod-backend-cluster --spec.category=self --spec.provider=huaweicloud --spec.type=turbo --spec.manageType=discrete --spec.country=CN --spec.city=110000 --metadata.uid=<cce-cluster-id> --spec.projectID=<project-id> --spec.region=cn-north-4 --cli-region=cn-north-4
hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=prod-backend-cluster --spec.category=self --spec.provider=huaweicloud --spec.type=turbo --spec.manageType=discrete --spec.country=CN --spec.city=110000 --metadata.uid=<cce-cluster-id> --spec.projectID=<project-id> --spec.region=cn-north-4 --cli-region=cn-north-4
Register a CCE cluster and assign to fleet group at registration
注册CCE集群并在注册时分配至舰队组
hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=prod-backend-cluster --spec.category=self --spec.provider=huaweicloud --spec.type=turbo --spec.manageType=discrete --spec.country=CN --spec.city=110000 --metadata.uid=<cce-cluster-id> --spec.projectID=<project-id> --spec.region=cn-north-4 --spec.clusterGroupID=<group-id> --cli-region=cn-north-4
hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=prod-backend-cluster --spec.category=self --spec.provider=huaweicloud --spec.type=turbo --spec.manageType=discrete --spec.country=CN --spec.city=110000 --metadata.uid=<cce-cluster-id> --spec.projectID=<project-id> --spec.region=cn-north-4 --spec.clusterGroupID=<group-id> --cli-region=cn-north-4
Register a self-managed/attached cluster
注册自管理/附加集群
hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=datacenter-k8s --spec.category=onpremise --spec.provider=self_managed --spec.type=Kubernetes --spec.manageType=discrete --spec.country=CN --spec.city=110000 --metadata.annotations.kubeconfig=<kubeconfig-yaml-content> --cli-region=cn-north-4
hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=datacenter-k8s --spec.category=onpremise --spec.provider=self_managed --spec.type=Kubernetes --spec.manageType=discrete --spec.country=CN --spec.city=110000 --metadata.annotations.kubeconfig=<kubeconfig-yaml-content> --cli-region=cn-north-4
Retry cluster activation (if registration stuck)
重试集群激活(若注册卡住)
hcloud UCS RetryClusterActivation --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
hcloud UCS RetryClusterActivation --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
Remove a cluster from UCS (⚠️ destructive: requires user confirmation)
将集群从UCS中移除(⚠️ 破坏性操作:需用户确认)
Confirm with user before executing — deregistration is irreversible
执行前请与用户确认 — 注销操作不可逆转
hcloud UCS DeleteCluster --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
**Cluster Categories (spec.category)**:
- `self`: Huawei Cloud CCE (Cloud Container Engine) managed cluster
- UCS directly accesses CCE API via internal network — **no proxy-agent needed**
- Use CCE API `CreateKubernetesClusterCert` to obtain kubeconfig (NOT UCS `CreateClusterKubeconfig`)
- `ShowClusterAccessInfo` returns `UCS.01030011` — **NOT supported** for this category
- `RetryClusterActivation` returns `UCS.01000011` — **NOT supported** for this category
- Note: CCE cluster `spec.category` is `Turbo`, but UCS `ListManagedClusters` returns `category=self`, `type=turbo`
- `onpremise`: Self-managed or third-party Kubernetes cluster
- Requires deploying proxy-agent to establish tunnel between cluster and UCS
- Use `ShowClusterAccessInfo` to obtain proxy-agent configuration, then deploy proxy-agent
- Use `CreateClusterKubeconfig` to obtain kubeconfig after proxy-agent is running
**Kubeconfig Retrieval Decision Tree** (verified via API testing):Need cluster kubeconfig?
├── category=self (CCE cluster)
│ └── CCE CreateKubernetesClusterCert --cluster_id=<cce-cluster-id> --duration=30
│ (CCE API, NOT UCS CreateClusterKubeconfig which returns internal error)
└── category=onpremise (self-managed cluster)
├── Step 1: ShowClusterAccessInfo --clusterid=<ucs-cluster-id>
│ (obtain proxy-agent configuration — only for onpremise, returns UCS.01030011 for CCE)
├── Step 2: Deploy proxy-agent in the cluster
└── Step 3: CreateClusterKubeconfig --clusterid=<ucs-cluster-id>
(obtain kubeconfig after tunnel established)
**Cluster Providers (spec.provider)**:
- `huaweicloud`: Huawei Cloud managed CCE cluster
- `self_managed`: Self-managed Kubernetes cluster
**Manage Types (spec.manageType)**:
- `grouped`: Cluster managed within a fleet group
- `discrete`: Cluster managed independentlyhcloud UCS DeleteCluster --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
**集群分类(spec.category)**:
- `self`: 华为云CCE(云容器引擎)托管集群
- UCS通过内网直接访问CCE API — **无需代理-agent**
- 使用CCE API `CreateKubernetesClusterCert`获取kubeconfig(而非UCS `CreateClusterKubeconfig`)
- `ShowClusterAccessInfo`返回`UCS.01030011` — **不支持**此分类
- `RetryClusterActivation`返回`UCS.01000011` — **不支持**此分类
- 注意:CCE集群的`spec.category`为`Turbo`,但UCS `ListManagedClusters`返回`category=self`、`type=turbo`
- `onpremise`: 自管理或第三方Kubernetes集群
- 需要部署proxy-agent以建立集群与UCS之间的隧道
- 使用`ShowClusterAccessInfo`获取proxy-agent配置,然后部署proxy-agent
- proxy-agent运行后,使用`CreateClusterKubeconfig`获取kubeconfig
**Kubeconfig获取决策树**(经API测试验证):需要集群kubeconfig?
├── category=self(CCE集群)
│ └── CCE CreateKubernetesClusterCert --cluster_id=<cce-cluster-id> --duration=30
│ (CCE API,而非返回内部错误的UCS CreateClusterKubeconfig)
└── category=onpremise(自管理集群)
├── 步骤1: ShowClusterAccessInfo --clusterid=<ucs-cluster-id>
│ (获取proxy-agent配置 — 仅适用于onpremise,对CCE返回UCS.01030011)
├── 步骤2: 在集群中部署proxy-agent
└── 步骤3: CreateClusterKubeconfig --clusterid=<ucs-cluster-id>
(隧道建立后获取kubeconfig)
**集群提供商(spec.provider)**:
- `huaweicloud`: 华为云托管CCE集群
- `self_managed`: 自管理Kubernetes集群
**管理类型(spec.manageType)**:
- `grouped`: 在舰队组内管理的集群
- `discrete`: 独立管理的集群2. Cluster Query & Lifecycle
2. 集群查询与生命周期
bash
undefinedbash
undefinedShow cluster details
查看集群详情
hcloud UCS ShowCluster --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
hcloud UCS ShowCluster --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
List managed clusters (with pagination)
列出已纳管集群(带分页)
hcloud UCS ShowClusterList --limit=20 --offset=0 --cli-region=cn-north-4
hcloud UCS ShowClusterList --limit=20 --offset=0 --cli-region=cn-north-4
List managed clusters with filters
带筛选条件列出已纳管集群
hcloud UCS ShowClusterList --category=CCE --enablestatus=Available --clustergroupid=<group-id> --cli-region=cn-north-4
hcloud UCS ShowClusterList --category=CCE --enablestatus=Available --clustergroupid=<group-id> --cli-region=cn-north-4
List all managed clusters (with optional unimported flag)
列出所有已纳管集群(可选未导入标记)
⚠️ Prerequisite: ListManagedClusters requires IAM agency delegation configured at account level.
⚠️ 前提条件:ListManagedClusters需要在账户级别配置IAM委托。
If not configured, returns UCS.01010005: get IAM agency's token error.
若未配置,返回UCS.01010005: get IAM agency's token error。
See references/common-pitfalls.md Pitfall 20 for IAM agency setup instructions.
请参见references/common-pitfalls.md中的陷阱20获取IAM委托设置说明。
hcloud UCS ListManagedClusters --cli-region=cn-north-4
hcloud UCS ListManagedClusters --unimported=true --cli-region=cn-north-4
hcloud UCS ListManagedClusters --cli-region=cn-north-4
hcloud UCS ListManagedClusters --unimported=true --cli-region=cn-north-4
Update cluster properties (K8s API-style params) (⚠️ modification: requires user confirmation)
更新集群属性(K8s API风格参数)(⚠️ 修改操作:需用户确认)
Confirm with user before executing
执行前请与用户确认
hcloud UCS UpdateCluster --clusterid=<ucs-cluster-id> --apiVersion=v1 --kind=Cluster --spec.city=310000 --spec.country=CN --cli-region=cn-north-4
hcloud UCS UpdateCluster --clusterid=<ucs-cluster-id> --apiVersion=v1 --kind=Cluster --spec.city=310000 --spec.country=CN --cli-region=cn-north-4
Show cluster access information (only for category=onpremise clusters)
查看集群访问信息(仅适用于category=onpremise集群)
hcloud UCS ShowClusterAccessInfo --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
hcloud UCS ShowClusterAccessInfo --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
Show cluster access information with optional filters (only for category=onpremise clusters)
带可选筛选条件查看集群访问信息(仅适用于category=onpremise集群)
hcloud UCS ShowClusterAccessInfo --clusterid=<ucs-cluster-id> --region=cn-north-4 --vpcendpoint=<vpc-id> --cli-region=cn-north-4
> ⚠️ **ShowClusterAccessInfo only applies to `category=onpremise` clusters.** For `category=self` (CCE) clusters, it returns `UCS.01030011: Cluster category not supported` (verified). For CCE cluster kubeconfig, use CCE API `CreateKubernetesClusterCert` instead of UCS `CreateClusterKubeconfig`.
**ShowClusterList Valid Filter Parameters**:
- `--category`: Filter by cluster category (self, onpremise)
- `--clustergroupid`: Filter by fleet group ID
- `--clusterids`: Filter by specific cluster IDs
- `--enablestatus`: Filter by cluster status (Available, Unavailable)
- `--managetype`: Filter by manage type (grouped, discrete)
- `--limit`: Pagination limit
- `--offset`: Pagination offset
- `--order`: Sort order (asc, desc)
- `--order_by`: Sort field
> ⚠️ **`--name` filter is NOT supported** by ShowClusterList API. To find a cluster by name, call `ShowClusterList` without name filter and match by `metadata.name` in the response locally.hcloud UCS ShowClusterAccessInfo --clusterid=<ucs-cluster-id> --region=cn-north-4 --vpcendpoint=<vpc-id> --cli-region=cn-north-4
> ⚠️ **ShowClusterAccessInfo仅适用于`category=onpremise`集群**。对于`category=self`(CCE)集群,它会返回`UCS.01030011: Cluster category not supported`(已验证)。获取CCE集群的kubeconfig,请使用CCE API `CreateKubernetesClusterCert`而非UCS `CreateClusterKubeconfig`。
**ShowClusterList有效筛选参数**:
- `--category`: 按集群分类筛选(self、onpremise)
- `--clustergroupid`: 按舰队组ID筛选
- `--clusterids`: 按特定集群ID筛选
- `--enablestatus`: 按集群状态筛选(Available、Unavailable)
- `--managetype`: 按管理类型筛选(grouped、discrete)
- `--limit`: 分页限制
- `--offset`: 分页偏移量
- `--order`: 排序顺序(asc、desc)
- `--order_by`: 排序字段
> ⚠️ **`--name`筛选参数不受ShowClusterList API支持**。要按名称查找集群,请调用不带名称筛选的`ShowClusterList`,然后在响应中本地匹配`metadata.name`。3. Fleet Group Management
3. 舰队组管理
See Task: Fleet Management for detailed workflows.
bash
undefined详细工作流请参见任务:舰队管理。
bash
undefinedCreate a fleet group
创建舰队组
hcloud UCS RegisterClusterGroup --metadata.name=production-fleet --spec.description="All production clusters" --spec.clusterIds.1=<cluster-id-1> --cli-region=cn-north-4
hcloud UCS RegisterClusterGroup --metadata.name=production-fleet --spec.description="All production clusters" --spec.clusterIds.1=<cluster-id-1> --cli-region=cn-north-4
List all fleet groups
列出所有舰队组
hcloud UCS ListClusterGroup --limit=20 --offset=0 --cli-region=cn-north-4
hcloud UCS ListClusterGroup --limit=20 --offset=0 --cli-region=cn-north-4
Show fleet group details
查看舰队组详情
hcloud UCS ShowClusterGroup --clustergroupid=<group-id> --cli-region=cn-north-4
hcloud UCS ShowClusterGroup --clustergroupid=<group-id> --cli-region=cn-north-4
Update fleet group description (⚠️ modification: requires user confirmation)
更新舰队组描述(⚠️ 修改操作:需用户确认)
Confirm with user before executing
执行前请与用户确认
hcloud UCS UpdateClusterGroup --clustergroupid=<group-id> --description="Updated fleet description" --cli-region=cn-north-4
hcloud UCS UpdateClusterGroup --clustergroupid=<group-id> --description="Updated fleet description" --cli-region=cn-north-4
Add clusters to fleet group (⚠️ modification: requires user confirmation)
向舰队组添加集群(⚠️ 修改操作:需用户确认)
Confirm with user before executing
执行前请与用户确认
hcloud UCS UpdateClusterGroupAssociatedClusters --clustergroupid=<group-id> --clusterIds.1=<cluster-id-1> --clusterIds.2=<cluster-id-2> --cli-region=cn-north-4
hcloud UCS UpdateClusterGroupAssociatedClusters --clustergroupid=<group-id> --clusterIds.1=<cluster-id-1> --clusterIds.2=<cluster-id-2> --cli-region=cn-north-4
Add a single cluster to fleet group (join)
将单个集群添加至舰队组(加入)
hcloud UCS JoinGroup --clusterid=<ucs-cluster-id> --clusterGroupID=<group-id> --cli-region=cn-north-4
hcloud UCS JoinGroup --clusterid=<ucs-cluster-id> --clusterGroupID=<group-id> --cli-region=cn-north-4
Remove a cluster from fleet group (leave)
将集群从舰队组中移除(退出)
hcloud UCS LeaveGroup --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
hcloud UCS LeaveGroup --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
Delete a fleet group (⚠️ destructive: requires user confirmation)
删除舰队组(⚠️ 破坏性操作:需用户确认)
Confirm with user before executing — deletion removes the group but clusters remain registered
执行前请与用户确认 — 删除操作会移除组,但集群仍保持注册状态
hcloud UCS DeleteClusterGroup --clustergroupid=<group-id> --cli-region=cn-north-4
undefinedhcloud UCS DeleteClusterGroup --clustergroupid=<group-id> --cli-region=cn-north-4
undefined4. Kubeconfig & Access Management
4. Kubeconfig与访问管理
See Task: Access Management for detailed workflows.
bash
undefined详细工作流请参见任务:访问管理。
bash
undefinedGet kubeconfig for a specific cluster (⚠️ only for category=onpremise clusters)
获取特定集群的kubeconfig(⚠️ 仅适用于category=onpremise集群)
For category=self (CCE) clusters, use: hcloud CCE CreateKubernetesClusterCert --cluster_id=<cce-id> --duration=30 --cli-region=cn-north-4
对于category=self(CCE)集群,请使用:hcloud CCE CreateKubernetesClusterCert --cluster_id=<cce-id> --duration=30 --cli-region=cn-north-4
hcloud UCS CreateClusterKubeconfig --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
hcloud UCS CreateClusterKubeconfig --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
Create cluster configuration
创建集群配置
hcloud UCS CreateClusterConf --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
hcloud UCS CreateClusterConf --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
Download federation kubeconfig (for multi-cluster access)
下载联邦kubeconfig(用于多集群访问)
hcloud UCS DownloadFederationKubeconfig --clustergroupid=<group-id> --duration=3600 --cli-region=cn-north-4
**DownloadFederationKubeconfig Required Parameters**:
- `--clustergroupid`: Fleet group ID (required path parameter)
- `--duration`: Token validity duration in seconds (required integer body parameter)hcloud UCS DownloadFederationKubeconfig --clustergroupid=<group-id> --duration=3600 --cli-region=cn-north-4
**DownloadFederationKubeconfig必填参数**:
- `--clustergroupid`: 舰队组ID(必填路径参数)
- `--duration`: Token有效期(秒,必填整数请求体参数)5. Quota Management
5. 配额管理
bash
undefinedbash
undefinedShow UCS resource quotas (domainid is required - account ID)
查看UCS资源配额(domainid为必填项 - 账户ID)
hcloud UCS ShowQuota --domainid=<account-id> --cli-region=cn-north-4
undefinedhcloud UCS ShowQuota --domainid=<account-id> --cli-region=cn-north-4
undefined参数确认
参数确认
⚠️ Cost Notice: UCS cluster onboarding is a paid service. Registering a cluster to UCS incurs costs. Before executingor other onboarding operations, you must confirm with the user whether they agree to incur costs and obtain explicit consent before proceeding.RegisterCluster
⚠️ 费用说明:UCS集群纳管是一项付费服务。将集群注册至UCS会产生费用。执行或其他纳管操作前,必须与用户确认是否同意产生费用,并在获得明确同意后再继续。RegisterCluster
Common Parameters
通用参数
| Parameter | Required/Optional | Description | Default |
|---|---|---|---|
| Required | Huawei Cloud region ID | Config value or |
| Context-dependent | UCS cluster ID | N/A |
| Context-dependent | Fleet group ID | N/A |
| 参数 | 必填/可选 | 描述 | 默认值 |
|---|---|---|---|
| 必填 | 华为云区域ID | 配置值或 |
| 视上下文而定 | UCS集群ID | N/A |
| 视上下文而定 | 舰队组ID | N/A |
Cluster Registration Parameters (K8s API Style)
集群注册参数(K8s API风格)
| Parameter | Required | Description | Constraints |
|---|---|---|---|
| Yes | Cluster category | |
| Yes | Cluster provider | |
| Yes | Cluster type | |
| Yes | Management type | |
| CCE only | CCE cluster ID | Must reference existing CCE cluster |
| CCE only | Project ID | Obtain via |
| No | Assign to fleet at registration | Valid fleet group ID |
| 参数 | 必填 | 描述 | 约束条件 |
|---|---|---|---|
| 是 | 集群分类 | |
| 是 | 集群提供商 | |
| 是 | 集群类型 | |
| 是 | 管理类型 | |
| 仅CCE集群需要 | CCE集群ID | 必须引用已存在的CCE集群 |
| 仅CCE集群需要 | 项目ID | 从 |
| 否 | 注册时分配至舰队组 | 有效的舰队组ID |
Write Operations (User Confirmation Required)
写入操作(需用户确认)
| Operation | CLI Command | Risk Level | Confirmation Required |
|---|---|---|---|
| | High | UCS onboarding is a paid service; after registration, the cluster will be subject to UCS policy governance constraints. Confirm cluster name, category, and billing consent. |
| | High | Deregistration is irreversible; the cluster loses all UCS management capabilities, policy governance, and fleet association. Confirm cluster ID before proceeding. |
| | Medium | Modifies cluster properties (e.g., location, labels). Confirm the changes before proceeding. |
| | Medium | Creates a new fleet group for cluster organization. Confirm group name and description. |
| | High | Deletes the fleet group; clusters remain registered but lose group-level governance and federation access. Confirm group ID before proceeding. |
| | Medium | Modifies fleet group description. Confirm the new description. |
| | Medium | Joining a fleet group affects the cluster's governance scope and policy execution. Confirm cluster ID and target group ID. |
| | Medium | Leaving a fleet group affects the cluster's governance scope and policy execution; the cluster will no longer be governed by group-level policies. Confirm cluster ID. |
See Parameter Reference for complete parameter tables.
| 操作 | CLI命令 | 风险等级 | 确认要求 |
|---|---|---|---|
| | 高 | UCS纳管是付费服务;注册后,集群将受UCS策略治理约束。确认集群名称、分类及计费同意。 |
| | 高 | 注销操作不可逆转;集群将失去所有UCS管理能力、策略治理及舰队关联。执行前确认集群ID。 |
| | 中 | 修改集群属性(如位置、标签)。执行前确认修改内容。 |
| | 中 | 创建用于集群组织的新舰队组。确认组名称及描述。 |
| | 高 | 删除舰队组;集群仍保持注册状态,但失去组级治理及联邦访问权限。执行前确认组ID。 |
| | 中 | 修改舰队组描述。确认新描述内容。 |
| | 中 | 加入舰队组会影响集群的治理范围及策略执行。确认集群ID及目标组ID。 |
| | 中 | 退出舰队组会影响集群的治理范围及策略执行;集群将不再受组级策略治理。确认集群ID。 |
完整参数表请参见参数参考。
Output Format
输出格式
See Output Format for detailed response format examples (ShowCluster, ShowClusterList, ShowQuota).
Key Fields Summary:
- ShowCluster: (UUID),
metadata.uid(onpremise/self),spec.category(Failed/Available)status.phase - ShowClusterList: (k8s-style array),
items[](count)total - ShowQuota: with
quotas.resources[]/type/quota/used/minmax
详细响应格式示例(ShowCluster、ShowClusterList、ShowQuota)请参见输出格式。
关键字段摘要:
- ShowCluster: (UUID)、
metadata.uid(onpremise/self)、spec.category(Failed/Available)status.phase - ShowClusterList: (k8s风格数组)、
items[](数量)total - ShowQuota: 包含
quotas.resources[]/type/quota/used/minmax
Verification
验证
See Verification Method for step-by-step verification.
分步验证方法请参见验证方法。
Best Practices
最佳实践
- Cluster Naming: Use descriptive names that reflect cluster purpose and environment (e.g., ,
prod-app-backend) viastaging-data-pipeline--metadata.name - Fleet Grouping: Organize clusters by environment (production/staging/development) or business domain for unified governance
- Kubeconfig Security: Store kubeconfig files securely; never expose them in public repositories or CI logs
- Deregistration Caution: Removing a cluster from UCS disables all policy governance and federation access for that cluster
- Self-Managed Registration: Ensure the self-managed cluster kubeconfig is valid and the cluster API server is reachable; pass it via
--metadata.annotations.kubeconfig - Quota Monitoring: Check quotas before registering new clusters to avoid hitting limits
- Federation Kubeconfig Duration: Choose appropriate for federation kubeconfig tokens based on usage patterns
--duration
- 集群命名: 使用描述性名称反映集群用途及环境(如、
prod-app-backend),通过staging-data-pipeline设置--metadata.name - 舰队组分组: 按环境(生产/预发布/开发)或业务领域组织集群,以实现统一治理
- Kubeconfig安全: 安全存储kubeconfig文件;切勿在公共仓库或CI日志中暴露
- 注销注意事项: 将集群从UCS移除会禁用该集群的所有策略治理及联邦访问能力
- 自管理集群注册: 确保自管理集群的kubeconfig有效且集群API服务器可访问;通过传递
--metadata.annotations.kubeconfig - 配额监控: 注册新集群前检查配额,避免超出限制
- 联邦Kubeconfig有效期: 根据使用模式为联邦kubeconfig令牌选择合适的
--duration
Workflow
工作流
The skill workflow is as follows:
- Environment Check — Verify hcloud CLI is installed and AK/SK credentials are configured (see CLI Installation Guide)
- Version Compatibility Check — Call to get the list of K8s versions supported by UCS, and confirm the target cluster version is in the list
ListRegisteredClusterVersions - Cluster Registration — Choose registration method based on cluster type:
- CCE cluster:
--spec.category=self --spec.provider=huaweicloud --spec.type=turbo - Self-managed cluster: (requires kubeconfig)
--spec.category=onpremise --spec.provider=self_managed
- CCE cluster:
- Registration Verification — Call or
ShowClusterto confirm cluster status isShowClusterListAvailable - Cluster Management (optional):
- Fleet grouping: /
RegisterClusterGroup/JoinGroupLeaveGroup - Access management: CCE clusters use , third-party clusters use
CreateKubernetesClusterCert+ proxy-agentShowClusterAccessInfo - Property update: (requires user confirmation)
UpdateCluster
- Fleet grouping:
- Deregister Cluster (optional) — (⚠️ irreversible operation, requires user confirmation)
DeleteCluster
本技能的工作流如下:
- 环境检查 — 验证hcloud CLI已安装且AK/SK凭证已配置(参见CLI安装指南)
- 版本兼容性检查 — 调用获取UCS支持的K8s版本列表,并确认目标集群版本在列表中
ListRegisteredClusterVersions - 集群注册 — 根据集群类型选择注册方式:
- CCE集群:
--spec.category=self --spec.provider=huaweicloud --spec.type=turbo - 自管理集群: (需要kubeconfig)
--spec.category=onpremise --spec.provider=self_managed
- CCE集群:
- 注册验证 — 调用或
ShowCluster确认集群状态为ShowClusterListAvailable - 集群管理(可选):
- 舰队分组: /
RegisterClusterGroup/JoinGroupLeaveGroup - 访问管理: CCE集群使用,第三方集群使用
CreateKubernetesClusterCert+ proxy-agentShowClusterAccessInfo - 属性更新: (需用户确认)
UpdateCluster
- 舰队分组:
- 注销集群(可选) — (⚠️ 不可逆转操作,需用户确认)
DeleteCluster
KooCLI Command Format Standard
KooCLI命令格式规范
All operations use format. See KooCLI Command Format for detailed examples and parameter naming rules.
hcloud UCS <Operation> --<param>=<value> --cli-region=<region>所有操作使用格式。详细示例及参数命名规则请参见KooCLI命令格式。
hcloud UCS <Operation> --<param>=<value> --cli-region=<region>Reference Documents
参考文档
| Document | Description |
|---|---|
| UCS Cluster Onboarding API Guide | hcloud UCS API reference |
| Output Format | Response format examples (verified) |
| IAM Permission Policies | Required permissions and policy JSON |
| Verification Method | Step-by-step verification |
| Common Pitfalls | Troubleshooting guides |
| Task: Cluster Registration | Registration and deregistration workflows |
| Task: Fleet Management | Fleet group workflows |
| Task: Access Management | Kubeconfig and access control workflows |
| CLI Installation Guide | hcloud CLI installation and configuration |
| Parameter Reference | Complete parameter tables for all operations |
| KooCLI Command Format | Command format standard and examples |
| Acceptance Criteria | Skill acceptance criteria and test checklist |
| 文档 | 描述 |
|---|---|
| UCS集群纳管API指南 | hcloud UCS API参考 |
| 输出格式 | 响应格式示例(已验证) |
| IAM权限策略 | 所需权限及策略JSON |
| 验证方法 | 分步验证方法 |
| 常见陷阱 | 故障排除指南 |
| 任务:集群注册 | 注册与注销工作流 |
| 任务:舰队管理 | 舰队组工作流 |
| 任务:访问管理 | Kubeconfig及访问控制工作流 |
| CLI安装指南 | hcloud CLI安装与配置 |
| 参数参考 | 所有操作的完整参数表 |
| KooCLI命令格式 | 命令格式规范及示例 |
| 验收标准 | 技能验收标准及测试检查表 |
Notes
注意事项
- K8s version compatibility — UCS has a maximum supported K8s version that updates over time. CCE default cluster version may exceed this limit. Query supported versions with and verify cluster version is in the list before registration.
hcloud UCS ListRegisteredClusterVersions - Cluster deregistration is irreversible — the cluster loses all UCS management capabilities
- Self-managed cluster kubeconfig must be valid — invalid kubeconfig will cause registration failure; pass via
--metadata.annotations.kubeconfig - AK/SK must never be hardcoded — credentials should only be obtained via environment variables
- hcloud CLI is the only supported method — all operations use format
hcloud UCS <Operation> - Federation kubeconfig requires fleet group ID and duration — both and
--clustergroupidare required--duration - RegisterCluster uses K8s API-style parameters — not flat params like --name/--cluster_type; note: uses
spec.category/self(notonpremise/CCE),AttachedClusterusesspec.provider(nothuaweicloud),huawei_clouduses lowercasespec.type(notcce),CCEuses city codes likespec.city(not city names like110000)Beijing - ShowQuota requires domainid — the account/domain ID is a required path parameter
- K8s版本兼容性 — UCS有最大支持的K8s版本,且会随时间更新。CCE默认集群版本可能超出此限制。注册前调用查询支持的版本并验证集群版本是否在列表中。
hcloud UCS ListRegisteredClusterVersions - 集群注销不可逆转 — 集群将失去所有UCS管理能力
- 自管理集群kubeconfig必须有效 — 无效的kubeconfig会导致注册失败;通过传递
--metadata.annotations.kubeconfig - AK/SK切勿硬编码 — 凭证应仅通过环境变量获取
- 仅支持hcloud CLI方法 — 所有操作使用格式
hcloud UCS <Operation> - 联邦kubeconfig需要舰队组ID和有效期 — 和
--clustergroupid均为必填项--duration - RegisterCluster使用K8s API风格参数 — 不是这类扁平参数;注意:
--name/--cluster_type使用spec.category/self(而非onpremise/CCE),AttachedCluster使用spec.provider(而非huaweicloud),huawei_cloud使用小写spec.type(而非cce),CCE使用城市代码如spec.city(而非城市名称如110000)Beijing - ShowQuota需要domainid — 账户/域ID是必填路径参数
Common Pitfalls
常见陷阱
See Common Pitfalls & Solutions for detailed troubleshooting guides.
详细故障排除指南请参见常见陷阱与解决方案。