diff --git a/cmd/clusterctl/client/config/providers_client.go b/cmd/clusterctl/client/config/providers_client.go index 8df48266513f..1eb6fbf9b27a 100644 --- a/cmd/clusterctl/client/config/providers_client.go +++ b/cmd/clusterctl/client/config/providers_client.go @@ -58,6 +58,7 @@ const ( VSphereProviderName = "vsphere" MAASProviderName = "maas" KubevirtProviderName = "kubevirt" + KubeKeyProviderName = "kubekey" VclusterProviderName = "vcluster" VirtinkProviderName = "virtink" ) @@ -225,6 +226,11 @@ func (p *providersClient) defaults() []Provider { url: "https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix/releases/latest/infrastructure-components.yaml", providerType: clusterctlv1.InfrastructureProviderType, }, + &provider{ + name: KubeKeyProviderName, + url: "https://github.com/kubesphere/kubekey/releases/latest/infrastructure-components.yaml", + providerType: clusterctlv1.InfrastructureProviderType, + }, &provider{ name: KubevirtProviderName, url: "https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/releases/latest/infrastructure-components.yaml", diff --git a/cmd/clusterctl/client/config_test.go b/cmd/clusterctl/client/config_test.go index fbc549c0b6d8..fe8ebbd5e591 100644 --- a/cmd/clusterctl/client/config_test.go +++ b/cmd/clusterctl/client/config_test.go @@ -72,6 +72,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) { config.GCPProviderName, config.HetznerProviderName, config.IBMCloudProviderName, + config.KubeKeyProviderName, config.KubevirtProviderName, config.MAASProviderName, config.Metal3ProviderName, @@ -114,6 +115,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) { config.GCPProviderName, config.HetznerProviderName, config.IBMCloudProviderName, + config.KubeKeyProviderName, config.KubevirtProviderName, config.MAASProviderName, config.Metal3ProviderName, diff --git a/cmd/clusterctl/cmd/config_repositories_test.go b/cmd/clusterctl/cmd/config_repositories_test.go index 57a4cd23b79d..13fd40ec075c 100644 --- a/cmd/clusterctl/cmd/config_repositories_test.go +++ b/cmd/clusterctl/cmd/config_repositories_test.go @@ -118,6 +118,7 @@ docker InfrastructureProvider https://github.com/kubernetes-sigs/ gcp InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-gcp/releases/latest/ infrastructure-components.yaml hetzner InfrastructureProvider https://github.com/syself/cluster-api-provider-hetzner/releases/latest/ infrastructure-components.yaml ibmcloud InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/releases/latest/ infrastructure-components.yaml +kubekey InfrastructureProvider https://github.com/kubesphere/kubekey/releases/latest/ infrastructure-components.yaml kubevirt InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/releases/latest/ infrastructure-components.yaml maas InfrastructureProvider https://github.com/spectrocloud/cluster-api-provider-maas/releases/latest/ infrastructure-components.yaml 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 Name: ibmcloud ProviderType: InfrastructureProvider URL: https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/releases/latest/ +- File: infrastructure-components.yaml + Name: kubekey + ProviderType: InfrastructureProvider + URL: https://github.com/kubesphere/kubekey/releases/latest/ - File: infrastructure-components.yaml Name: kubevirt ProviderType: InfrastructureProvider diff --git a/docs/book/src/clusterctl/provider-contract.md b/docs/book/src/clusterctl/provider-contract.md index 6f2efdce7711..96b7a877f137 100644 --- a/docs/book/src/clusterctl/provider-contract.md +++ b/docs/book/src/clusterctl/provider-contract.md @@ -236,34 +236,35 @@ easier transition from `kubectl apply` to `clusterctl`. As a reference you can consider the labels applied to the following providers. -| Provider Name| Label | -|--------------|--------------------------------------------------------| -|CAPI | cluster.x-k8s.io/provider=cluster-api | -|CABPK | cluster.x-k8s.io/provider=bootstrap-kubeadm | -|CABPM | cluster.x-k8s.io/provider=bootstrap-microk8s | -|CACPK | cluster.x-k8s.io/provider=control-plane-kubeadm | -|CACPM | cluster.x-k8s.io/provider=control-plane-microk8s | -|CACPN | cluster.x-k8s.io/provider=control-plane-nested | -|CAPA | cluster.x-k8s.io/provider=infrastructure-aws | -|CAPB | cluster.x-k8s.io/provider=infrastructure-byoh | -|CAPC | cluster.x-k8s.io/provider=infrastructure-cloudstack | -|CAPD | cluster.x-k8s.io/provider=infrastructure-docker | -|CAPDO | cluster.x-k8s.io/provider=infrastructure-digitalocean | -|CAPG | cluster.x-k8s.io/provider=infrastructure-gcp | -|CAPH | cluster.x-k8s.io/provider=infrastructure-hetzner | -|CAPIBM | cluster.x-k8s.io/provider=infrastructure-ibmcloud | -|CAPK | cluster.x-k8s.io/provider=infrastructure-kubevirt | -|CAPM3 | cluster.x-k8s.io/provider=infrastructure-metal3 | -|CAPN | cluster.x-k8s.io/provider=infrastructure-nested | -|CAPO | cluster.x-k8s.io/provider=infrastructure-openstack | -|CAPOCI | cluster.x-k8s.io/provider=infrastructure-oci | -|CAPP | cluster.x-k8s.io/provider=infrastructure-packet | -|CAPV | cluster.x-k8s.io/provider=infrastructure-vsphere | -|CAPVC | cluster.x-k8s.io/provider=infrastructure-vcluster | -|CAPVCD | cluster.x-k8s.io/provider=infrastructure-vcd | -|CAPX | cluster.x-k8s.io/provider=infrastructure-nutanix | -|CAPZ | cluster.x-k8s.io/provider=infrastructure-azure | -|CAPOSC | cluster.x-k8s.io/provider=infrastructure-outscale | +| Provider Name| Label | +|--------------|-------------------------------------------------------| +|CAPI | cluster.x-k8s.io/provider=cluster-api | +|CABPK | cluster.x-k8s.io/provider=bootstrap-kubeadm | +|CABPM | cluster.x-k8s.io/provider=bootstrap-microk8s | +|CACPK | cluster.x-k8s.io/provider=control-plane-kubeadm | +|CACPM | cluster.x-k8s.io/provider=control-plane-microk8s | +|CACPN | cluster.x-k8s.io/provider=control-plane-nested | +|CAPA | cluster.x-k8s.io/provider=infrastructure-aws | +|CAPB | cluster.x-k8s.io/provider=infrastructure-byoh | +|CAPC | cluster.x-k8s.io/provider=infrastructure-cloudstack | +|CAPD | cluster.x-k8s.io/provider=infrastructure-docker | +|CAPDO | cluster.x-k8s.io/provider=infrastructure-digitalocean | +|CAPG | cluster.x-k8s.io/provider=infrastructure-gcp | +|CAPH | cluster.x-k8s.io/provider=infrastructure-hetzner | +|CAPIBM | cluster.x-k8s.io/provider=infrastructure-ibmcloud | +|CAPKK | cluster.x-k8s.io/provider=infrastructure-kubekey | +|CAPK | cluster.x-k8s.io/provider=infrastructure-kubevirt | +|CAPM3 | cluster.x-k8s.io/provider=infrastructure-metal3 | +|CAPN | cluster.x-k8s.io/provider=infrastructure-nested | +|CAPO | cluster.x-k8s.io/provider=infrastructure-openstack | +|CAPOCI | cluster.x-k8s.io/provider=infrastructure-oci | +|CAPP | cluster.x-k8s.io/provider=infrastructure-packet | +|CAPV | cluster.x-k8s.io/provider=infrastructure-vsphere | +|CAPVC | cluster.x-k8s.io/provider=infrastructure-vcluster | +|CAPVCD | cluster.x-k8s.io/provider=infrastructure-vcd | +|CAPX | cluster.x-k8s.io/provider=infrastructure-nutanix | +|CAPZ | cluster.x-k8s.io/provider=infrastructure-azure | +|CAPOSC | cluster.x-k8s.io/provider=infrastructure-outscale | ### Workload cluster templates An infrastructure provider could publish a **cluster templates** file to be used by `clusterctl generate cluster`. diff --git a/docs/book/src/reference/glossary.md b/docs/book/src/reference/glossary.md index 5355177b13b1..d67157c5d107 100644 --- a/docs/book/src/reference/glossary.md +++ b/docs/book/src/reference/glossary.md @@ -72,6 +72,9 @@ Cluster API Provider Nested ### CAPX Cluster API Provider Nutanix +### CAPKK +Cluster API Provider KubeKey + ### CAPK Cluster API Provider Kubevirt diff --git a/docs/book/src/reference/providers.md b/docs/book/src/reference/providers.md index 833bd35ae33d..bdcc6df73fe9 100644 --- a/docs/book/src/reference/providers.md +++ b/docs/book/src/reference/providers.md @@ -29,6 +29,7 @@ updated info about which API version they are supporting. - [Hetzner](https://github.com/syself/cluster-api-provider-hetzner) - [Outscale](https://github.com/outscale-dev/cluster-api-provider-outscale) - [IBM Cloud](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud) +- [KubeKey](https://github.com/kubesphere/kubekey) - [KubeVirt](https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt) - [MAAS](https://github.com/spectrocloud/cluster-api-provider-maas) - [Metal3](https://github.com/metal3-io/cluster-api-provider-metal3) diff --git a/docs/book/src/user/quick-start.md b/docs/book/src/user/quick-start.md index 56e1f1fcca65..c067d6619560 100644 --- a/docs/book/src/user/quick-start.md +++ b/docs/book/src/user/quick-start.md @@ -202,7 +202,7 @@ Additional documentation about experimental features can be found in [Experiment Depending on the infrastructure provider you are planning to use, some additional prerequisites should be satisfied before getting started with Cluster API. See below for the expected settings for common providers. -{{#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"}} +{{#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"}} {{#tab AWS}} Download the latest binary of `clusterawsadm` from the [AWS provider releases]. @@ -433,6 +433,16 @@ export IBMCLOUD_API_KEY= clusterctl init --infrastructure ibmcloud ``` +{{#/tab }} +{{#tab KubeKey}} + +```bash +# Initialize the management cluster +clusterctl init --infrastructure kubekey +``` + +{{#/tab }} + {{#/tab }} {{#tab Kubevirt}} @@ -593,7 +603,7 @@ before configuring a cluster with Cluster API. Instructions are provided for com Otherwise, you can look at the `clusterctl generate cluster` [command][clusterctl generate cluster] documentation for details about how to discover the list of variables required by a cluster templates. -{{#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"}} +{{#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"}} {{#tab AWS}} ```bash @@ -792,6 +802,23 @@ export IBMPOWERVS_NETWORK_NAME= Please visit the [IBM Cloud provider] for more information. +{{#/tab }} +{{#tab KubeKey}} + +```bash +# Required environment variables +# The KKZONE is used to specify where to download the binaries. (e.g. "", "cn") +export KKZONE="" +# The ssh name of the all instance Linux user. (e.g. root, ubuntu) +export USER_NAME= +# The ssh password of the all instance Linux user. +export PASSWORD= +# The ssh IP address of the all instance. (e.g. "[{address: 192.168.100.3}, {address: 192.168.100.4}]") +export INSTANCES= +# The cluster control plane VIP. (e.g. "192.168.100.100") +export CONTROL_PLANE_ENDPOINT_IP= +``` + {{#/tab }} {{#tab Kubevirt}}