Skip to content

Commit 243d20e

Browse files
fix(cluster-api): fix kamaji OOM and set limits on unset providers (#2708)
## What this PR does Fixes resource specs on CAPI provider pods in `cozy-cluster-api`. **Kamaji control-plane-provider — fix OOMKilled crashloop.** The override in `packages/system/capi-providers-cpprovider/templates/providers.yaml` targeted `containers[name=manager]`, but the upstream container in `docker.io/clastix/cluster-api-control-plane-provider-kamaji` is named `controller`. The CAPI operator merges container overrides by container name, so the intended `cpu: 1 / memory: 1024Mi` limits were silently dropped and the upstream default of `memory: 128Mi` was used. The kamaji controller pod therefore restarts repeatedly with `exit code 137` (OOMKilled), even at idle. **Core / bootstrap / kubevirt providers — add limits.** Upstream `*-components.yaml` for these three providers ships with no `resources:` block, and cozystack added no override. The pods run BestEffort and are first to evict under memory pressure. Set modest limits (`500m / 256Mi`) and requests (`10m / 64Mi`) matching typical CAPI controller-manager footprint. ### Release note ```release-note fix(cluster-api): fix the resource override for the kamaji control-plane-provider (was silently ignored due to a wrong container name, causing OOMKilled restarts) and set requests/limits for the core, kubeadm-bootstrap, and kubevirt-infrastructure providers (were running BestEffort). ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated provider deployment configurations to establish resource management parameters (CPU/memory requests and limits) for container deployments across multiple provider types, improving scheduling optimization and resource predictability * Standardized container naming conventions in provider templates for consistency <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/cozystack/cozystack/pull/2708?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 4516fa5 + 6ae66f7 commit 243d20e

4 files changed

Lines changed: 31 additions & 1 deletion

File tree

‎packages/system/capi-providers-bootstrap/templates/providers.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@ spec:
99
selector:
1010
matchLabels:
1111
bootstrap-components: cozy
12+
deployment:
13+
containers:
14+
- name: manager
15+
resources:
16+
limits:
17+
cpu: 500m
18+
memory: 256Mi
19+
requests:
20+
cpu: 10m
21+
memory: 64Mi

‎packages/system/capi-providers-core/templates/providers.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,13 @@ spec:
1010
selector:
1111
matchLabels:
1212
core-components: cozy
13+
deployment:
14+
containers:
15+
- name: manager
16+
resources:
17+
limits:
18+
cpu: 500m
19+
memory: 256Mi
20+
requests:
21+
cpu: 10m
22+
memory: 64Mi

‎packages/system/capi-providers-cpprovider/templates/providers.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
cp-components: cozy
1212
deployment:
1313
containers:
14-
- name: manager
14+
- name: controller
1515
resources:
1616
limits:
1717
cpu: "1"

‎packages/system/capi-providers-infraprovider/templates/providers.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@ spec:
99
selector:
1010
matchLabels:
1111
infraprovider-components: cozy
12+
deployment:
13+
containers:
14+
- name: manager
15+
resources:
16+
limits:
17+
cpu: 500m
18+
memory: 256Mi
19+
requests:
20+
cpu: 10m
21+
memory: 64Mi

0 commit comments

Comments
 (0)