From 1c37f25c1626d190fd1586a497bba438aae54031 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Fri, 31 May 2024 09:59:46 +0200 Subject: [PATCH 1/7] add ionoscloud provider --- cmd/clusterctl/client/config/providers_client.go | 6 ++++++ cmd/clusterctl/client/config_test.go | 2 ++ cmd/clusterctl/cmd/config_repositories_test.go | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/cmd/clusterctl/client/config/providers_client.go b/cmd/clusterctl/client/config/providers_client.go index 09604454e951..8b153115cd78 100644 --- a/cmd/clusterctl/client/config/providers_client.go +++ b/cmd/clusterctl/client/config/providers_client.go @@ -68,6 +68,7 @@ const ( CoxEdgeProviderName = "coxedge" ProxmoxProviderName = "proxmox" K0smotronProviderName = "k0sproject-k0smotron" + IonosCloudProviderName = "ionoscloud" ) // Bootstrap providers. @@ -307,6 +308,11 @@ func (p *providersClient) defaults() []Provider { url: "https://github.com/k0sproject/k0smotron/releases/latest/infrastructure-components.yaml", providerType: clusterctlv1.InfrastructureProviderType, }, + &provider{ + name: IonosCloudProviderName, + url: "https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/latest/infrastructure-components.yaml", + providerType: clusterctlv1.InfrastructureProviderType, + }, // Bootstrap providers &provider{ diff --git a/cmd/clusterctl/client/config_test.go b/cmd/clusterctl/client/config_test.go index 37a72bfb02dd..8aca04537428 100644 --- a/cmd/clusterctl/client/config_test.go +++ b/cmd/clusterctl/client/config_test.go @@ -85,6 +85,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) { config.HivelocityProviderName, config.IBMCloudProviderName, config.InMemoryProviderName, + config.IonosCloudProviderName, config.K0smotronProviderName, config.KubeKeyProviderName, config.KubevirtProviderName, @@ -146,6 +147,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) { config.HivelocityProviderName, config.IBMCloudProviderName, config.InMemoryProviderName, + config.IonosCloudProviderName, config.K0smotronProviderName, config.KubeKeyProviderName, config.KubevirtProviderName, diff --git a/cmd/clusterctl/cmd/config_repositories_test.go b/cmd/clusterctl/cmd/config_repositories_test.go index 5b0f9a74a3b4..eaedb59edf90 100644 --- a/cmd/clusterctl/cmd/config_repositories_test.go +++ b/cmd/clusterctl/cmd/config_repositories_test.go @@ -133,6 +133,7 @@ hetzner InfrastructureProvider https://github.com/syself/clust 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 in-memory InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ infrastructure-components-in-memory-development.yaml +ionoscloud InfrastructureProvider https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/latest/ infrastructure-components.yaml k0sproject-k0smotron InfrastructureProvider https://github.com/k0sproject/k0smotron/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 @@ -277,6 +278,10 @@ var expectedOutputYaml = `- File: core_components.yaml Name: in-memory ProviderType: InfrastructureProvider URL: https://github.com/kubernetes-sigs/cluster-api/releases/latest/ +- File: infrastructure-components.yaml + Name: ionoscloud + ProviderType: InfrastructureProvider + URL: https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/latest/ - File: infrastructure-components.yaml Name: k0sproject-k0smotron ProviderType: InfrastructureProvider From 20999c3d67174d06637cd2f569fba56efcd2e86a Mon Sep 17 00:00:00 2001 From: Ludwig Date: Fri, 31 May 2024 11:40:47 +0200 Subject: [PATCH 2/7] add docs for IONOS Cloud --- docs/book/src/reference/providers.md | 1 + docs/book/src/user/quick-start.md | 36 +++++++++++++++++++++++++--- docs/book/theme/css/custom.css | 6 ++++- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/docs/book/src/reference/providers.md b/docs/book/src/reference/providers.md index cd598ae10af2..c7bad2e878c1 100644 --- a/docs/book/src/reference/providers.md +++ b/docs/book/src/reference/providers.md @@ -38,6 +38,7 @@ updated info about which API version they are supporting. - [Hetzner](https://github.com/syself/cluster-api-provider-hetzner) - [Hivelocity](https://github.com/hivelocity/cluster-api-provider-hivelocity) - [IBM Cloud](https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud) +- [IONOS Cloud](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud) - [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) diff --git a/docs/book/src/user/quick-start.md b/docs/book/src/user/quick-start.md index 331cfdbe3bc7..52bb546d7dbf 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,K0smotron,KubeKey,KubeVirt,Metal3,Nutanix,OCI,OpenStack,Outscale,Proxmox,VCD,vcluster,Virtink,vSphere"}} +{{#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"}} {{#tab Akamai (Linode)}} ```bash @@ -603,6 +603,17 @@ export IBMCLOUD_API_KEY= clusterctl init --infrastructure ibmcloud ``` +{{#/tab }} +{{#tab IONOS Cloud}} + +Credentials are configured per cluster. Therefore, no need to specify them for the provider. + +```bash +clusterctl init --infrastructure ionoscloud +``` + +For more information, please visit the [ionoscloud project][ionoscloud provider]. + {{#/tab }} {{#tab K0smotron}} @@ -861,7 +872,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,K0smotron,KubeKey,KubeVirt,Metal3,Nutanix,OpenStack,Outscale,Proxmox,Tinkerbell,VCD,vcluster,Virtink,vSphere"}} +{{#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"}} {{#tab Akamai (Linode)}} ```bash @@ -1072,6 +1083,24 @@ export IBMPOWERVS_NETWORK_NAME= Please visit the [IBM Cloud provider] for more information. +{{#/tab }} +{{#tab IONOS Cloud}} + +You need to build your own image in order to use it with the IONOS Cloud provider. +For instructions on how to build a compatible image see our [docs](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/blob/main/docs/custom-image.md) + +```bash +export IONOS_TOKEN= +export CONTROL_PLANE_ENDPOINT_IP=10.10.10.4 +export CONTROL_PLANE_ENDPOINT_LOCATION=de/txl +export CLUSTER_NAME=my-cluster +export IONOSCLOUD_DATACENTER_ID="" +export IONOSCLOUD_MACHINE_IMAGE_ID="" +export IONOSCLOUD_MACHINE_SSH_KEYS="" +``` + +For more configuration options check out list of [available variables](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/blob/main/docs/quickstart.md#environment-variables) + {{#/tab }} {{#tab K0smotron}} @@ -1753,6 +1782,7 @@ kind delete cluster [Hivelocity provider]: https://github.com/hivelocity/cluster-api-provider-hivelocity [IBM Cloud provider]: https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud [infrastructure provider]: ../reference/glossary.md#infrastructure-provider +[ionoscloud provider]: https://github.com/ionos-cloud/cluster-api-provider-ionoscloud [kind]: https://kind.sigs.k8s.io/ [KubeadmControlPlane]: ../developer/architecture/controllers/control-plane.md [kubectl]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ @@ -1771,4 +1801,4 @@ kind delete cluster [workload cluster]: ../reference/glossary.md#workload-cluster [CAPI Operator quickstart]: ./quick-start-operator.md [Proxmox getting started guide]: https://github.com/ionos-cloud/cluster-api-provider-proxmox/blob/main/docs/Usage.md -[Tinkerbell getting started guide]: https://github.com/tinkerbell/cluster-api-provider-tinkerbell/blob/main/docs/QUICK-START.md \ No newline at end of file +[Tinkerbell getting started guide]: https://github.com/tinkerbell/cluster-api-provider-tinkerbell/blob/main/docs/QUICK-START.md diff --git a/docs/book/theme/css/custom.css b/docs/book/theme/css/custom.css index 474f70b97717..c2afdcb9bec0 100644 --- a/docs/book/theme/css/custom.css +++ b/docs/book/theme/css/custom.css @@ -411,7 +411,11 @@ cite.literate-source > a::before { .tabset > input:nth-child(43):checked ~ .tab-panels > .tab-panel:nth-child(22), .tabset > input:nth-child(45):checked ~ .tab-panels > .tab-panel:nth-child(23), .tabset > input:nth-child(47):checked ~ .tab-panels > .tab-panel:nth-child(24), -.tabset > input:nth-child(49):checked ~ .tab-panels > .tab-panel:nth-child(25){ +.tabset > input:nth-child(49):checked ~ .tab-panels > .tab-panel:nth-child(25), +.tabset > input:nth-child(51):checked ~ .tab-panels > .tab-panel:nth-child(26), +.tabset > input:nth-child(53):checked ~ .tab-panels > .tab-panel:nth-child(27), +.tabset > input:nth-child(55):checked ~ .tab-panels > .tab-panel:nth-child(28), +.tabset > input:nth-child(57):checked ~ .tab-panels > .tab-panel:nth-child(29){ display: block; } From d743298b9aeb19c64a4b69cf6d406f1495cafba2 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Mon, 17 Jun 2024 10:28:44 +0200 Subject: [PATCH 3/7] fix typo --- docs/book/src/user/quick-start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/src/user/quick-start.md b/docs/book/src/user/quick-start.md index 52bb546d7dbf..6015c2767e58 100644 --- a/docs/book/src/user/quick-start.md +++ b/docs/book/src/user/quick-start.md @@ -1099,7 +1099,7 @@ export IONOSCLOUD_MACHINE_IMAGE_ID="" export IONOSCLOUD_MACHINE_SSH_KEYS="" ``` -For more configuration options check out list of [available variables](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/blob/main/docs/quickstart.md#environment-variables) +For more configuration options check our list of [available variables](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/blob/main/docs/quickstart.md#environment-variables) {{#/tab }} {{#tab K0smotron}} From c8c2977feabff4704e0350e84e9ea21f991facd6 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Mon, 17 Jun 2024 11:21:56 +0200 Subject: [PATCH 4/7] add github org to provider name --- cmd/clusterctl/client/config/providers_client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/clusterctl/client/config/providers_client.go b/cmd/clusterctl/client/config/providers_client.go index 8b153115cd78..4f7fba778b59 100644 --- a/cmd/clusterctl/client/config/providers_client.go +++ b/cmd/clusterctl/client/config/providers_client.go @@ -68,7 +68,7 @@ const ( CoxEdgeProviderName = "coxedge" ProxmoxProviderName = "proxmox" K0smotronProviderName = "k0sproject-k0smotron" - IonosCloudProviderName = "ionoscloud" + IonosCloudProviderName = "ionoscloud-ionoscloud" ) // Bootstrap providers. From 21bf0d1fcf93e8e23d8d643c8e4eb1867d1472e3 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Mon, 17 Jun 2024 12:05:01 +0200 Subject: [PATCH 5/7] update tests and docs --- cmd/clusterctl/cmd/config_repositories_test.go | 4 ++-- docs/book/src/user/quick-start.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/clusterctl/cmd/config_repositories_test.go b/cmd/clusterctl/cmd/config_repositories_test.go index eaedb59edf90..0308bfd4a1d4 100644 --- a/cmd/clusterctl/cmd/config_repositories_test.go +++ b/cmd/clusterctl/cmd/config_repositories_test.go @@ -133,7 +133,7 @@ hetzner InfrastructureProvider https://github.com/syself/clust 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 in-memory InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ infrastructure-components-in-memory-development.yaml -ionoscloud InfrastructureProvider https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/latest/ infrastructure-components.yaml +ionoscloud-ionoscloud InfrastructureProvider https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/latest/ infrastructure-components.yaml k0sproject-k0smotron InfrastructureProvider https://github.com/k0sproject/k0smotron/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 @@ -279,7 +279,7 @@ var expectedOutputYaml = `- File: core_components.yaml ProviderType: InfrastructureProvider URL: https://github.com/kubernetes-sigs/cluster-api/releases/latest/ - File: infrastructure-components.yaml - Name: ionoscloud + Name: ionoscloud-ionoscloud ProviderType: InfrastructureProvider URL: https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/latest/ - File: infrastructure-components.yaml diff --git a/docs/book/src/user/quick-start.md b/docs/book/src/user/quick-start.md index 6015c2767e58..ad5754cadfb8 100644 --- a/docs/book/src/user/quick-start.md +++ b/docs/book/src/user/quick-start.md @@ -609,10 +609,10 @@ clusterctl init --infrastructure ibmcloud Credentials are configured per cluster. Therefore, no need to specify them for the provider. ```bash -clusterctl init --infrastructure ionoscloud +clusterctl init --infrastructure ionoscloud-ionoscloud ``` -For more information, please visit the [ionoscloud project][ionoscloud provider]. +For more information, please visit the [IONOS Cloud project][ionoscloud provider]. {{#/tab }} {{#tab K0smotron}} From fa0f31085065be449c2bb46ba80d5b33e7a90290 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Mon, 17 Jun 2024 13:08:33 +0200 Subject: [PATCH 6/7] improve docs --- docs/book/src/user/quick-start.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/book/src/user/quick-start.md b/docs/book/src/user/quick-start.md index ad5754cadfb8..65069120151f 100644 --- a/docs/book/src/user/quick-start.md +++ b/docs/book/src/user/quick-start.md @@ -606,7 +606,8 @@ clusterctl init --infrastructure ibmcloud {{#/tab }} {{#tab IONOS Cloud}} -Credentials are configured per cluster. Therefore, no need to specify them for the provider. +The IONOS Cloud credentials are configured in the `IONOSCloudCluster`. +Therefore, there is no need to specify them during the provider initialization. ```bash clusterctl init --infrastructure ionoscloud-ionoscloud @@ -1086,8 +1087,8 @@ Please visit the [IBM Cloud provider] for more information. {{#/tab }} {{#tab IONOS Cloud}} -You need to build your own image in order to use it with the IONOS Cloud provider. -For instructions on how to build a compatible image see our [docs](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/blob/main/docs/custom-image.md) +A ClusterAPI compatible image must be available in your IONOS Cloud contract. +For instructions on how to build a compatible Image, see [our docs](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/blob/main/docs/custom-image.md). ```bash export IONOS_TOKEN= From 11aa2fd2aef6d527d440aea49f0efc1a579de4b8 Mon Sep 17 00:00:00 2001 From: Ludwig Date: Mon, 17 Jun 2024 13:21:57 +0200 Subject: [PATCH 7/7] add docs for environment variables --- docs/book/src/user/quick-start.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/book/src/user/quick-start.md b/docs/book/src/user/quick-start.md index 65069120151f..42de5378da70 100644 --- a/docs/book/src/user/quick-start.md +++ b/docs/book/src/user/quick-start.md @@ -1091,12 +1091,17 @@ A ClusterAPI compatible image must be available in your IONOS Cloud contract. For instructions on how to build a compatible Image, see [our docs](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/blob/main/docs/custom-image.md). ```bash +# The token which is used to authenticate against the IONOS Cloud API export IONOS_TOKEN= +# The datacenter ID where the cluster will be deployed +export IONOSCLOUD_DATACENTER_ID="" +# The IP of the control plane endpoint export CONTROL_PLANE_ENDPOINT_IP=10.10.10.4 +# The location of the data center where the cluster will be deployed export CONTROL_PLANE_ENDPOINT_LOCATION=de/txl -export CLUSTER_NAME=my-cluster -export IONOSCLOUD_DATACENTER_ID="" +# The image ID of the custom image that will be used for the VMs export IONOSCLOUD_MACHINE_IMAGE_ID="" +# The SSH key that will be used to access the VMs export IONOSCLOUD_MACHINE_SSH_KEYS="" ```