diff --git a/cmd/clusterctl/client/config/providers_client.go b/cmd/clusterctl/client/config/providers_client.go index f3e9ed6ffb08..cbdcd383444d 100644 --- a/cmd/clusterctl/client/config/providers_client.go +++ b/cmd/clusterctl/client/config/providers_client.go @@ -37,13 +37,15 @@ const ( // Infra providers. const ( - AWSProviderName = "aws" - AzureProviderName = "azure" - BYOHProviderName = "byoh" - CloudStackProviderName = "cloudstack" - DockerProviderName = "docker" - DOProviderName = "digitalocean" - GCPProviderName = "gcp" + AWSProviderName = "aws" + AzureProviderName = "azure" + BYOHProviderName = "byoh" + CloudStackProviderName = "cloudstack" + DockerProviderName = "docker" + DOProviderName = "digitalocean" + GCPProviderName = "gcp" + // Note: harvester is currently on rancher-sandbox, but the plan is to move it on the harvester GitHub org (also owned by Rancher). + HarvesterProviderName = "harvester-harvester" HetznerProviderName = "hetzner" HivelocityProviderName = "hivelocity-hivelocity" OutscaleProviderName = "outscale" @@ -257,6 +259,11 @@ func (p *providersClient) defaults() []Provider { url: "https://github.com/vmware-tanzu/cluster-api-provider-bringyourownhost/releases/latest/infrastructure-components.yaml", providerType: clusterctlv1.InfrastructureProviderType, }, + &provider{ + name: HarvesterProviderName, + url: "https://github.com/rancher-sandbox/cluster-api-provider-harvester/releases/latest/infrastructure-components.yaml", + providerType: clusterctlv1.InfrastructureProviderType, + }, &provider{ name: HetznerProviderName, url: "https://github.com/syself/cluster-api-provider-hetzner/releases/latest/infrastructure-components.yaml", diff --git a/cmd/clusterctl/client/config_test.go b/cmd/clusterctl/client/config_test.go index 6497a1c8443c..ab0f9140e10d 100644 --- a/cmd/clusterctl/client/config_test.go +++ b/cmd/clusterctl/client/config_test.go @@ -83,6 +83,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) { config.DOProviderName, config.DockerProviderName, config.GCPProviderName, + config.HarvesterProviderName, config.HetznerProviderName, config.HivelocityProviderName, config.IBMCloudProviderName, @@ -150,6 +151,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) { config.DOProviderName, config.DockerProviderName, config.GCPProviderName, + config.HarvesterProviderName, config.HetznerProviderName, config.HivelocityProviderName, config.IBMCloudProviderName, diff --git a/cmd/clusterctl/cmd/config_repositories_test.go b/cmd/clusterctl/cmd/config_repositories_test.go index 8b107980188c..d489ced27788 100644 --- a/cmd/clusterctl/cmd/config_repositories_test.go +++ b/cmd/clusterctl/cmd/config_repositories_test.go @@ -130,6 +130,7 @@ coxedge InfrastructureProvider https://github.com/coxedge/cl digitalocean InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-digitalocean/releases/latest/ infrastructure-components.yaml docker InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ infrastructure-components-development.yaml gcp InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-gcp/releases/latest/ infrastructure-components.yaml +harvester-harvester InfrastructureProvider https://github.com/rancher-sandbox/cluster-api-provider-harvester/releases/latest/ infrastructure-components.yaml hetzner InfrastructureProvider https://github.com/syself/cluster-api-provider-hetzner/releases/latest/ infrastructure-components.yaml hivelocity-hivelocity InfrastructureProvider https://github.com/hivelocity/cluster-api-provider-hivelocity/releases/latest/ infrastructure-components.yaml ibmcloud InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/releases/latest/ infrastructure-components.yaml @@ -274,6 +275,10 @@ var expectedOutputYaml = `- File: core_components.yaml Name: gcp ProviderType: InfrastructureProvider URL: https://github.com/kubernetes-sigs/cluster-api-provider-gcp/releases/latest/ +- File: infrastructure-components.yaml + Name: harvester-harvester + ProviderType: InfrastructureProvider + URL: https://github.com/rancher-sandbox/cluster-api-provider-harvester/releases/latest/ - File: infrastructure-components.yaml Name: hetzner ProviderType: InfrastructureProvider diff --git a/docs/book/src/user/quick-start.md b/docs/book/src/user/quick-start.md index 5d7d4ea75cbd..9c021d31368d 100644 --- a/docs/book/src/user/quick-start.md +++ b/docs/book/src/user/quick-start.md @@ -281,7 +281,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:"Akamai (Linode),AWS,Azure,CloudStack,DigitalOcean,Docker,Equinix Metal,GCP,Hetzner,Hivelocity,IBM Cloud,IONOS Cloud,K0smotron,KubeKey,KubeVirt,Metal3,Nutanix,OCI,OpenStack,Outscale,Proxmox,VCD,vcluster,Virtink,vSphere,Vultr"}} +{{#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"}} {{#tab Akamai (Linode)}} ```bash @@ -574,6 +574,14 @@ export GCP_B64ENCODED_CREDENTIALS=$( cat /path/to/gcp-credentials.json | base64 clusterctl init --infrastructure gcp ``` +{{#/tab }} +{{#tab Harvester}} + +```bash +clusterctl init --infrastructure harvester-harvester +``` + +For more information, please visit the [Harvester project][Harvester provider]. {{#/tab }} {{#tab Hetzner}} @@ -871,7 +879,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:"Akamai (Linode),AWS,Azure,CloudStack,DigitalOcean,Docker,Equinix Metal,GCP,IBM Cloud,IONOS Cloud,K0smotron,KubeKey,KubeVirt,Metal3,Nutanix,OpenStack,Outscale,Proxmox,Tinkerbell,VCD,vcluster,Virtink,vSphere,Vultr"}} +{{#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"}} {{#tab Akamai (Linode)}} ```bash @@ -1050,6 +1058,46 @@ export CLUSTER_NAME="" See the [GCP provider] for more information. +{{#/tab }} +{{#tab Harvester}} + + +```bash +# Cloud Provider credentials, which are a Kubeconfig generated using this process: https://docs.harvesterhci.io/v1.3/rancher/cloud-provider/#deploying-to-the-rke2-custom-cluster-experimental +# Since v0.1.5, this can be left "", because the controller can update it automatically +export CLOUD_CONFIG_KUBECONFIG_B64="" +# Name of the CAPI Cluster +export CLUSTER_NAME="" +# Number of Control Plane machines +export CONTROL_PLANE_MACHINE_COUNT=3 +# URL to access the Harvester Cluster, this will be overriden by the controller +export HARVESTER_ENDPOINT="" +# Base64-Encoded Kubeconfig to access Harvester, which can be downloaded from Harvester's UI or from a Harvester Manager Node. +export HARVESTER_KUBECONFIG_B64="" +# Namespace for all resources in the Management Cluster +export NAMESPACE="test" +# Pod CIDR for the Workload Cluster, it should have the format: 192.168.0.0/16 +export POD_CIDR="10.42.0.0/16" +# Service CIDR for the Workload Cluster, it should have the format : 192.168.0.0/16 and be different from POD_CIDR +export SERVICE_CIDR="10.43.0.0/16" +# Reference to SSH Keypair in Harvester. It should follow the format / +export SSH_KEYPAIR="default/ssk-key-pair" +# Namespace in Harvester where the VMs will be created. +export TARGET_HARVESTER_NAMESPACE="default" +# Disk Size to be used by the VMs +export VM_DISK_SIZE="50Gi" +# Reference to OS Image in Harvester which will be used for creating VMs, It must follow the format / +export VM_IMAGE_NAME="default/jammy-server" +# Reference to VM Network in Harvester. It must follow the format / +export VM_NETWORK="default/untagged" +# Linux Username for the VMs +export VM_SSH_USER="ubuntu" +# Number of Worker nodes in the target Workload cluster +export WORKER_MACHINE_COUNT=2 +``` + +See the [Harvester provider] for more information. + {{#/tab }} {{#tab IBM Cloud}} @@ -1817,6 +1865,7 @@ kind delete cluster [Docker]: https://www.docker.com/ [GCP provider]: https://cluster-api-gcp.sigs.k8s.io/ [Helm]: https://helm.sh/docs/intro/install/ +[Harvester provider]: https://github.com/rancher-sandbox/cluster-api-provider-harvester [Hetzner provider]: https://github.com/syself/cluster-api-provider-hetzner [Hivelocity provider]: https://github.com/hivelocity/cluster-api-provider-hivelocity [IBM Cloud provider]: https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud