Skip to content

Commit

Permalink
Add k0smotron provider
Browse files Browse the repository at this point in the history
  • Loading branch information
makhov committed Jan 12, 2024
1 parent eb88bc8 commit 2af18b6
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cmd/clusterctl/client/config/providers_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const (
VirtinkProviderName = "virtink"
CoxEdgeProviderName = "coxedge"
ProxmoxProviderName = "proxmox"
K0smotronProviderName = "k0smotron"
)

// Bootstrap providers.
Expand All @@ -74,6 +75,7 @@ const (
OracleCloudNativeBootstrapProviderName = "ocne"
KubeKeyK3sBootstrapProviderName = "kubekey-k3s"
RKE2BootstrapProviderName = "rke2"
K0smotronBootstrapProviderName = "k0smotron"
)

// ControlPlane providers.
Expand All @@ -86,6 +88,7 @@ const (
KubeKeyK3sControlPlaneProviderName = "kubekey-k3s"
KamajiControlPlaneProviderName = "kamaji"
RKE2ControlPlaneProviderName = "rke2"
K0smotronControlPlaneProviderName = "k0smotron"
)

// Add-on providers.
Expand Down Expand Up @@ -276,6 +279,11 @@ func (p *providersClient) defaults() []Provider {
url: "https://github.com/ionos-cloud/cluster-api-provider-proxmox/releases/latest/infrastructure-components.yaml",
providerType: clusterctlv1.InfrastructureProviderType,
},
&provider{
name: K0smotronProviderName,
url: "https://github.com/k0sproject/k0smotron/releases/latest/infrastructure-components.yaml",
providerType: clusterctlv1.InfrastructureProviderType,
},

// Bootstrap providers
&provider{
Expand Down Expand Up @@ -308,6 +316,11 @@ func (p *providersClient) defaults() []Provider {
url: "https://github.com/rancher-sandbox/cluster-api-provider-rke2/releases/latest/bootstrap-components.yaml",
providerType: clusterctlv1.BootstrapProviderType,
},
&provider{
name: K0smotronBootstrapProviderName,
url: "https://github.com/k0sproject/k0smotron/releases/latest/bootstrap-components.yaml",
providerType: clusterctlv1.BootstrapProviderType,
},

// ControlPlane providers
&provider{
Expand Down Expand Up @@ -350,6 +363,11 @@ func (p *providersClient) defaults() []Provider {
url: "https://github.com/rancher-sandbox/cluster-api-provider-rke2/releases/latest/control-plane-components.yaml",
providerType: clusterctlv1.ControlPlaneProviderType,
},
&provider{
name: K0smotronControlPlaneProviderName,
url: "https://github.com/k0sproject/k0smotron/releases/latest/control-plane-components.yaml",
providerType: clusterctlv1.ControlPlaneProviderType,
},

// Add-on providers
&provider{
Expand Down
6 changes: 6 additions & 0 deletions cmd/clusterctl/client/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
// note: these will be sorted by name by the Providers() call, so be sure they are in alphabetical order here too
wantProviders: []string{
config.ClusterAPIProviderName,
config.K0smotronBootstrapProviderName,
config.KubeadmBootstrapProviderName,
config.KubeKeyK3sBootstrapProviderName,
config.MicroK8sBootstrapProviderName,
config.OracleCloudNativeBootstrapProviderName,
config.RKE2BootstrapProviderName,
config.TalosBootstrapProviderName,
config.K0smotronControlPlaneProviderName,
config.KamajiControlPlaneProviderName,
config.KubeadmControlPlaneProviderName,
config.KubeKeyK3sControlPlaneProviderName,
Expand All @@ -82,6 +84,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.HetznerProviderName,
config.IBMCloudProviderName,
config.InMemoryProviderName,
config.K0smotronProviderName,
config.KubeKeyProviderName,
config.KubevirtProviderName,
config.MAASProviderName,
Expand Down Expand Up @@ -111,12 +114,14 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
wantProviders: []string{
config.ClusterAPIProviderName,
customProviderConfig.Name(),
config.K0smotronBootstrapProviderName,
config.KubeadmBootstrapProviderName,
config.KubeKeyK3sBootstrapProviderName,
config.MicroK8sBootstrapProviderName,
config.OracleCloudNativeBootstrapProviderName,
config.RKE2BootstrapProviderName,
config.TalosBootstrapProviderName,
config.K0smotronControlPlaneProviderName,
config.KamajiControlPlaneProviderName,
config.KubeadmControlPlaneProviderName,
config.KubeKeyK3sControlPlaneProviderName,
Expand All @@ -136,6 +141,7 @@ func Test_clusterctlClient_GetProvidersConfig(t *testing.T) {
config.HetznerProviderName,
config.IBMCloudProviderName,
config.InMemoryProviderName,
config.K0smotronProviderName,
config.KubeKeyProviderName,
config.KubevirtProviderName,
config.MAASProviderName,
Expand Down
15 changes: 15 additions & 0 deletions cmd/clusterctl/cmd/config_repositories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,14 @@ providers:
var expectedOutputText = `NAME TYPE URL FILE
cluster-api CoreProvider https://github.com/myorg/myforkofclusterapi/releases/latest/ core_components.yaml
another-provider BootstrapProvider ./ bootstrap-components.yaml
k0smotron BootstrapProvider https://github.com/k0sproject/k0smotron/releases/latest/ bootstrap-components.yaml
kubeadm BootstrapProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ bootstrap-components.yaml
kubekey-k3s BootstrapProvider https://github.com/kubesphere/kubekey/releases/latest/ bootstrap-components.yaml
microk8s BootstrapProvider https://github.com/canonical/cluster-api-bootstrap-provider-microk8s/releases/latest/ bootstrap-components.yaml
ocne BootstrapProvider https://github.com/verrazzano/cluster-api-provider-ocne/releases/latest/ bootstrap-components.yaml
rke2 BootstrapProvider https://github.com/rancher-sandbox/cluster-api-provider-rke2/releases/latest/ bootstrap-components.yaml
talos BootstrapProvider https://github.com/siderolabs/cluster-api-bootstrap-provider-talos/releases/latest/ bootstrap-components.yaml
k0smotron ControlPlaneProvider https://github.com/k0sproject/k0smotron/releases/latest/ control-plane-components.yaml
kamaji ControlPlaneProvider https://github.com/clastix/cluster-api-control-plane-provider-kamaji/releases/latest/ control-plane-components.yaml
kubeadm ControlPlaneProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ control-plane-components.yaml
kubekey-k3s ControlPlaneProvider https://github.com/kubesphere/kubekey/releases/latest/ control-plane-components.yaml
Expand All @@ -130,6 +132,7 @@ gcp InfrastructureProvider https://github.com/kubernetes-sigs/
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
in-memory InfrastructureProvider https://github.com/kubernetes-sigs/cluster-api/releases/latest/ infrastructure-components-in-memory-development.yaml
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
maas InfrastructureProvider https://github.com/spectrocloud/cluster-api-provider-maas/releases/latest/ infrastructure-components.yaml
Expand Down Expand Up @@ -158,6 +161,10 @@ var expectedOutputYaml = `- File: core_components.yaml
Name: another-provider
ProviderType: BootstrapProvider
URL: ./
- File: bootstrap-components.yaml
Name: k0smotron
ProviderType: BootstrapProvider
URL: https://github.com/k0sproject/k0smotron/releases/latest/
- File: bootstrap-components.yaml
Name: kubeadm
ProviderType: BootstrapProvider
Expand All @@ -182,6 +189,10 @@ var expectedOutputYaml = `- File: core_components.yaml
Name: talos
ProviderType: BootstrapProvider
URL: https://github.com/siderolabs/cluster-api-bootstrap-provider-talos/releases/latest/
- File: control-plane-components.yaml
Name: k0smotron
ProviderType: ControlPlaneProvider
URL: https://github.com/k0sproject/k0smotron/releases/latest/
- File: control-plane-components.yaml
Name: kamaji
ProviderType: ControlPlaneProvider
Expand Down Expand Up @@ -258,6 +269,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: k0smotron
ProviderType: InfrastructureProvider
URL: https://github.com/k0sproject/k0smotron/releases/latest/
- File: infrastructure-components.yaml
Name: kubekey
ProviderType: InfrastructureProvider
Expand Down
3 changes: 3 additions & 0 deletions docs/book/src/clusterctl/provider-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,13 @@ providers.
| CABPM | cluster.x-k8s.io/provider=bootstrap-microk8s |
| CABPKK3S | cluster.x-k8s.io/provider=bootstrap-kubekey-k3s |
| CABPOCNE | cluster.x-k8s.io/provider=bootstrap-ocne |
| CABPK0S | cluster.x-k8s.io/provider=bootstrap-k0smotron |
| 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 |
| CACPKK3S | cluster.x-k8s.io/provider=control-plane-kubekey-k3s |
| CACPOCNE | cluster.x-k8s.io/provider=control-plane-ocne |
| CACPK0S | cluster.x-k8s.io/provider=control-plane-k0smotron |
| CAPA | cluster.x-k8s.io/provider=infrastructure-aws |
| CAPB | cluster.x-k8s.io/provider=infrastructure-byoh |
| CAPC | cluster.x-k8s.io/provider=infrastructure-cloudstack |
Expand All @@ -279,6 +281,7 @@ providers.
| CAPX | cluster.x-k8s.io/provider=infrastructure-nutanix |
| CAPZ | cluster.x-k8s.io/provider=infrastructure-azure |
| CAPOSC | cluster.x-k8s.io/provider=infrastructure-outscale |
| CAPK0S | cluster.x-k8s.io/provider=infrastructure-k0smotron |

### Workload cluster templates

Expand Down
14 changes: 14 additions & 0 deletions docs/book/src/user/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,14 @@ export IBMCLOUD_API_KEY=<you_api_key>
clusterctl init --infrastructure ibmcloud
```
{{#/tab }}
{{#tab K0smotron}}
```bash
# Initialize the management cluster
clusterctl init --infrastructure k0smotron
```
{{#/tab }}
{{#tab KubeKey}}
Expand Down Expand Up @@ -1041,6 +1049,11 @@ export IBMPOWERVS_NETWORK_NAME=<your-capi-network-name>
Please visit the [IBM Cloud provider] for more information.
{{#/tab }}
{{#tab K0smotron}}
Please visit the [K0smotron provider] for more information.
{{#/tab }}
{{#tab KubeKey}}
Expand Down Expand Up @@ -1678,6 +1691,7 @@ kind delete cluster
[management cluster]: ../reference/glossary.md#management-cluster
[Metal3 getting started guide]: https://github.com/metal3-io/cluster-api-provider-metal3/blob/master/docs/getting-started.md
[Metal3 provider]: https://github.com/metal3-io/cluster-api-provider-metal3/
[K0smotron provider]: https://github.com/k0sproject/k0smotron
[KubeKey provider]: https://github.com/kubesphere/kubekey
[KubeVirt provider]: https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt/
[KubeVirt]: https://kubevirt.io/
Expand Down

0 comments on commit 2af18b6

Please sign in to comment.