47 Commits

Author SHA1 Message Date
Philipp Born
1dd236edc1 feat: add support for --diagnostics-address / --insecure-diagnostics parameters
Signed-off-by: Philipp Born <git@pborn.eu>
2025-10-30 09:57:00 +00:00
mightykhan
94a5ae243c MINOR: Remove duplicate rules to avoid validation warning when applying (#559)
* MINOR: Remove duplicate rules to avoid validation warning when applying

* optional fix for duplicate validation rule

* +optional validation should not be on type level, but field

---------

Co-authored-by: Kenneth Holm Seelig <xkhse@energinet.dk>
2025-10-24 17:39:56 +02:00
Mohamed Chiheb Ben Jemaa
9d389c200f Add missing RBAC for patching Cluster (#520) 2025-07-28 14:06:46 +02:00
Vic Kerr
2e63a10909 go: bump to 1.24 (#507)
* go: bump to 1.24

* Bump go to v1.24

* Bump dependecies

* Update e2e config

* Bump go-proxmox client to latest commit, Fixes tests, and linting

* Revert "Bump dependecies"

This reverts commit dbf1ff80ebafe4c263b61919123e547703faa7e8.

* Pin CAPI to v1.10.4 and update/fix e2e tests

* Fix unit tests

* Bump GO v1.24.5

---------

Co-authored-by: Mohamed Chiheb Ben Jemaa <mc.benjemaa@gmail.com>
2025-07-28 11:13:27 +00:00
Lukas Kirylak
679ebc101d Add support for linked clones (#478) 2025-05-09 13:36:00 +00:00
Mohamed Chiheb Ben Jemaa
b6635a09fa Add API spec for machine ip pool ref (#429)
* WIP: Add API spec for machine ip pool ref

* Adjusting code to comply with the new API

* Implement the logic for the IP Pool Ref for proxmoxmachines

* Make Default network required when setting network and add tests
2025-03-13 13:25:20 +00:00
Mohamed Chiheb Ben Jemaa
4fd0cb6c84 Add custom tags to machines (#158)
* Add custom tags to machines

* Add test cases

* Revive add tags

* Revive  tags

* Address reviews

* Remove default description

* Add kustomize when running e2e
2025-03-13 11:40:50 +00:00
Vic Kerr
de65752ea1 CAPI 1.9.5, k8s/* 0.31.6, controller-runtime 0.19.6, controller-gen 0.16.5 (#388)
* config/{crd,rbac}: regen
* bump github.com/google/cel-go to 0.20.1
* docs, e2e: bump kubernetes to 1.31.6
* */*.go: silence lint about cluster-api/errors and Failure{Message,Reason} deprecation
2025-03-12 14:39:57 +00:00
Mohamed Chiheb Ben Jemaa
74a599293b Add test for ScheduleVM (#423) 2025-02-24 13:23:31 +01:00
Philipp Born
bed7ddfbd4 fix: add tag validation to MatchTags (#410)
this fixes a small oversight in #343 and actually validates the individual tags against what is accepted by the API

https://github.com/proxmox/pve-common/blob/master/src/PVE/JSONSchema.pm#L706

```
our $PVE_TAG_RE = qr/[a-z0-9_][a-z0-9_\-\+\.]*/i;
```
2025-02-12 14:02:36 +00:00
Philipp Born
604ae96879 feat: allow vmtemplate selection based on tags (#343)
* feat: allow template selection based on tags

* `sourceNode + templateID` and `templateSelector` are mutually exclusive
* automatically detects both `sourceNode` + `templateID`
* errors out if anything but one (1) VM template with desired flags was found

* revert webhook changes

* introduce TemplateSource

* comment on TemplateSource

* add testcase for VMTemplateNotFound

* add test for SourceNode, TemplateID and TemplateSelector being unset

* revert GetNode() changes

* remove redundant TemplateSelector check

* update TemplateSelector description

* introduce ErrTemplateNotFound error

* add FindVMTemplateByTags test-case with nil vmTags

* Update api/v1alpha1/proxmoxmachine_types_test.go

Co-authored-by: Vic Kerr <wiktor.kerr@ionos.com>

* make the linter happy

* Update proxmoxmachine_types.go

* Update advanced-setups.md

* Update proxmoxmachine_types.go

* refaormat

---------

Co-authored-by: Vic Kerr <wiktor.kerr@ionos.com>
Co-authored-by: Mohamed Chiheb Ben Jemaa <mc.benjemaa@gmail.com>
2025-02-05 16:25:17 +00:00
Nico
44826ba325 Add securityContext.seccompProfile.type: RuntimeDefault to manager Deployment (#358) 2024-12-10 15:09:32 +00:00
Mohamed Chiheb Ben Jemaa
3f6355d0fd Add Option to control the injection of provider-id to metadata (#347)
* Add Option to control the injection of provider-id to metadata

* typo and more comment in the field
2024-12-05 12:52:24 +01:00
Mohamed Chiheb Ben Jemaa
acddc389ff Support Flatcar and provide ignition bootstrap data (#308)
* add metadata handling for proxmox node name

* First draft: flatcar and ignition support

* Revert "add metadata handling for proxmox node name"

This reverts commit 3dd5aae409a70da006e35c7130ca9ecc39fe73f0.

* Make The Ignition ISO able to be unmounted

* Fixes lints

* Fixes Tests

* remove unsed config and Fixes Test

* Set ipv6

* add tests

* add tests for injector

* more test coverage

* Fix lint

* Provide a correct cluster template

* Provide docs on how to provision cluster with flatcar

* Address reviews

* Update envtest

* Address reviwes and try e2e test with skip label

* Implement networkd config units with VRFs

* Tidy

* E2e test for flatcar

* Use correct template for flatcar

* Add more tests

* Simpler units name

* add comment for netdev index

* Address reviews

* remove uncessary variable

* Add note about EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION

* Address reviews

* Change ignition docs

* Remove quotes

* pkg/ignition/network.go: fix VRF routing rules policy table, add tests

---------

Co-authored-by: tuunit <jan@larwig.com>
Co-authored-by: Felix Wischke (65278) <felix@zeynix.de>
2024-12-05 12:12:11 +01:00
Nico
5f3ba2f72b feat: Add ability to specify range of VM IDs to use (#286)
* Return VMIDFreeErr or the error object itself if CheckID returns true/an error

* Rename VMIDFreeErr to ErrVMIDFree and fix comment to make linter happy

* feat: Add ability to specify range of VM IDs to use

* Fix codespell error: fix spelling

* When checking if a vmid is free, first check the existing ProxmoxMachines before querying the Proxmox API.

* Check that the vmid of the Proxmox machine is set (not -1) before adding it to usedVMIDs

* Move spec.vmidRange from ProxmoxCluster to ProxmoxMachine

* Update github.com/luthermonson/go-proxmox to v0.2.0

* Revert "Update github.com/luthermonson/go-proxmox to v0.2.0"

This reverts commit c5d15e56ef7c61ab884c3726e2e9707ba8038a27.

Because of this bug https://github.com/luthermonson/go-proxmox/pull/169

* Update github.com/luthermonson/go-proxmox to v0.2.1

* Add test for ClusterScope.ListProxmoxMachinesForCluster

* Fix wording in ProxmoxMachine types test

* Rename vmidRange to vmIDRange to follow k8s API conventions

* Add validation for vmIDRange: end should be greater than or equal to start

* Set failureMessage and failureReason when ErrNoVMIDInRangeFree is thrown

* Refactor getVMID to improve code quality

---------

Co-authored-by: Mohamed Chiheb Ben Jemaa <mc.benjemaa@gmail.com>
2024-12-05 09:58:23 +00:00
Dario Tranchitella
c8cc3a4ce1 feat: support for externally managed control plane (#106)
* feat: support for externally managed control plane

Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>

* proxmoxcluster_controller.go: check for nil ControlPlaneEnpoint

* gofmt -s

---------

Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
Co-authored-by: Vic Kerr <wiktor.kerr@ionos.com>
2024-11-04 15:27:55 +00:00
Endre Karlson
0d011ceb1c Support toggling provisioning checks (#290)
* Support toggling provisioning checks

Signed-off-by: ekarlso <endre.karlson@gmail.com>

* Generate descriptions

Signed-off-by: ekarlso <endre.karlson@gmail.com>

* Fix tests

Signed-off-by: ekarlso <endre.karlson@gmail.com>

---------

Signed-off-by: ekarlso <endre.karlson@gmail.com>
2024-10-13 14:56:40 +02:00
Erwin Kok
7d9b12bce9 Adding Finalizer on Secret (#279)
* Bumped some versions as the controller-gen crashed

* Added ProxmoxClusterTemplate properly

* Proper alignment //+kubebuilder, and provide annotatons as specified by spec

* Added concurrency to controllers. Added constructors to controllers

* Added capiflags

* metrics-bind-address is obsolete. Use diagnostics address

* Add finalizer on secret

* Cleanup to minimize differences

* Processing review feedback

* Processing feedback

* Update

* Processing feedback

* Fixing tests

* Update

* Delete capi cluster first

* Processing review feedback

* Renamed test context

* Processing review feedback: solve linting issues

---------

Co-authored-by: Mohamed Chiheb Ben Jemaa <mc.benjemaa@gmail.com>
2024-10-09 18:14:54 +00:00
Vic Kerr
e585c6d89a Bump go to 1.22
Plus relevant dependency updates.

fix #187
2024-08-20 10:27:56 +00:00
Mohamed Chiheb Ben Jemaa
4821298e4a USe cluster namespace if no namespace provided in credentials Ref (#248)
* USe cluster namespace if no namespace provided in credentials Ref

* Add note regarding secret Ref namespace
2024-06-26 11:06:27 +00:00
Felix Wischke
1d2a859e20 api/v1alpha1/proxmoxcluster_types: validate controlplane port (#241)
* api/v1alpha1/proxmoxcluster_types: validate controlplane port

* pkg/scope/cluster: remove unused clusterScope.ControlPlaneEndpoint (make coverage happy)

* api/v1alpha1/proxmoxcluster_types: add port 0 test

---------

Co-authored-by: Felix Wischke (65278) <felix@zeynix.de>
2024-06-26 10:45:39 +00:00
Felix Wischke (65278)
f34e4dac0c add metric annotation support to IPPool objects 2024-06-06 14:57:46 +00:00
Mohamed Chiheb Ben Jemaa
74cf293378 🔥 Add external credentials (#215) 2024-06-03 16:39:53 +02:00
Vic Kerr
7a8c9e0285 config/crd: regenerate 2024-04-16 14:25:20 +00:00
Felix Wischke (65278)
76f1061343 cloudinit/network_test: test cases for newly added interface config 2024-04-16 14:25:20 +00:00
Felix Wischke (65278)
22bcd1f576 bootstrap_test: testcases for getCommonInterfaceConfig 2024-04-16 14:25:20 +00:00
Felix Wischke (65278)
9cb60ac7ec unify FIB spelling 2024-04-16 14:25:20 +00:00
Felix Wischke (65278)
c575eaa0a5 api/v1alpha1/proxmoxmachine_types: netplan lied about common interface settings 2024-04-16 14:25:20 +00:00
Felix Wischke (65278)
e00c558ad7 api/v1alpha1/proxmoxmachine_types: introduce per linkMTU 2024-04-16 14:25:20 +00:00
Felix Wischke (65278)
14d30499b3 api/v1alpha/proxmoxmachine_types: refactor networking to share features 2024-04-16 14:25:20 +00:00
Vic Kerr
e60da87019 config/crd/bases/: regenerate 2024-04-16 12:40:35 +00:00
Felix Wischke (65278)
95f6fd1825 cluster-class: add missing vlans to crds 2024-04-16 12:40:35 +00:00
Felix Wischke (65278)
47d174504f config/rbac: remove clusterclass controller from rbac 2024-04-16 12:40:35 +00:00
Felix Wischke (65278)
b35a8b2bc9 clusterClass: add loadbalancers 2024-04-16 12:40:35 +00:00
Felix Wischke (65278)
964085d481 config/crd/kustomization.yaml: add proxmoxclustertemplates 2024-04-16 12:40:35 +00:00
Felix Wischke (65278)
594a469f28 clusterClass: add no-cni and calico 2024-04-16 12:40:35 +00:00
Felix Wischke (65278)
17d5bd189c clusterClass: rework cluster to hold proxmox machine data 2024-04-16 12:40:35 +00:00
Felix Wischke (65278)
ce60cfc894 cluster-class-cilium: initial commit 2024-04-16 12:40:35 +00:00
Mario Valderrama
cf7fcb5cc1 docs: Adjust CRD field comments (#167)
* docs: Adjust CRD field comments

* Fix wording
2024-04-08 07:32:36 +00:00
Nicolò Ciraci
7dbe6e4ad1 feat(vlan): Add vlan tag support for VM reconcile. (#133)
* feat(vlan): Add vlan tag support for VM reconcile.

This commit implement VLAN tag support when creating - or more in general reconciling - a ProxmoxMachine. This feature implements a new optional value in the ProxmoxMachine CRS, defined in the NetworkDevice type. The value is an integer, delimited in the range 1-4094.

Tests have been also implemented to prevent regression, and e2e tests have been conducted creating both cluster using the new property and without - to check past compat.

* test(vlan): Add more testing and fix validation

* fix(test-vlan): Fix regression in test caused by a typo

* misc: Add more entry to gitignore

* refactor: Removed unused validator and refactor variable name

* refactor: Refactor variable name
2024-03-20 11:28:34 +00:00
Felix Wischke
de5099dfe1 Add VRF device to support egress gateways (#62)
* Add VRF device support

* cluster-template-cilium-load-balancer: metallb based loadbalancer nodes

* LoadBalancerNodes: Documentation

* load-balancer-nodes: taint and toleration for metallb

* cluster-template-cilium-load-balancer: force ipvs/strictARP for metallb
2024-02-13 13:53:32 +01:00
Mohamed Chiheb Ben Jemaa
c729eb7048 Add unit tests (#78)
* Add tests

* Add Comment for webhook

* Add tests

* Add minmal test for proxmoxmachine controller

* Add comment for mtu

* Rephrase special case for MTU

---------

Co-authored-by: Mario Valderrama <mario.valderrama@ionos.com>
2024-01-25 15:25:13 +00:00
Vic Kerr
be44ee3997 config: remove useless TODOs
These TODOs are unnecessary.
2024-01-18 11:32:23 +00:00
Lucas Pape
e4a915b93e feat: implement setting mtu for virtio network device (#42)
* feat: implement setting mtu for virtio network device

See https://git.proxmox.com/?p=qemu-server.git;a=commit;h=61a14cde8d568e552d3deaab2da76b479b8aca7b

* fix: split extractNetworkModelAndBridge into multiple functions

* fix: set maximum mtu to 65520

* test: should not allow mtu less than 1 or more than 65520

* feat: add validating webhook for proxmoxmachine

* fix: remove default mtu
2024-01-08 16:38:41 +01:00
Philipp Born
ccbae163ba feat(scheduler): allow for node overprovisioning (#47)
`ProxmoxCluster.spec.SchedulerHints.MemoryAdjustment=300` allows to (theoretically) allocate 300% of a host's memory for VMs (use with caution - enabling memory ballooning highly recommended)
`ProxmoxCluster.spec.SchedulerHints.MemoryAdjustment=95` allows to limit memory allocation to 95% of a host's memory
`ProxmoxCluster.spec.SchedulerHints.MemoryAdjustment=0` entirely disables scheduling memory constraints
2023-12-21 15:49:15 +00:00
Philipp Born
34b8760287 manifests: remove command parameter from container (#33) 2023-12-14 15:13:08 +00:00
Vic Kerr
45f5888c41 Initial open source release
Co-authored-by: Felix Wischke <felix.wischke@ionos.com>
Co-authored-by: Jonas Bender <90411737+jonas-be@users.noreply.github.com>
Co-authored-by: Ludwig Bedacht <132355999+lubedacht@users.noreply.github.com>
Co-authored-by: Mario Valderrama <15158349+avorima@users.noreply.github.com>
Co-authored-by: Mohamed Chiheb Ben jemaa <mohamed-chiheb.ben-jemaa@ionos.com>
Co-authored-by: Vic Kerr <318870+wikkyk@users.noreply.github.com>
2023-11-29 14:17:03 +00:00