Commit Graph

40 Commits

Author SHA1 Message Date
Vic Kerr
690c13ee05 update copyright 2024-12-05 13:45:51 +01: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
Vic Kerr
1e604723ce port "pkg/proxmox/goproxmox: test coverage" 2024-11-12 11:52:49 +01:00
Felix Wischke (65278)
44c7cb5985 pkg/proxmox/goproxmox: test coverage 2024-11-12 11:52:49 +01:00
Mohamed Chiheb Ben Jemaa
a67b48d0e8 fix/cluster state failed reconcile (#317)
* Fix Cluster state failed when controller restarted with proper credentials

* Refactor the code
2024-10-31 12:51:06 +01: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
Endre Karlson
3644c4671c cloud-init: Add provider-id to metadata (#292)
Some operating system(s) like Talos use provider-id for their
cloud-provider implementation in the format of <provider>://<id>
to be picked up by the cloud-init impl. Having it available is pretty standard.

Signed-off-by: ekarlso <endre.karlson@gmail.com>
Co-authored-by: Mohamed Chiheb Ben Jemaa <mc.benjemaa@gmail.com>
2024-10-09 17:38:15 +00:00
Nico
1905624a0e Check if VM exists before deletion (#278) 2024-09-03 19:53:03 +02: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
Vic Kerr
3b6ff286d9 mock: regenerate 2024-06-12 09:29:31 +00:00
Vic Kerr
7e0c864676 misc: update copyright dates for 2024 2024-06-07 10:21:14 +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
43fe9fff17 misc: update copyright dates for 2024 2024-04-19 14:33:20 +00:00
Mohamed Chiheb Ben Jemaa
d8c09291f8 Check cloud-init status as part of machine provisioning (#166)
* Check cloud-init status and throw error state if cloud-init fails
2024-04-19 11:16:07 +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)
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
Felix Wischke (65278)
fac5f9c7cd cloudinit: fix multiple vrf device templating 2024-04-03 10:42:09 +02:00
Mohamed Chiheb Ben Jemaa
2513b6cde5 Unmount and deletes the cloudinit iso (#154) 2024-03-26 12:37:52 +01:00
Mohamed Chiheb Ben Jemaa
d0640dd29a Upgrade ipam to 0.1.0 and capi to 1.6.3 (#138)
* Upgrade ipam to 0.1.0 and capi to 1.6.3

* Update

* Fix circular dependency

* remove ipam deps from api pkg

* Update e2e tests

* Fix deps

* Rename Type

* Update godoc
2024-03-21 15:07:28 +01:00
Nicolò Ciraci
a745a6a242 feat(gateway-optional): This commit makes gw definition optional for additionalNetworkDevices (#130)
* feat(gateway-optional): This commit makes gw definition optional for additionalNetworkDevices

There is no need to have a mandatory gateway for secondary network interfaces, this commit edits the validation and go template that is in charge of generating the cloudinit files.

* fix(tests): Fix regression in test

* test: Add testing for noGW feature

---------

Co-authored-by: Mohamed Chiheb Ben Jemaa <mc.benjemaa@gmail.com>
2024-03-14 16:26:26 +00:00
Vic Kerr
a31de6ca05 misc: update copyright dates for 2024 2024-02-20 15:31:54 +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
Lucas Pape
830e3867e0 fix(cloudinit): wrap gateway6 in quotation marks (#79) 2024-01-24 11:47:38 +01:00
dependabot[bot]
0ea3ac1a8c Bump sigs.k8s.io/cluster-api from 1.5.0 to 1.6.1 (#18)
* Bump sigs.k8s.io/cluster-api from 1.5.0 to 1.6.0

Bumps [sigs.k8s.io/cluster-api](https://github.com/kubernetes-sigs/cluster-api) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/kubernetes-sigs/cluster-api/releases)
- [Commits](https://github.com/kubernetes-sigs/cluster-api/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/cluster-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Adjust code to capi 1.6 and k8s 1.28

* Update to v1.6.1

* Fix link

* Rollback metrics bind address

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mohamed Chiheb Ben Jemaa <mc.benjemaa@gmail.com>
2024-01-23 15:23:40 +00: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
Mohamed Chiheb Ben Jemaa
5e2c0b65cd Adjust cloudinit to support dhcp (#44)
* Adjust cloudinit to support dhcp

* simpler

* Remove duplicated test
2023-12-20 14:53:14 +01:00
Philipp Born
db7ace8c38 fix: exclude VM templates and include containers when calculating a host's reserveable memory (#40)
Previously, it was only checked for VMs, without taking their Template status into consideration. (A Template VM can't be started, without explicitly removing the flag.). Existing LXCs on a host weren't taken into consideration either.

Now, we'll no longer include VM Template in our calculations. But in exchange we include LXCs now.

Fixes #36.
2023-12-18 10:19:50 +01:00
Philipp Born
a1666e478f fix: prevent deletion attempts for non-existent vmID -1 (#38)
Fixes #31.

Signed-off-by: Philipp Born <98814235+pborn-ionos@users.noreply.github.com>
2023-12-16 19:53:09 +01:00
Philipp Born
5f6d700a2d fix cloud-init default routes (#34) 2023-12-15 20:27:08 +01:00
Mohamed Chiheb Ben Jemaa
1b0555f0d3 Fixes pause of IPAddressClaim (#28)
* Fixes pause of IPAddressClaim

* Use root cluster name
2023-12-14 13:18:02 +01: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