Skip to content

Commit

Permalink
🌱 Add vultr infrastructure provider (kubernetes-sigs#11091)
Browse files Browse the repository at this point in the history
* add vultr provider

Signed-off-by: cmondragon <cmondragon@vultr.com>

* fix indent

* Fix indentation consistency

* add github org name

* gofmt

* update provider name

* fix provider expectedOutput

---------

Signed-off-by: cmondragon <cmondragon@vultr.com>
  • Loading branch information
mondragonfx authored Sep 10, 2024
1 parent 94fb5ac commit 8b3fab1
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 5 deletions.
6 changes: 6 additions & 0 deletions cmd/clusterctl/client/config/providers_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const (
ProxmoxProviderName = "proxmox"
K0smotronProviderName = "k0sproject-k0smotron"
IonosCloudProviderName = "ionoscloud-ionoscloud"
VultrProviderName = "vultr-vultr"
)

// Bootstrap providers.
Expand Down Expand Up @@ -313,6 +314,11 @@ func (p *providersClient) defaults() []Provider {
url: "https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/latest/infrastructure-components.yaml",
providerType: clusterctlv1.InfrastructureProviderType,
},
&provider{
name: VultrProviderName,
url: "https://github.com/vultr/cluster-api-provider-vultr/releases/latest/infrastructure-components.yaml",
providerType: clusterctlv1.InfrastructureProviderType,
},

// Bootstrap providers
&provider{
Expand Down
2 changes: 2 additions & 0 deletions cmd/clusterctl/client/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.VclusterProviderName,
config.VirtinkProviderName,
config.VSphereProviderName,
config.VultrProviderName,
config.InClusterIPAMProviderName,
config.HelmAddonProviderName,
},
Expand Down Expand Up @@ -167,6 +168,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.VclusterProviderName,
config.VirtinkProviderName,
config.VSphereProviderName,
config.VultrProviderName,
config.InClusterIPAMProviderName,
config.HelmAddonProviderName,
},
Expand Down
5 changes: 5 additions & 0 deletions cmd/clusterctl/cmd/config_repositories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ vcd InfrastructureProvider https://github.com/vmware/clust
vcluster InfrastructureProvider https://github.com/loft-sh/cluster-api-provider-vcluster/releases/latest/ infrastructure-components.yaml
virtink InfrastructureProvider https://github.com/smartxworks/cluster-api-provider-virtink/releases/latest/ infrastructure-components.yaml
vsphere InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/latest/ infrastructure-components.yaml
vultr-vultr InfrastructureProvider https://github.com/vultr/cluster-api-provider-vultr/releases/latest/ infrastructure-components.yaml
in-cluster IPAMProvider https://github.com/kubernetes-sigs/cluster-api-ipam-provider-in-cluster/releases/latest/ ipam-components.yaml
helm AddonProvider https://github.com/kubernetes-sigs/cluster-api-addon-provider-helm/releases/latest/ addon-components.yaml
`
Expand Down Expand Up @@ -362,6 +363,10 @@ var expectedOutputYaml = `- File: core_components.yaml
Name: vsphere
ProviderType: InfrastructureProvider
URL: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/latest/
- File: infrastructure-components.yaml
Name: vultr-vultr
ProviderType: InfrastructureProvider
URL: https://github.com/vultr/cluster-api-provider-vultr/releases/latest/
- File: ipam-components.yaml
Name: in-cluster
ProviderType: IPAMProvider
Expand Down
1 change: 1 addition & 0 deletions docs/book/src/reference/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ updated info about which API version they are supporting.
- [Virtink](https://github.com/smartxworks/cluster-api-provider-virtink)
- [VMware Cloud Director](https://github.com/vmware/cluster-api-provider-cloud-director)
- [vSphere](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere)
- [Vultr](https://github.com/vultr/cluster-api-provider-vultr)
- [k0smotron RemoteMachine (SSH)](https://github.com/k0sproject/k0smotron)

## IP Address Management (IPAM)
Expand Down
32 changes: 30 additions & 2 deletions docs/book/src/user/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}
{{#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"}}
{{#tab Akamai (Linode)}}
```bash
Expand Down Expand Up @@ -793,6 +793,15 @@ clusterctl init --infrastructure vsphere
For more information about prerequisites, credentials management, or permissions for vSphere, see the [vSphere
project][vSphere getting started guide].
{{#/tab }}
{{#tab Vultr}}
```bash
export VULTR_API_KEY=<your_api_key>
# initialize the management cluster
clusterctl init --infrastructure vultr
```
{{#/tab }}
{{#/tabs }}
Expand Down Expand Up @@ -862,7 +871,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"}}
{{#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"}}
{{#tab Akamai (Linode)}}
```bash
Expand Down Expand Up @@ -1339,6 +1348,25 @@ export CONTROL_PLANE_ENDPOINT_IP="1.2.3.4"
For more information about prerequisites, credentials management, or permissions for vSphere, see the [vSphere getting started guide].
{{#/tab }}
{{#tab Vultr}}
A Cluster API compatible image must be available in your Vultr account. For instructions on how to build a compatible image see image-builder for [Vultr](https://github.com/vultr/cluster-api-provider-vultr/blob/main/docs/getting-started.md)
```bash
export CLUSTER_NAME=<clustername>
export KUBERNETES_VERSION=v1.28.9
export CONTROL_PLANE_MACHINE_COUNT=1
export CONTROL_PLANE_PLANID=<plan_id>
export WORKER_MACHINE_COUNT=1
export WORKER_PLANID=<plan_id>
export MACHINE_IMAGE=<snapshot_id>
export REGION=<region>
export PLANID=<plan_id>
export VPCID=<vpc_id>
export SSHKEY_ID=<sshKey_id>
```
{{#/tab }}
{{#/tabs }}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/apis/core/exp/v1alpha3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/apis/core/exp/v1alpha4/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8b3fab1

Please sign in to comment.