Skip to content

Commit

Permalink
Helm - Enable configuring request and limit for containers in webhook…
Browse files Browse the repository at this point in the history
… jobs (kubernetes#7434)

* helm: add feature to configure request and limit for container in createSecret and patchWebhook job

Signed-off-by: Bhumij Gupta <[email protected]>

* Remove empty line in helm template

Signed-off-by: Bhumij Gupta <[email protected]>

* Add test for admission webhook job container resources

Signed-off-by: Bhumij Gupta <[email protected]>

* Add new line character at the end of charts ci file

Signed-off-by: Bhumij Gupta <[email protected]>
  • Loading branch information
bhumijgupta authored and rchshld committed May 17, 2023
1 parent 4cc87a2 commit 97a0cf0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/ingress-nginx/ci/deployment-webhook-resources-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
controller:
service:
type: ClusterIP
admissionWebhooks:
enabled: true
createSecretJob:
resources:
limits:
cpu: 10m
memory: 20Mi
requests:
cpu: 10m
memory: 20Mi
patchWebhookJob:
resources:
limits:
cpu: 10m
memory: 20Mi
requests:
cpu: 10m
memory: 20Mi
patch:
enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.controller.admissionWebhooks.createSecretJob.resources }}
resources: {{ toYaml .Values.controller.admissionWebhooks.createSecretJob.resources | nindent 12 }}
{{- end }}
restartPolicy: OnFailure
serviceAccountName: {{ include "ingress-nginx.fullname" . }}-admission
{{- if .Values.controller.admissionWebhooks.patch.nodeSelector }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.controller.admissionWebhooks.patchWebhookJob.resources }}
resources: {{ toYaml .Values.controller.admissionWebhooks.patchWebhookJob.resources | nindent 12 }}
{{- end }}
restartPolicy: OnFailure
serviceAccountName: {{ include "ingress-nginx.fullname" . }}-admission
{{- if .Values.controller.admissionWebhooks.patch.nodeSelector }}
Expand Down
12 changes: 12 additions & 0 deletions charts/ingress-nginx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,18 @@ controller:
servicePort: 443
type: ClusterIP

createSecretJob:
resources: {}
# limits:
# cpu: 10m
# memory: 20Mi
# requests:
# cpu: 10m
# memory: 20Mi

patchWebhookJob:
resources: {}

patch:
enabled: true
image:
Expand Down

0 comments on commit 97a0cf0

Please sign in to comment.