Skip to content

Commit

Permalink
feat: support for the Proxmox Cluster API provider by IONOS (#122)
Browse files Browse the repository at this point in the history
* feat: support for the Proxmox Cluster API provider by IONOS

Signed-off-by: Dario Tranchitella <[email protected]>

* docs: support for the Proxmox Cluster API provider by IONOS

Signed-off-by: Dario Tranchitella <[email protected]>

---------

Signed-off-by: Dario Tranchitella <[email protected]>
  • Loading branch information
prometherion authored Nov 9, 2024
1 parent b3d2f9c commit d9b9220
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 14 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ The Kamaji Cluster API Control Plane provider documentation is referenced in the

### 🚀 Supported CAPI infrastructure providers

| Infrastructure Provider | Version |
|-----------------------------------------------------------------------------------------------------------------------------------------|-------------------|
| [AWS](https://github.com/kubernetes-sigs/cluster-api-provider-aws) ([technical considerations](docs/providers-aws.md)) | += v2.4.0 |
| [Equinix/Packet](https://github.com/kubernetes-sigs/cluster-api-provider-packet) ([technical considerations](docs/providers-packet.md)) | += v0.7.2 |
| [Hetzner](https://github.com/syself/cluster-api-provider-hetzner)([technical considerations](docs/providers-hetzner.md)) | += v1.0.0-beta.30 |
| [KubeVirt](https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt) ([technical considerations](docs/providers-kubevirt.md)) | += 0.1.7 |
| [Metal³](https://github.com/metal3-io/cluster-api-provider-metal3) ([technical considerations](docs/providers-metal3.md)) | += 1.4.0 |
| [Nutanix](https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix) ([technical considerations](docs/providers-nutanix.md)) | += 1.2.4 |
| [OpenStack](https://github.com/kubernetes-sigs/cluster-api-provider-openstack) ([technical considerations](docs/providers-openstack.md)) | += 0.8.0 |
| [Tinkerbell](https://github.com/tinkerbell/cluster-api-provider-tinkerbell) ([technical considerations](docs/providers-tinkerbell.md)) | += v0.5.2 |
| [vSphere](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere) ([technical considerations](docs/providers-vsphere.md)) | += 1.7.0 |
| [IONOS Cloud](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud) ([technical considerations](docs/providers-ionoscloud.md)) | += v0.3.0 |
| Infrastructure Provider | Version |
|-----------------------------------------------------------------------------------------------------------------------------------------------|-------------------|
| [AWS](https://github.com/kubernetes-sigs/cluster-api-provider-aws) ([technical considerations](docs/providers-aws.md)) | += v2.4.0 |
| [Equinix/Packet](https://github.com/kubernetes-sigs/cluster-api-provider-packet) ([technical considerations](docs/providers-packet.md)) | += v0.7.2 |
| [Hetzner](https://github.com/syself/cluster-api-provider-hetzner)([technical considerations](docs/providers-hetzner.md)) | += v1.0.0-beta.30 |
| [KubeVirt](https://github.com/kubernetes-sigs/cluster-api-provider-kubevirt) ([technical considerations](docs/providers-kubevirt.md)) | += 0.1.7 |
| [Metal³](https://github.com/metal3-io/cluster-api-provider-metal3) ([technical considerations](docs/providers-metal3.md)) | += 1.4.0 |
| [Nutanix](https://github.com/nutanix-cloud-native/cluster-api-provider-nutanix) ([technical considerations](docs/providers-nutanix.md)) | += 1.2.4 |
| [OpenStack](https://github.com/kubernetes-sigs/cluster-api-provider-openstack) ([technical considerations](docs/providers-openstack.md)) | += 0.8.0 |
| [Tinkerbell](https://github.com/tinkerbell/cluster-api-provider-tinkerbell) ([technical considerations](docs/providers-tinkerbell.md)) | += v0.5.2 |
| [vSphere](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere) ([technical considerations](docs/providers-vsphere.md)) | += 1.7.0 |
| [IONOS Cloud](https://github.com/ionos-cloud/cluster-api-provider-ionoscloud) ([technical considerations](docs/providers-ionoscloud.md)) | += v0.3.0 |
| [Proxmox by IONOS Cloud](https://github.com/ionos-cloud/cluster-api-provider-proxmox) ([technical considerations](docs/providers-proxmox.md)) | unreleased |

> Are you looking for further integrations?
> Please, engage with the community on the [#kamaji](https://kubernetes.slack.com/archives/C03GLTTMWNN) Kubernetes Slack
Expand Down
1 change: 1 addition & 0 deletions config/control-plane-components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13366,6 +13366,7 @@ rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- proxmoxclusters
- tinkerbellclusters
- vsphereclusters
verbs:
Expand Down
1 change: 1 addition & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- proxmoxclusters
- tinkerbellclusters
- vsphereclusters
verbs:
Expand Down
6 changes: 4 additions & 2 deletions controllers/kamajicontrolplane_controller_cluster_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ func (r *KamajiControlPlaneReconciler) patchCluster(ctx context.Context, cluster
return r.patchOpenStackCluster(ctx, cluster, endpoint, port)
case "PacketCluster":
return r.patchGenericCluster(ctx, cluster, endpoint, port, true)
case "ProxmoxCluster":
return r.checkOrPatchGenericCluster(ctx, cluster, endpoint, port)
case "TinkerbellCluster":
return r.checkOrPatchGenericCluster(ctx, cluster, endpoint, port)
case "VSphereCluster":
Expand All @@ -110,8 +112,8 @@ func (r *KamajiControlPlaneReconciler) patchCluster(ctx context.Context, cluster
}
}

//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vsphereclusters;tinkerbellclusters,verbs=get
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=vsphereclusters;tinkerbellclusters,verbs=patch
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=proxmoxclusters;vsphereclusters;tinkerbellclusters,verbs=get
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=proxmoxclusters;vsphereclusters;tinkerbellclusters,verbs=patch

func (r *KamajiControlPlaneReconciler) checkOrPatchGenericCluster(ctx context.Context, cluster capiv1beta1.Cluster, endpoint string, port int64) error {
if err := r.checkGenericCluster(ctx, cluster, endpoint, port); err != nil {
Expand Down
139 changes: 139 additions & 0 deletions docs/providers-proxmox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Kamaji and Proxmox

The Kamaji Control Plane provider allows creating a _Proxmox by IONOS Cloud_ backed Kubernetes cluster by providing Kamaji Control Planes.

## Example manifests

```yaml
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: proxmox-quickstart
namespace: default
spec:
clusterNetwork:
pods:
cidrBlocks:
- REDACTED/REDACTED
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1alpha1
kind: KamajiControlPlane
name: proxmox-quickstart
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: ProxmoxCluster
name: proxmox-quickstart
---
apiVersion: controlplane.cluster.x-k8s.io/v1alpha1
kind: KamajiControlPlane
metadata:
name: proxmox-quickstart
namespace: default
spec:
dataStoreName: default
addons:
coreDNS: { }
kubeProxy: { }
kubelet:
cgroupfs: systemd
preferredAddressTypes:
- InternalIP
network:
serviceType: LoadBalancer
deployment:
replicas: 2
version: 1.29.7
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: ProxmoxCluster
metadata:
name: proxmox-quickstart
namespace: default
spec:
allowedNodes:
- pve
dnsServers:
- REDACTED
- REDACTED
externalManagedControlPlane: true
ipv4Config:
addresses:
- REDACTED-REDACTED
gateway: REDACTED
prefix: REDACTED
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: proxmox-quickstart-workers
namespace: default
spec:
clusterName: proxmox-quickstart
replicas: 2
selector:
matchLabels: null
template:
metadata:
labels:
node-role.kubernetes.io/node: ""
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
name: proxmox-quickstart-worker
clusterName: proxmox-quickstart
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: ProxmoxMachineTemplate
name: proxmox-quickstart-worker
version: v1.29.7
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: ProxmoxMachineTemplate
metadata:
name: proxmox-quickstart-worker
namespace: default
spec:
template:
spec:
disks:
bootVolume:
disk: scsi0
sizeGb: REDACTED
format: qcow2
full: true
memoryMiB: REDACTED
network:
default:
bridge: REDACTED
model: virtio
numCores: REDACTED
numSockets: REDACTED
sourceNode: pve
templateID: REDACTED
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: proxmox-quickstart-worker
namespace: default
spec:
template:
spec:
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
provider-id: proxmox://'{{ ds.meta_data.instance_id }}'
users:
- name: root
sshAuthorizedKeys:
- REDACTED
```
## Technical considerations
The `ProxmoxCluster` `spec.externalManagedControlPlane` value must be toggled to true.

> Currently, the said change has not yet been released by the CAPMOX project:
> to test this feature, you need to build and install from source code.

0 comments on commit d9b9220

Please sign in to comment.