Skip to content

Commit c3afc63

Browse files
IvanHuntersmyasnikovdaniil
authored andcommitted
fix(cert-manager): raise cainjector memory limit to unblock caBundle injection
cainjector loads all ValidatingWebhookConfigurations, APIServices and CRDs into its informer caches at startup. On a full cozystack install that working set exceeds the 128Mi limit, so the single leader-elected cainjector Pod is OOMKilled during cache population and CrashLoops before it injects any caBundle. Webhook ValidatingWebhookConfigurations then keep an empty caBundle and every admission call fails with "x509: certificate signed by unknown authority" (failurePolicy: Fail), intermittently blocking Ingress creation and stalling tenant installs. Raise the cainjector memory limit to 512Mi (matching the controller) and the request to 128Mi, and add a helm-unittest that pins the sizing so a blanket resource change or a `make update` cannot silently lower it again. Signed-off-by: Ivan Okhotnikov <[email protected]>
1 parent ab0f9ed commit c3afc63

3 files changed

Lines changed: 75 additions & 0 deletions

File tree

‎packages/system/cert-manager/Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ export NAMESPACE=cozy-$(NAME)
33

44
include ../../../hack/package.mk
55

6+
test:
7+
helm unittest .
8+
69
update:
710
rm -rf charts
811
helm repo add jetstack https://charts.jetstack.io
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
suite: cert-manager cainjector resources
2+
3+
# Pins the cainjector memory sizing that keeps CA injection working on a full
4+
# cozystack install. cainjector loads all ValidatingWebhookConfigurations,
5+
# APIServices and CRDs into its informer caches at startup; on a large cluster
6+
# that working set exceeds the old 128Mi limit, so the single leader-elected
7+
# cainjector Pod is OOMKilled during cache population and CrashLoops before it
8+
# ever injects a caBundle. Every webhook then keeps an empty caBundle and
9+
# admission calls fail with "x509: certificate signed by unknown authority"
10+
# (failurePolicy: Fail). This guards the override in values.yaml against a
11+
# blanket resource change or a `make update` silently lowering it again.
12+
13+
templates:
14+
- charts/cert-manager/templates/cainjector-deployment.yaml
15+
16+
release:
17+
name: cert-manager
18+
namespace: cozy-cert-manager
19+
20+
tests:
21+
- it: sizes the cainjector memory limit above the OOM floor
22+
asserts:
23+
- isKind:
24+
of: Deployment
25+
- equal:
26+
path: spec.template.spec.containers[0].resources.limits.memory
27+
value: 512Mi
28+
- equal:
29+
path: spec.template.spec.containers[0].resources.requests.memory
30+
value: 128Mi
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
cert-manager:
2+
resources:
3+
limits:
4+
cpu: 500m
5+
memory: 512Mi
6+
requests:
7+
cpu: 50m
8+
memory: 128Mi
9+
webhook:
10+
resources:
11+
limits:
12+
cpu: 200m
13+
memory: 128Mi
14+
requests:
15+
cpu: 10m
16+
memory: 32Mi
17+
cainjector:
18+
# cainjector loads all ValidatingWebhookConfigurations, APIServices and CRDs
19+
# into its informer caches at startup. On a full cozystack install that
20+
# working set exceeds 128Mi, so cainjector is OOMKilled during cache
21+
# population and CrashLoops before it ever injects a caBundle. Because it
22+
# runs as a single leader-elected replica, that stalls CA injection for the
23+
# whole cluster: webhook ValidatingWebhookConfigurations keep an empty
24+
# caBundle and every admission call fails with
25+
# "x509: certificate signed by unknown authority" (failurePolicy: Fail).
26+
# Size the limit to the controller's 512Mi and lift the request off the
27+
# OOM floor so injection completes deterministically.
28+
resources:
29+
limits:
30+
cpu: 200m
31+
memory: 512Mi
32+
requests:
33+
cpu: 10m
34+
memory: 128Mi
35+
startupapicheck:
36+
resources:
37+
limits:
38+
cpu: 100m
39+
memory: 64Mi
40+
requests:
41+
cpu: 10m
42+
memory: 16Mi

0 commit comments

Comments
 (0)