Skip to content

Commit 80e7c65

Browse files
authored
Merge pull request #7518 from 24sama/main
✨add kubekey provider
2 parents c4844f2 + fb1b1df commit 80e7c65

File tree

7 files changed

+75
-30
lines changed

7 files changed

+75
-30
lines changed

cmd/clusterctl/client/config/providers_client.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const (
5858
VSphereProviderName = "vsphere"
5959
MAASProviderName = "maas"
6060
KubevirtProviderName = "kubevirt"
61+
KubeKeyProviderName = "kubekey"
6162
VclusterProviderName = "vcluster"
6263
VirtinkProviderName = "virtink"
6364
)
@@ -225,6 +226,11 @@ func (p *providersClient) defaults() []Provider {
225226
url: "https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/latest/infrastructure-components.yaml",
226227
providerType: clusterctlv1.InfrastructureProviderType,
227228
},
229+
&provider{
230+
name: KubeKeyProviderName,
231+
url: "https://github.com/kubesphere/kubekey/releases/latest/infrastructure-components.yaml",
232+
providerType: clusterctlv1.InfrastructureProviderType,
233+
},
228234
&provider{
229235
name: KubevirtProviderName,
230236
url: "https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/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
@@ -72,6 +72,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
7272
config.GCPProviderName,
7373
config.HetznerProviderName,
7474
config.IBMCloudProviderName,
75+
config.KubeKeyProviderName,
7576
config.KubevirtProviderName,
7677
config.MAASProviderName,
7778
config.Metal3ProviderName,
@@ -114,6 +115,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
114115
config.GCPProviderName,
115116
config.HetznerProviderName,
116117
config.IBMCloudProviderName,
118+
config.KubeKeyProviderName,
117119
config.KubevirtProviderName,
118120
config.MAASProviderName,
119121
config.Metal3ProviderName,

cmd/clusterctl/cmd/config_repositories_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ docker InfrastructureProvider https://github.com/kubernetes-sigs/
118118
gcp InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-gcp/releases/latest/ infrastructure-components.yaml
119119
hetzner InfrastructureProvider https://github.com/syself/cluster-api-provider-hetzner/releases/latest/ infrastructure-components.yaml
120120
ibmcloud InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/releases/latest/ infrastructure-components.yaml
121+
kubekey InfrastructureProvider https://github.com/kubesphere/kubekey/releases/latest/ infrastructure-components.yaml
121122
kubevirt InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/releases/latest/ infrastructure-components.yaml
122123
maas InfrastructureProvider https://github.com/spectrocloud/cluster-api-provider-maas/releases/latest/ infrastructure-components.yaml
123124
metal3 InfrastructureProvider https://github.com/metal3-io/cluster-api-provider-metal3/releases/latest/ infrastructure-components.yaml
@@ -207,6 +208,10 @@ var expectedOutputYaml = `- File: core_components.yaml
207208
Name: ibmcloud
208209
ProviderType: InfrastructureProvider
209210
URL: https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/releases/latest/
211+
- File: infrastructure-components.yaml
212+
Name: kubekey
213+
ProviderType: InfrastructureProvider
214+
URL: https://github.com/kubesphere/kubekey/releases/latest/
210215
- File: infrastructure-components.yaml
211216
Name: kubevirt
212217
ProviderType: InfrastructureProvider

docs/book/src/clusterctl/provider-contract.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -236,34 +236,35 @@ easier transition from `kubectl apply` to `clusterctl`.
236236
As a reference you can consider the labels applied to the following
237237
providers.
238238

239-
| Provider Name| Label |
240-
|--------------|--------------------------------------------------------|
241-
|CAPI | cluster.x-k8s.io/provider=cluster-api |
242-
|CABPK | cluster.x-k8s.io/provider=bootstrap-kubeadm |
243-
|CABPM | cluster.x-k8s.io/provider=bootstrap-microk8s |
244-
|CACPK | cluster.x-k8s.io/provider=control-plane-kubeadm |
245-
|CACPM | cluster.x-k8s.io/provider=control-plane-microk8s |
246-
|CACPN | cluster.x-k8s.io/provider=control-plane-nested |
247-
|CAPA | cluster.x-k8s.io/provider=infrastructure-aws |
248-
|CAPB | cluster.x-k8s.io/provider=infrastructure-byoh |
249-
|CAPC | cluster.x-k8s.io/provider=infrastructure-cloudstack |
250-
|CAPD | cluster.x-k8s.io/provider=infrastructure-docker |
251-
|CAPDO | cluster.x-k8s.io/provider=infrastructure-digitalocean |
252-
|CAPG | cluster.x-k8s.io/provider=infrastructure-gcp |
253-
|CAPH | cluster.x-k8s.io/provider=infrastructure-hetzner |
254-
|CAPIBM | cluster.x-k8s.io/provider=infrastructure-ibmcloud |
255-
|CAPK | cluster.x-k8s.io/provider=infrastructure-kubevirt |
256-
|CAPM3 | cluster.x-k8s.io/provider=infrastructure-metal3 |
257-
|CAPN | cluster.x-k8s.io/provider=infrastructure-nested |
258-
|CAPO | cluster.x-k8s.io/provider=infrastructure-openstack |
259-
|CAPOCI | cluster.x-k8s.io/provider=infrastructure-oci |
260-
|CAPP | cluster.x-k8s.io/provider=infrastructure-packet |
261-
|CAPV | cluster.x-k8s.io/provider=infrastructure-vsphere |
262-
|CAPVC | cluster.x-k8s.io/provider=infrastructure-vcluster |
263-
|CAPVCD | cluster.x-k8s.io/provider=infrastructure-vcd |
264-
|CAPX | cluster.x-k8s.io/provider=infrastructure-nutanix |
265-
|CAPZ | cluster.x-k8s.io/provider=infrastructure-azure |
266-
|CAPOSC | cluster.x-k8s.io/provider=infrastructure-outscale |
239+
| Provider Name| Label |
240+
|--------------|-------------------------------------------------------|
241+
|CAPI | cluster.x-k8s.io/provider=cluster-api |
242+
|CABPK | cluster.x-k8s.io/provider=bootstrap-kubeadm |
243+
|CABPM | cluster.x-k8s.io/provider=bootstrap-microk8s |
244+
|CACPK | cluster.x-k8s.io/provider=control-plane-kubeadm |
245+
|CACPM | cluster.x-k8s.io/provider=control-plane-microk8s |
246+
|CACPN | cluster.x-k8s.io/provider=control-plane-nested |
247+
|CAPA | cluster.x-k8s.io/provider=infrastructure-aws |
248+
|CAPB | cluster.x-k8s.io/provider=infrastructure-byoh |
249+
|CAPC | cluster.x-k8s.io/provider=infrastructure-cloudstack |
250+
|CAPD | cluster.x-k8s.io/provider=infrastructure-docker |
251+
|CAPDO | cluster.x-k8s.io/provider=infrastructure-digitalocean |
252+
|CAPG | cluster.x-k8s.io/provider=infrastructure-gcp |
253+
|CAPH | cluster.x-k8s.io/provider=infrastructure-hetzner |
254+
|CAPIBM | cluster.x-k8s.io/provider=infrastructure-ibmcloud |
255+
|CAPKK | cluster.x-k8s.io/provider=infrastructure-kubekey |
256+
|CAPK | cluster.x-k8s.io/provider=infrastructure-kubevirt |
257+
|CAPM3 | cluster.x-k8s.io/provider=infrastructure-metal3 |
258+
|CAPN | cluster.x-k8s.io/provider=infrastructure-nested |
259+
|CAPO | cluster.x-k8s.io/provider=infrastructure-openstack |
260+
|CAPOCI | cluster.x-k8s.io/provider=infrastructure-oci |
261+
|CAPP | cluster.x-k8s.io/provider=infrastructure-packet |
262+
|CAPV | cluster.x-k8s.io/provider=infrastructure-vsphere |
263+
|CAPVC | cluster.x-k8s.io/provider=infrastructure-vcluster |
264+
|CAPVCD | cluster.x-k8s.io/provider=infrastructure-vcd |
265+
|CAPX | cluster.x-k8s.io/provider=infrastructure-nutanix |
266+
|CAPZ | cluster.x-k8s.io/provider=infrastructure-azure |
267+
|CAPOSC | cluster.x-k8s.io/provider=infrastructure-outscale |
267268
### Workload cluster templates
268269

269270
An infrastructure provider could publish a **cluster templates** file to be used by `clusterctl generate cluster`.

docs/book/src/reference/glossary.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ Cluster API Provider Nested
7272
### CAPX
7373
Cluster API Provider Nutanix
7474

75+
### CAPKK
76+
Cluster API Provider KubeKey
77+
7578
### CAPK
7679
Cluster API Provider Kubevirt
7780

docs/book/src/reference/providers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ updated info about which API version they are supporting.
2929
- [Hetzner](https://github.com/syself/cluster-api-provider-hetzner)
3030
- [Outscale](https://github.com/outscale-dev/cluster-api-provider-outscale)
3131
- [IBM Cloud](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud)
32+
- [KubeKey](https://github.com/kubesphere/kubekey)
3233
- [KubeVirt](https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt)
3334
- [MAAS](https://github.com/spectrocloud/cluster-api-provider-maas)
3435
- [Metal3](https://github.com/metal3-io/cluster-api-provider-metal3)

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

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Additional documentation about experimental features can be found in [Experiment
202202
Depending on the infrastructure provider you are planning to use, some additional prerequisites should be satisfied
203203
before getting started with Cluster API. See below for the expected settings for common providers.
204204
205-
{{#tabs name:"tab-installation-infrastructure" tabs:"AWS,Azure,CloudStack,DigitalOcean,Docker,Equinix Metal,GCP,Hetzner,IBM Cloud,Kubevirt,Metal3,Nutanix,OCI,OpenStack,Outscale,VCD,vcluster,Virtink,vSphere"}}
205+
{{#tabs name:"tab-installation-infrastructure" tabs:"AWS,Azure,CloudStack,DigitalOcean,Docker,Equinix Metal,GCP,Hetzner,IBM Cloud,KubeKey,Kubevirt,Metal3,Nutanix,OCI,OpenStack,Outscale,VCD,vcluster,Virtink,vSphere"}}
206206
{{#tab AWS}}
207207
208208
Download the latest binary of `clusterawsadm` from the [AWS provider releases].
@@ -433,6 +433,16 @@ export IBMCLOUD_API_KEY=<you_api_key>
433433
clusterctl init --infrastructure ibmcloud
434434
```
435435
436+
{{#/tab }}
437+
{{#tab KubeKey}}
438+
439+
```bash
440+
# Initialize the management cluster
441+
clusterctl init --infrastructure kubekey
442+
```
443+
444+
{{#/tab }}
445+
436446
{{#/tab }}
437447
{{#tab Kubevirt}}
438448
@@ -593,7 +603,7 @@ before configuring a cluster with Cluster API. Instructions are provided for com
593603
Otherwise, you can look at the `clusterctl generate cluster` [command][clusterctl generate cluster] documentation for details about how to
594604
discover the list of variables required by a cluster templates.
595605
596-
{{#tabs name:"tab-configuration-infrastructure" tabs:"AWS,Azure,CloudStack,DigitalOcean,Docker,Equinix Metal,GCP,IBM Cloud,Kubevirt,Metal3,Nutanix,OpenStack,Outscale,VCD,vcluster,Virtink,vSphere"}}
606+
{{#tabs name:"tab-configuration-infrastructure" tabs:"AWS,Azure,CloudStack,DigitalOcean,Docker,Equinix Metal,GCP,IBM Cloud,KubeKey,Kubevirt,Metal3,Nutanix,OpenStack,Outscale,VCD,vcluster,Virtink,vSphere"}}
597607
{{#tab AWS}}
598608
599609
```bash
@@ -792,6 +802,23 @@ export IBMPOWERVS_NETWORK_NAME=<your-capi-network-name>
792802
793803
Please visit the [IBM Cloud provider] for more information.
794804
805+
{{#/tab }}
806+
{{#tab KubeKey}}
807+
808+
```bash
809+
# Required environment variables
810+
# The KKZONE is used to specify where to download the binaries. (e.g. "", "cn")
811+
export KKZONE=""
812+
# The ssh name of the all instance Linux user. (e.g. root, ubuntu)
813+
export USER_NAME=<your-linux-user>
814+
# The ssh password of the all instance Linux user.
815+
export PASSWORD=<your-linux-user-password>
816+
# The ssh IP address of the all instance. (e.g. "[{address: 192.168.100.3}, {address: 192.168.100.4}]")
817+
export INSTANCES=<your-linux-ip-address>
818+
# The cluster control plane VIP. (e.g. "192.168.100.100")
819+
export CONTROL_PLANE_ENDPOINT_IP=<your-control-plane-virtual-ip>
820+
```
821+
795822
{{#/tab }}
796823
{{#tab Kubevirt}}
797824

0 commit comments

Comments
 (0)