Skip to content

Commit 0494831

Browse files
Let every Helm chart container set resource requests and limits
Clusters with an admission policy that requires requests and limits rejected the substrate install, because most containers set neither. Each container in the chart now has a `resources` value with requests and limits, for example `ateApi.resources` and `atenetRouter.agentgateway.resources`. The fixed requests on atelet and tls-reloader are now values too. manifests/ate-install/rustfs.yaml is regenerated from the chart. The defaults come from a 10 minute load on kind: about 1000 req/s through the router and one actor suspend or resume each second. No container went above its limits. atelet's working set grew to 195 MiB, so it requests 256Mi, up from 128Mi. The router's agentgateway used about 270m CPU, so it requests 100m. The other containers used 3 to 10 times less than their requests. Those requests stay, because a small actor on kind shows only the minimum use. Signed-off-by: Danielle Mustillo <danielle.mustillo@solo.io>
1 parent b818508 commit 0494831

12 files changed

Lines changed: 138 additions & 6 deletions

‎charts/substrate/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ See `values.yaml` for the full set; the important keys:
4747
| `postgres.ownerRole` | `postgres` | Role assumed by migration and partition maintenance connections |
4848
| `postgres.schema` | `public` | Store the Substrate tables in this PostgreSQL schema |
4949
| `postgres.storageSize` | `1Gi` | In-cluster PostgreSQL PVC size |
50+
| `<component>.resources` | see `values.yaml` | Requests and limits for each container. Every container has a value, e.g. `ateApi.resources` and `atenetRouter.agentgateway.resources` |
5051
| `rustfs.enabled` | `true` | Deploy an in-cluster S3-compatible RustFS bucket for snapshots |
5152
| `atelet.storageBackend` | `s3` | Default snapshot backend, wired to RustFS when `rustfs.enabled=true` |
5253
| `atelet.imageCredentialProviderConfig` | `""` | Host path to the kubelet credential provider config; set together with the bin directory |

‎charts/substrate/templates/ate-api-server.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ spec:
8181
containers:
8282
- name: ate-api-server
8383
image: {{ include "substrate.componentImage" (list "ateapi" .) }}
84+
resources:
85+
{{ toYaml .Values.ateApi.resources | indent 10 }}
8486
args:
8587
- "--grpc-listen-addr=0.0.0.0:443"
8688
- "--grpc-server-cred-bundle=/run/servicedns.podcert.ate.dev/credential-bundle.pem"

‎charts/substrate/templates/ate-controller.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ spec:
7171
containers:
7272
- name: ate-controller
7373
image: {{ include "substrate.componentImage" (list "atecontroller" .) }}
74+
resources:
75+
{{ toYaml .Values.ateController.resources | indent 10 }}
7476
args:
7577
# The atecontroller binary defaults --ateapi-conn-spec to
7678
# dns:///api.ate-system.svc:443, which is correct only for the

‎charts/substrate/templates/atelet.yaml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ spec:
143143
add:
144144
- DAC_OVERRIDE
145145
resources:
146-
requests:
147-
cpu: 50m
148-
memory: 128Mi
146+
{{ toYaml .Values.atelet.resources | indent 10 }}
149147
env:
150148
- name: NODE_NAME
151149
valueFrom:

‎charts/substrate/templates/atenet-egress.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ spec:
137137
containers:
138138
- name: agentgateway
139139
image: {{ include "substrate.thirdPartyImage" (list .Values.images.agentgateway .) }}
140+
resources:
141+
{{ toYaml .Values.atenetEgress.agentgateway.resources | indent 10 }}
140142
args:
141143
- -f
142144
- /etc/agentgateway/config.yaml
@@ -179,6 +181,8 @@ spec:
179181
readOnly: true
180182
- name: ext-proc
181183
image: {{ include "substrate.componentImage" (list "atenet" .) }}
184+
resources:
185+
{{ toYaml .Values.atenetEgress.extProc.resources | indent 10 }}
182186
args:
183187
- router
184188
- --mode=egress

‎charts/substrate/templates/atenet-router.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ spec:
179179
containers:
180180
- name: atenet-router
181181
image: {{ include "substrate.componentImage" (list "atenet" .) }}
182+
resources:
183+
{{ toYaml .Values.atenetRouter.resources | indent 10 }}
182184
args:
183185
- "router"
184186
- "--mode=ingress"
@@ -225,6 +227,8 @@ spec:
225227
- { name: podidentity, mountPath: /run/podidentity.podcert.ate.dev, readOnly: true }
226228
- name: agentgateway
227229
image: {{ include "substrate.thirdPartyImage" (list .Values.images.agentgateway .) }}
230+
resources:
231+
{{ toYaml .Values.atenetRouter.agentgateway.resources | indent 10 }}
228232
args:
229233
- "-f"
230234
- "/etc/agentgateway/config.yaml"

‎charts/substrate/templates/k8s-credential-provider.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ spec:
7575
containers:
7676
- name: k8s-credential-provider
7777
image: {{ include "substrate.componentImage" (list "kubernetes-secrets" .) }}
78+
resources:
79+
{{ toYaml .Values.credentialProvider.resources | indent 10 }}
7880
imagePullPolicy: {{ include "substrate.imagePullPolicy" . }}
7981
args:
8082
- "--listen-address=:50051"

‎charts/substrate/templates/pod-certificate-controller.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ spec:
143143
containers:
144144
- name: controller
145145
image: {{ include "substrate.componentImage" (list "podcertcontroller" .) }}
146+
resources:
147+
{{ toYaml .Values.podCertificateController.resources | indent 10 }}
146148
args:
147149
- --in-cluster=true
148150
- --sharding-pod-namespace=$(POD_NAMESPACE)

‎charts/substrate/templates/postgres.yaml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ spec:
142142
- name: socket
143143
mountPath: /var/run/postgresql
144144
resources:
145-
requests:
146-
cpu: 10m
147-
memory: 32Mi
145+
{{ toYaml .Values.postgres.tlsReloader.resources | indent 10 }}
148146
{{- with include "substrate.imagePullSecrets" . }}{{- . | nindent 6 }}{{- end }}
149147
containers:
150148
- name: postgres

‎charts/substrate/templates/rustfs.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ spec:
6767
containers:
6868
- name: rustfs
6969
image: {{ include "substrate.thirdPartyImage" (list .Values.images.rustfs .) }}
70+
resources:
71+
{{ toYaml .Values.rustfs.resources | indent 10 }}
7072
imagePullPolicy: {{ include "substrate.imagePullPolicy" . }}
7173
ports:
7274
- containerPort: 9000
@@ -108,6 +110,8 @@ spec:
108110
containers:
109111
- name: create-bucket
110112
image: {{ include "substrate.thirdPartyImage" (list .Values.images.awsCli .) }}
113+
resources:
114+
{{ toYaml .Values.rustfs.bucketInit.resources | indent 10 }}
111115
env:
112116
- name: AWS_ACCESS_KEY_ID
113117
value: {{ .Values.rustfs.accessKey | quote }}

0 commit comments

Comments
 (0)