mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-06 23:23:23 +09:00
## What this PR does Updates the two vendored Cluster API providers of the Proxmox substrate: - `capi-providers-infraprovider-proxmox`: capmox **v0.7.7 → v0.9.2** - `capi-providers-ipam-in-cluster`: in-cluster IPAM **v1.0.3 → v1.1.1** Both are refreshed with the existing `make components` target (pinned SHA-256 of the release assets, `gzip -n`), and the ConfigMap name and `spec.version` move with them. The charts that render capmox objects (`kubernetes`, `kubernetes-nodes`) are not touched. A second commit raises the capmox manager memory limit from 256Mi to 512Mi (see "Found while testing"). Why: - v0.9.1 and v0.9.2 are security roll-ups (32 Go vulnerabilities in dependencies between them), and v0.9.2 fixes several provisioning races: VMID collisions, retries of the bootstrap ISO injection, waiting for the boot-disk resize and for active Proxmox tasks before changing a VM. - v0.8 introduced the `v1alpha2` API (CAPI `v1beta2` contract). It is the base for the next Proxmox changes (per-namespace hypervisor credentials, zones). **Depends on #4902.** capmox v0.9 is built against Cluster API v1.12 and declares the `v1beta2` contract; the in-cluster IPAM v1.1 needs CAPI ≥ v1.11. `main` still ships core v1.10.1, so this must not merge before #4902 (core v1.14.4, capi-operator v0.30.0). It is deliberately not stacked on that branch. Both Proxmox package sources now depend on `cozystack.capi-provider-core`, so a release carrying both PRs rolls out core first. The comments in both `providers.yaml` now say what they need. ### What changes for users - capmox serves `v1alpha1` and `v1alpha2`; `v1alpha2` becomes the storage version. Existing objects are converted by the provider's webhook; the charts keep writing `v1alpha1`, which is still served. Moving the charts to `v1alpha2` is a separate follow-up. - `kubectl get proxmoxcluster` (no version) now returns `v1alpha2`, which has no `status.ready`: tooling that reads it has to use the `Ready` condition or ask for `v1alpha1` explicitly. - Read through `v1alpha1`, an unset `spec.providerID` comes back as `""` (the `v1alpha2` field is a plain string). Nothing in Cluster API reads that version. - capmox upstream documents v0.7 → v0.8 → v0.9 as the supported path; the direct v0.7.7 → v0.9.2 jump is what was tested below. - capi-operator v0.30 (from #4902) accepts exactly one ConfigMap per provider selector. The chart renames the ConfigMap with the version, so a helm upgrade removes the old one; a hand-made install has to delete it, otherwise the operator stops upgrading every provider. ### Tested On a live management cluster with Cluster API core v1.13.7 (the #4902 versions), three Proxmox-backed tenant clusters (Talos and Kairos workers, Kamaji control planes), Proxmox VE 9.2: - Package tests: `hack/capi-provider-components_test.bats` 6/6; helm-unittest `core/platform` 285/285, `apps/kubernetes` 367/367, `apps/kubernetes-nodes` 243/243. - Before the upgrade, every live `ProxmoxCluster`, `ProxmoxMachineTemplate` and `ProxmoxMachine` (16 objects) was round-tripped through the v0.9.2 conversion functions (`v1alpha1 → v1alpha2 → v1alpha1`): specs unchanged apart from the `providerID` note above. - Upgrade IPAM then capmox through capi-operator: both `ProviderUpgraded`, CRD storage `v1alpha2`, all three `ProxmoxCluster` Ready, every existing `ProxmoxMachine` kept its VMID and provider ID, no MachineDeployment rollout, every `IPAddressClaim` bound, no reconcile errors. - Every tenant release re-applied through `v1alpha1` with a server-side dry run (conversion, webhooks, template immutability): accepted. - Live Proxmox checks (worker joined, machineconfig, guards, tenant apiserver and nodes): 23/23 on two tenants. - One worker created and deleted end to end, twice per version (seconds from the scale-up; Proxmox API calls are approximate, they include the other tenants' reconciles): | | v0.7.7 run 1 | v0.7.7 run 2 | v0.9.2 run 1 | v0.9.2 run 2 | |---|---|---|---|---| | `InfrastructureReady` (VM cloned, configured, started) | 131 s ¹ | 11 s | 26 s | 11 s | | `NodeReady` (Talos booted and joined) | 193 s ¹ | 89 s | 94 s | 89 s | | delete → Machine gone (VM destroyed) | 11 s | 16 s | 16 s | 16 s | | Proxmox API calls by the capmox token | 255 | 181 | 140 | 168 | ¹ about two minutes of this run went on waiting for the static IP from the in-cluster IPAM (v1.0.3). What we got: no latency regression. In the warm runs both versions take the same 11 s to a running VM, 89 s to a Ready node and 16 s to a destroyed VM; node readiness is dominated by the Talos boot, not by the provider. v0.9.2 made fewer Proxmox API calls per worker (140–168 vs 181–255). The count is approximate, and two runs per version is a small sample. v0.9.2 logs one transient `VM … is running - destroy failed` per deletion, and the deletion still completes in the same 16 s. ### Retest on Cluster API v1.14.4 The same management cluster now runs the #4902 head: Cluster API core and kubeadm bootstrap v1.14.4, cluster-api-operator v0.30.0, Talos bootstrap v0.6.13, with capmox v0.9.2 and in-cluster IPAM v1.1.1 from this PR. The capmox bump itself was applied while the cluster was still on core v1.13.7 (table above); the core v1.14.4 upgrade came after it, so the upgrade step was not repeated on v1.14.4. - All three `ProxmoxCluster`s are Ready and every `Machine` is Running (6 workers). The capmox manager has 0 restarts over 5 days, including the move to core v1.14.4. - One worker created and deleted end to end, twice, on the `kubernetes-px` tenant (cluster-autoscaler paused during the runs): | | v1.14.4 run 1 | v1.14.4 run 2 | |---|---|---| | `InfrastructureReady` | 11 s | 26 s | | `NodeReady` | 94 s | 99 s | | delete → Machine gone | 16 s | 16 s | The timings match the v1.13.7 runs above (11-26 s, 89-94 s, 16 s). - capmox logged the one `VM … is running - destroy failed` per deletion already noted above, plus a transient `vm not initialized` right after creation. Both cleared on their own. Not repeated on v1.14.4: the conversion round trip and the server-side dry runs of the tenant releases. capmox v0.9's compatibility table lists only Cluster API v1.11 and v1.12, so v1.14 is outside what upstream documents; the runs above are the evidence for it. ### Found while testing (not caused by this bump) capmox reads the bootstrap data Secret through the controller-runtime cached client (`MachineScope.GetBootstrapSecret`, the same in v0.7.7 and v0.9.2), so the first machine it provisions starts a cluster-wide Secret informer. On the test cluster that is 1236 Secrets / 87 MB of JSON (706 Helm release Secrets), and the manager hits the 256Mi limit set in `providers.yaml`: both v0.7.7 and v0.9.2 were `OOMKilled` while provisioning (working set up to 232–255 MiB before the kill). Each kill restarts the controller and provisioning resumes, so the runs above still completed. The second commit of this PR raises the manager limit to 512Mi (request unchanged at 64Mi), twice the last measured working set. With 512Mi, a provisioning run on the same cluster peaked at 246 MiB with no restarts. The proper fix is to read that Secret with the API reader in capmox: ionos-cloud/cluster-api-provider-proxmox#958 (open, review requested). The limit can come back down once that is released. ### Downstream repositories - [ ] No downstream repository is affected by this change - [x] [cozystack/website](https://github.com/cozystack/website) - follow-up: cozystack/website#792 - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: cozystack/website#792 adds the Proxmox substrate page to `next/` with these versions (it was only in `v1.7/`) and two troubleshooting rows from the findings above; it stays a draft until this PR is merged. Terraform and Ansible were not checked against the trigger map, so those boxes are left for a maintainer. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added IPv6 prefix pools for cluster-wide and namespace-scoped allocation. * Added configurable IP address reuse grace periods to IP pools. * **Improvements** * Updated the Proxmox infrastructure provider to v0.9.2 and the in-cluster IPAM provider to v1.1.1, with support for the v1beta2 Cluster API contract. * Increased the Proxmox provider manager’s memory limit and enabled the IPAM provider to run on master and control-plane nodes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->