This skill provides cluster onboarding, lifecycle, and fleet grouping management capabilities for Huawei Cloud UCS (Universal Cloud Service) using the hcloud CLI.
Architecture: hcloud CLI → UCS Service API → Cluster/ClusterGroup/AccessConfig/KubeConfig resources
Related Skills:
ucs-policy-governor - UCS policy governance, compliance, and audit managementCapabilities:
Typical Use Cases:
hcloud version to verify installationprintf "y\n" | hcloud version to accept privacy statementValid Huawei Cloud credentials (AK/SK mode)
Security Rules:
echo $HUAWEI_CLOUD_AK or echo $HUAWEI_CLOUD_SK to check credentialsHUAWEI_CLOUD_AK, HUAWEI_CLOUD_SK, HUAWEI_CLOUD_REGIONConfiguration Method (Environment Variables Only):
bash
export HUAWEI_CLOUD_AK=<your-ak>
export HUAWEI_CLOUD_SK=<your-sk>
export HUAWEI_CLOUD_REGION=cn-north-4
⚠️ Important Security Notes:
API ActionPermissionPurposeucs:cluster:createRegister clusterRegister cluster to UCSucs:cluster:deleteDelete clusterRemove cluster from UCSucs:cluster:getGet clusterView cluster detailsucs:cluster:listList clustersList all managed clustersucs:cluster:updateUpdate clusterModify cluster propertiesucs:clusterGroup:createCreate groupCreate fleet groupucs:clusterGroup:deleteDelete groupRemove fleet groupucs:clusterGroup:getGet groupView fleet group detailsucs:clusterGroup:updateUpdate groupUpdate fleet group descriptionucs:clusterAccess:getGet access infoObtain cluster access informationucs:quota:getGet quotaCheck UCS resource quotasucs:kubeconfig:createCreate kubeconfigObtain cluster kubeconfigucs:federationKubeconfig:getGet federationDownload federation kubeconfig
See IAM Permission Policies for complete policy JSON.
Permission Failure Handling:
references/iam-policies.mdSee Task: Cluster Registration for detailed workflows.
RegisterCluster uses Kubernetes API-style parameters (apiVersion, kind, metadata. , spec.).
bash
# Register a CCE cluster to UCS
hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=prod-backend-cluster --spec.category=self --spec.provider=huaweicloud --spec.type=cce --spec.manageType=grouped --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
hcloud UCS RegisterCluster --apiVersion=v1 --kind=Cluster --metadata.name=prod-backend-cluster --spec.category=self --spec.provider=huaweicloud --spec.type=cce --spec.manageType=grouped --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
# Retry cluster activation (if registration stuck)
hcloud UCS RetryClusterActivation --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
# Remove a cluster from UCS
hcloud UCS DeleteCluster --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
Cluster Categories (spec.category):
self: Huawei Cloud CCE (Cloud Container Engine) managed clusteronpremise: Self-managed or third-party Kubernetes clusterCluster Providers (spec.provider):
huaweicloud: Huawei Cloud managed CCE clusterself_managed: Self-managed Kubernetes clusterManage Types (spec.manageType):
grouped: Cluster managed within a fleet groupdiscrete: Cluster managed independentlybash
# Show cluster details
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
# List managed clusters with filters
hcloud UCS ShowClusterList --category=CCE --enablestatus=Available --clustergroupid=<group-id> --cli-region=cn-north-4
# List all managed clusters (with optional unimported flag)
hcloud UCS ListManagedClusters --cli-region=cn-north-4
hcloud UCS ListManagedClusters --unimported --cli-region=cn-north-4
# Update cluster properties (K8s API-style params)
hcloud UCS UpdateCluster --clusterid=<ucs-cluster-id> --apiVersion=v1 --kind=Cluster --spec.city=Shanghai --spec.country=CN --cli-region=cn-north-4
# Show cluster access information
hcloud UCS ShowClusterAccessInfo --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
# Show cluster access information with optional filters
hcloud UCS ShowClusterAccessInfo --clusterid=<ucs-cluster-id> --region=cn-north-4 --vpcendpoint=<vpc-id> --cli-region=cn-north-4
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 fieldSee Task: Fleet Management for detailed workflows.
bash
# Create 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
# List all fleet groups
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
# Update fleet group description
hcloud UCS UpdateClusterGroup --clustergroupid=<group-id> --description="Updated fleet description" --cli-region=cn-north-4
# Add clusters to fleet group
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
# Remove a cluster from fleet group (leave)
hcloud UCS LeaveGroup --clusterid=<ucs-cluster-id> --cli-region=cn-north-4
# Delete a fleet group
hcloud UCS DeleteClusterGroup --clustergroupid=<group-id> --cli-region=cn-north-4
See Task: Access Management for detailed workflows.
bash
# Get kubeconfig for a specific cluster
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
# Download federation kubeconfig (for multi-cluster access)
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)bash
# Show UCS resource quotas (domainid is required - account ID)
hcloud UCS ShowQuota --domainid=<account-id> --cli-region=cn-north-4
ParameterRequired/OptionalDescriptionDefault--cli-regionRequiredHuawei Cloud region IDConfig value or HUAWEI_CLOUD_REGION``--clusteridContext-dependentUCS cluster IDN/A--clustergroupidContext-dependentFleet group IDN/A
ParameterRequiredDescriptionConstraints--apiVersionYesAPI version (always v1)Must be v1``--kindYesResource kind (always Cluster)Must be Cluster``--metadata.nameYesCluster display name1-128 chars--spec.categoryYesCluster categoryself or onpremise``--spec.providerYesCluster providerhuaweicloud or self_managed``--spec.typeYesCluster typecce, baremetal, Kubernetes, etc.--spec.manageTypeYesManagement typegrouped or discrete``--spec.countryYesCountry codeCountry code (e.g., CN)--spec.cityYesCity codeCity code (e.g., 110000 for Beijing)--metadata.uidCCE onlyCCE cluster IDMust reference existing CCE cluster--spec.projectIDCCE onlyProject IDValid Huawei Cloud project ID--spec.regionCCE onlyCCE cluster regionMust match CCE cluster region--metadata.annotations.kubeconfigSelf-managed onlyKubeconfig contentValid Kubernetes kubeconfig YAML--spec.clusterGroupIDNoAssign to fleet at registrationValid fleet group ID--metadata.labels.*NoCustom labelsKey-value pairs
ParameterRequiredDescriptionConstraints--clusteridYesUCS cluster ID (path param)Must be registered cluster--apiVersionYesAPI version (always v1)Must be v1``--kindYesResource kind (always Cluster)Must be Cluster``--spec.cityNoUpdate cityCity name--spec.countryNoUpdate countryCountry code--metadata.annotationsNoUpdate annotationsKey-value pairs--spec.workerConfig.replicasNoUpdate worker replicasInteger--spec.workerConfig.strategy.*NoUpdate worker strategyK8s deployment strategy fields
ParameterRequiredDescriptionConstraints--metadata.nameYes (create)Group display name1-128 chars--spec.descriptionNo (create)Group descriptionFree text--spec.clusterIds.NNo (create)Initial cluster IDsIndexed (1, 2, 3...)--clustergroupidYes (get/delete/update)Group IDUUID format--descriptionYes (UpdateClusterGroup)New descriptionFree text--clusterIds.NYes (UpdateClusterGroupAssociatedClusters)Cluster IDs to addIndexed
ParameterRequiredDescriptionConstraints--clusteridYesUCS cluster ID (path)Must be registered cluster--clusterGroupIDYes (JoinGroup)Fleet group ID (body)Valid fleet group ID
ParameterRequiredDescriptionConstraints--clusteridYesUCS cluster IDMust be registered cluster--clustergroupidYes (DownloadFederationKubeconfig)Fleet group IDValid fleet group ID--durationYes (DownloadFederationKubeconfig)Token duration in secondsInteger
ParameterRequiredDescriptionConstraints--domainidYesAccount IDHuawei Cloud account/domain ID
ParameterRequired/OptionalDescription--categoryOptionalFilter by cluster category--clustergroupidOptionalFilter by fleet group ID--clusteridsOptionalFilter by specific cluster IDs--enablestatusOptionalFilter by cluster status--managetypeOptionalFilter by manage type--limitOptionalPagination limit--offsetOptionalPagination offset--orderOptionalSort order (asc/desc)--order_byOptionalSort field
See Output Format for detailed response format examples (ShowCluster, ShowClusterList, ShowQuota).
Key Fields Summary:
metadata.uid (UUID), spec.category (onpremise/self), status.phase (Failed/Available)items[] (k8s-style array), total (count)quotas.resources[] with type/ quota/ used/ min/ maxSee Verification Method for step-by-step verification.
prod-app-backend, staging-data-pipeline) via --metadata.name--metadata.annotations.kubeconfig--duration for federation kubeconfig tokens based on usage patternsDocumentDescriptionUCS Cluster Onboarding API Guidehcloud UCS API referenceOutput FormatResponse format examples (verified)IAM Permission PoliciesRequired permissions and policy JSONVerification MethodStep-by-step verificationCommon PitfallsTroubleshooting guidesTask: Cluster RegistrationRegistration and deregistration workflowsTask: Fleet ManagementFleet group workflowsTask: Access ManagementKubeconfig and access control workflows
--metadata.annotations.kubeconfighcloud UCS <Operation> format--clustergroupid and --duration are requiredspec.category uses self/ onpremise (not CCE/ AttachedCluster), spec.provider uses huaweicloud (not huawei_cloud), spec.type uses lowercase cce (not CCE), spec.city uses city codes like 110000 (not city names like Beijing)See Common Pitfalls & Solutions for detailed troubleshooting guides.
Quick Reference:
PitfallSymptomQuick FixInvalid kubeconfigRegistration failsVerify kubeconfig validity and API server reachabilityCluster already registered409 ConflictUse ShowCluster to check existing registrationCCE cluster not found404 Not FoundVerify CCE cluster ID via --metadata.uid in same regionQuota exceeded403 Quota limitCheck quotas with ShowQuota --domainid=<account-id>Fleet group already exists409 ConflictUse ShowClusterGroup to check firstDeregistration impactPolicies stop workingConsider disabling policies before deregistrationFederation kubeconfig expiredMulti-cluster access failsRe-download with DownloadFederationKubeconfig --clustergroupid=<id> --duration=NWrong parameter namesCommand fails or unrecognizedUse --clusterid (not --cluster_id), --clustergroupid (not --group_id)Using --name on ShowClusterListParameter not recognizedUse --category, --clustergroupid, --enablestatus filters insteadMissing domainid on ShowQuotaMissing required parameterProvide --domainid=<account-id>Missing duration on DownloadFederationKubeconfigMissing required parameterProvide --duration=<seconds>