Skip to content

Commit 5ef4415

Browse files
authored
Merge pull request #11876 from k8s-infra-cherrypick-robot/cherry-pick-11861-to-release-1.9
[release-1.9] 🌱 clusterctl: Add support infrastructure provider for Huawei Cloud
2 parents 068c0f3 + 4bdcc15 commit 5ef4415

File tree

7 files changed

+58
-2
lines changed

7 files changed

+58
-2
lines changed

cmd/clusterctl/client/config/providers_client.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const (
4848
HarvesterProviderName = "harvester-harvester"
4949
HetznerProviderName = "hetzner"
5050
HivelocityProviderName = "hivelocity-hivelocity"
51+
HuaweiProviderName = "huawei"
5152
OutscaleProviderName = "outscale"
5253
IBMCloudProviderName = "ibmcloud"
5354
InMemoryProviderName = "in-memory"
@@ -273,6 +274,11 @@ func (p *providersClient) defaults() []Provider {
273274
url: "https://github.com/hivelocity/cluster-api-provider-hivelocity/releases/latest/infrastructure-components.yaml",
274275
providerType: clusterctlv1.InfrastructureProviderType,
275276
},
277+
&provider{
278+
name: HuaweiProviderName,
279+
url: "https://github.com/HuaweiCloudDeveloper/cluster-api-provider-huawei/releases/latest/infrastructure-components.yaml",
280+
providerType: clusterctlv1.InfrastructureProviderType,
281+
},
276282
&provider{
277283
name: OutscaleProviderName,
278284
url: "https://github.com/outscale/cluster-api-provider-outscale/releases/latest/infrastructure-components.yaml",

cmd/clusterctl/client/config_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
8484
config.HarvesterProviderName,
8585
config.HetznerProviderName,
8686
config.HivelocityProviderName,
87+
config.HuaweiProviderName,
8788
config.IBMCloudProviderName,
8889
config.InMemoryProviderName,
8990
config.IonosCloudProviderName,
@@ -151,6 +152,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
151152
config.HarvesterProviderName,
152153
config.HetznerProviderName,
153154
config.HivelocityProviderName,
155+
config.HuaweiProviderName,
154156
config.IBMCloudProviderName,
155157
config.InMemoryProviderName,
156158
config.IonosCloudProviderName,

cmd/clusterctl/cmd/config_repositories_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ gcp InfrastructureProvider https://github.com/kubernetes
131131
harvester-harvester InfrastructureProvider https://github.com/rancher-sandbox/cluster-api-provider-harvester/releases/latest/ infrastructure-components.yaml
132132
hetzner InfrastructureProvider https://github.com/syself/cluster-api-provider-hetzner/releases/latest/ infrastructure-components.yaml
133133
hivelocity-hivelocity InfrastructureProvider https://github.com/hivelocity/cluster-api-provider-hivelocity/releases/latest/ infrastructure-components.yaml
134+
huawei InfrastructureProvider https://github.com/HuaweiCloudDeveloper/cluster-api-provider-huawei/releases/latest/ infrastructure-components.yaml
134135
ibmcloud InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/releases/latest/ infrastructure-components.yaml
135136
in-memory InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ infrastructure-components-in-memory-development.yaml
136137
ionoscloud-ionoscloud InfrastructureProvider https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/latest/ infrastructure-components.yaml
@@ -278,6 +279,10 @@ var expectedOutputYaml = `- File: core_components.yaml
278279
Name: hivelocity-hivelocity
279280
ProviderType: InfrastructureProvider
280281
URL: https://github.com/hivelocity/cluster-api-provider-hivelocity/releases/latest/
282+
- File: infrastructure-components.yaml
283+
Name: huawei
284+
ProviderType: InfrastructureProvider
285+
URL: https://github.com/HuaweiCloudDeveloper/cluster-api-provider-huawei/releases/latest/
281286
- File: infrastructure-components.yaml
282287
Name: ibmcloud
283288
ProviderType: InfrastructureProvider

docs/book/src/developer/providers/contracts/clusterctl.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ providers.
327327
| CAPG | cluster.x-k8s.io/provider=infrastructure-gcp |
328328
| CAPH | cluster.x-k8s.io/provider=infrastructure-hetzner |
329329
| CAPHV | cluster.x-k8s.io/provider=infrastructure-hivelocity |
330+
| CAPHW | cluster.x-k8s.io/provider=infrastructure-huawei |
330331
| CAPIBM | cluster.x-k8s.io/provider=infrastructure-ibmcloud |
331332
| CAPKK | cluster.x-k8s.io/provider=infrastructure-kubekey |
332333
| CAPK | cluster.x-k8s.io/provider=infrastructure-kubevirt |

docs/book/src/reference/glossary.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ Cluster API Provider Hetzner
6363
### CAPHV
6464
Cluster API Provider Hivelocity
6565

66+
### CAPHW
67+
Cluster API Provider Huawei
68+
6669
### CAPIBM
6770
Cluster API Provider IBM Cloud
6871

docs/book/src/reference/providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ updated info about which API version they are supporting.
3939
- [Google Cloud Platform (GCP)](https://cluster-api-gcp.sigs.k8s.io/)
4040
- [Hetzner](https://github.com/syself/cluster-api-provider-hetzner)
4141
- [Hivelocity](https://github.com/hivelocity/cluster-api-provider-hivelocity)
42+
- [Huawei Cloud](https://github.com/HuaweiCloudDeveloper/cluster-api-provider-huawei)
4243
- [IBM Cloud](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud)
4344
- [IONOS Cloud](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud)
4445
- [KubeKey](https://github.com/kubesphere/kubekey)

docs/book/src/user/quick-start.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ Additional documentation about experimental features can be found in [Experiment
281281
Depending on the infrastructure provider you are planning to use, some additional prerequisites should be satisfied
282282
before getting started with Cluster API. See below for the expected settings for common providers.
283283
284-
{{#tabs name:"tab-installation-infrastructure" tabs:"Akamai (Linode),AWS,Azure,CloudStack,DigitalOcean,Docker,Equinix Metal,GCP,Harvester,Hetzner,Hivelocity,IBM Cloud,IONOS Cloud,K0smotron,KubeKey,KubeVirt,Metal3,Nutanix,OCI,OpenStack,Outscale,Proxmox,VCD,vcluster,Virtink,vSphere,Vultr"}}
284+
{{#tabs name:"tab-installation-infrastructure" tabs:"Akamai (Linode),AWS,Azure,CloudStack,DigitalOcean,Docker,Equinix Metal,GCP,Harvester,Hetzner,Hivelocity,Huawei,IBM Cloud,IONOS Cloud,K0smotron,KubeKey,KubeVirt,Metal3,Nutanix,OCI,OpenStack,Outscale,Proxmox,VCD,vcluster,Virtink,vSphere,Vultr"}}
285285
{{#tab Akamai (Linode)}}
286286
287287
```bash
@@ -592,6 +592,18 @@ Please visit the [Hetzner project][Hetzner provider].
592592
593593
Please visit the [Hivelocity project][Hivelocity provider].
594594
595+
{{#/tab }}
596+
{{#tab Huawei}}
597+
598+
```bash
599+
# Please ensure that the values for `CLOUD_SDK_AK` and `CLOUD_SDK_SK` are base64 encoded.
600+
export CLOUD_SDK_AK=$( echo $AccessKey | base64 | tr -d '\n' )
601+
export CLOUD_SDK_SK=$( echo $SecretKey | base64 | tr -d '\n' )
602+
603+
# Finally, initialize the management cluster
604+
clusterctl init --infrastructure huawei
605+
```
606+
595607
{{#/tab }}
596608
{{#tab IBM Cloud}}
597609
@@ -883,7 +895,7 @@ before configuring a cluster with Cluster API. Instructions are provided for com
883895
Otherwise, you can look at the `clusterctl generate cluster` [command][clusterctl generate cluster] documentation for details about how to
884896
discover the list of variables required by a cluster templates.
885897
886-
{{#tabs name:"tab-configuration-infrastructure" tabs:"Akamai (Linode),AWS,Azure,CloudStack,DigitalOcean,Docker,Equinix Metal,GCP,Harvester,IBM Cloud,IONOS Cloud,K0smotron,KubeKey,KubeVirt,Metal3,Nutanix,OpenStack,Outscale,Proxmox,Tinkerbell,VCD,vcluster,Virtink,vSphere,Vultr"}}
898+
{{#tabs name:"tab-configuration-infrastructure" tabs:"Akamai (Linode),AWS,Azure,CloudStack,DigitalOcean,Docker,Equinix Metal,GCP,Harvester,Huawei,IBM Cloud,IONOS Cloud,K0smotron,KubeKey,KubeVirt,Metal3,Nutanix,OpenStack,Outscale,Proxmox,Tinkerbell,VCD,vcluster,Virtink,vSphere,Vultr"}}
887899
{{#tab Akamai (Linode)}}
888900
889901
```bash
@@ -1102,6 +1114,31 @@ export WORKER_MACHINE_COUNT=2
11021114
11031115
See the [Harvester provider] for more information.
11041116
1117+
{{#/tab }}
1118+
{{#tab Huawei}}
1119+
1120+
1121+
```bash
1122+
# huawei cloud region
1123+
export HC_REGION="cn-east-1"
1124+
# ECS SSH key name
1125+
export HC_SSH_KEY_NAME="default"
1126+
# kubernetes version
1127+
export KUBERNETES_VERSION="1.32.0"
1128+
# number of control plane machines
1129+
export CONTROL_PLANE_MACHINE_COUNT="1"
1130+
# number of worker machines
1131+
export WORKER_MACHINE_COUNT="1"
1132+
# control plane machine type
1133+
export HC_CONTROL_PLANE_MACHINE_TYPE="x1e.2u.4g"
1134+
# worker node machine type
1135+
export HC_NODE_MACHINE_TYPE="x1e.2u.4g"
1136+
# ECS image ID
1137+
export ECS_IMAGE_ID="218ca5t7-bxf3-5dg0-852p-y703c9fe1a52"
1138+
```
1139+
1140+
See the [Huawei Cloud provider] for more information.
1141+
11051142
{{#/tab }}
11061143
{{#tab IBM Cloud}}
11071144
@@ -1876,6 +1913,7 @@ kind delete cluster
18761913
[Harvester provider]: https://github.com/rancher-sandbox/cluster-api-provider-harvester
18771914
[Hetzner provider]: https://github.com/syself/cluster-api-provider-hetzner
18781915
[Hivelocity provider]: https://github.com/hivelocity/cluster-api-provider-hivelocity
1916+
[Huawei Cloud provider]: https://github.com/HuaweiCloudDeveloper/cluster-api-provider-huawei
18791917
[IBM Cloud provider]: https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud
18801918
[infrastructure provider]: ../reference/glossary.md#infrastructure-provider
18811919
[ionoscloud provider]: https://github.com/ionos-cloud/cluster-api-provider-ionoscloud

0 commit comments

Comments
 (0)