Skip to content

Commit 63c5b87

Browse files
authored
Merge pull request #11861 from ErikJiang/add_caphw
🌱 clusterctl: Add support infrastructure provider for Huawei Cloud
2 parents 48746cb + 841c5be commit 63c5b87

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
LinodeProviderName = "linode-linode"
@@ -272,6 +273,11 @@ func (p *providersClient) defaults() []Provider {
272273
url: "https://github.com/hivelocity/cluster-api-provider-hivelocity/releases/latest/infrastructure-components.yaml",
273274
providerType: clusterctlv1.InfrastructureProviderType,
274275
},
276+
&provider{
277+
name: HuaweiProviderName,
278+
url: "https://github.com/HuaweiCloudDeveloper/cluster-api-provider-huawei/releases/latest/infrastructure-components.yaml",
279+
providerType: clusterctlv1.InfrastructureProviderType,
280+
},
275281
&provider{
276282
name: OutscaleProviderName,
277283
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.IonosCloudProviderName,
8990
config.K0smotronProviderName,
@@ -150,6 +151,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
150151
config.HarvesterProviderName,
151152
config.HetznerProviderName,
152153
config.HivelocityProviderName,
154+
config.HuaweiProviderName,
153155
config.IBMCloudProviderName,
154156
config.IonosCloudProviderName,
155157
config.K0smotronProviderName,

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
ionoscloud-ionoscloud InfrastructureProvider https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/latest/ infrastructure-components.yaml
136137
k0sproject-k0smotron InfrastructureProvider https://github.com/k0sproject/k0smotron/releases/latest/ infrastructure-components.yaml
@@ -277,6 +278,10 @@ var expectedOutputYaml = `- File: core_components.yaml
277278
Name: hivelocity-hivelocity
278279
ProviderType: InfrastructureProvider
279280
URL: https://github.com/hivelocity/cluster-api-provider-hivelocity/releases/latest/
281+
- File: infrastructure-components.yaml
282+
Name: huawei
283+
ProviderType: InfrastructureProvider
284+
URL: https://github.com/HuaweiCloudDeveloper/cluster-api-provider-huawei/releases/latest/
280285
- File: infrastructure-components.yaml
281286
Name: ibmcloud
282287
ProviderType: InfrastructureProvider

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ providers.
326326
| CAPG | cluster.x-k8s.io/provider=infrastructure-gcp |
327327
| CAPH | cluster.x-k8s.io/provider=infrastructure-hetzner |
328328
| CAPHV | cluster.x-k8s.io/provider=infrastructure-hivelocity |
329+
| CAPHW | cluster.x-k8s.io/provider=infrastructure-huawei |
329330
| CAPIBM | cluster.x-k8s.io/provider=infrastructure-ibmcloud |
330331
| CAPKK | cluster.x-k8s.io/provider=infrastructure-kubekey |
331332
| 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
@@ -894,7 +906,7 @@ before configuring a cluster with Cluster API. Instructions are provided for com
894906
Otherwise, you can look at the `clusterctl generate cluster` [command][clusterctl generate cluster] documentation for details about how to
895907
discover the list of variables required by a cluster templates.
896908
897-
{{#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"}}
909+
{{#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"}}
898910
{{#tab Akamai (Linode)}}
899911
900912
```bash
@@ -1113,6 +1125,31 @@ export WORKER_MACHINE_COUNT=2
11131125
11141126
See the [Harvester provider] for more information.
11151127
1128+
{{#/tab }}
1129+
{{#tab Huawei}}
1130+
1131+
1132+
```bash
1133+
# huawei cloud region
1134+
export HC_REGION="cn-east-1"
1135+
# ECS SSH key name
1136+
export HC_SSH_KEY_NAME="default"
1137+
# kubernetes version
1138+
export KUBERNETES_VERSION="1.32.0"
1139+
# number of control plane machines
1140+
export CONTROL_PLANE_MACHINE_COUNT="1"
1141+
# number of worker machines
1142+
export WORKER_MACHINE_COUNT="1"
1143+
# control plane machine type
1144+
export HC_CONTROL_PLANE_MACHINE_TYPE="x1e.2u.4g"
1145+
# worker node machine type
1146+
export HC_NODE_MACHINE_TYPE="x1e.2u.4g"
1147+
# ECS image ID
1148+
export ECS_IMAGE_ID="218ca5t7-bxf3-5dg0-852p-y703c9fe1a52"
1149+
```
1150+
1151+
See the [Huawei Cloud provider] for more information.
1152+
11161153
{{#/tab }}
11171154
{{#tab IBM Cloud}}
11181155
@@ -1908,6 +1945,7 @@ kind delete cluster
19081945
[Harvester provider]: https://github.com/rancher-sandbox/cluster-api-provider-harvester
19091946
[Hetzner provider]: https://github.com/syself/cluster-api-provider-hetzner
19101947
[Hivelocity provider]: https://github.com/hivelocity/cluster-api-provider-hivelocity
1948+
[Huawei Cloud provider]: https://github.com/HuaweiCloudDeveloper/cluster-api-provider-huawei
19111949
[IBM Cloud provider]: https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud
19121950
[infrastructure provider]: ../reference/glossary.md#infrastructure-provider
19131951
[ionoscloud provider]: https://github.com/ionos-cloud/cluster-api-provider-ionoscloud

0 commit comments

Comments
 (0)