Skip to content

Commit 6338a3a

Browse files
authored
Chart: Add activeDeadlineSeconds. (#13497)
1 parent 311a208 commit 6338a3a

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

charts/ingress-nginx/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ metadata:
260260
| controller.admissionWebhooks.certManager.rootCert.duration | string | `""` | |
261261
| controller.admissionWebhooks.certManager.rootCert.revisionHistoryLimit | int | `0` | Revision history limit of the root certificate. Ref.: https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.CertificateSpec |
262262
| controller.admissionWebhooks.certificate | string | `"/usr/local/certificates/cert"` | |
263+
| controller.admissionWebhooks.createSecretJob.activeDeadlineSeconds | int | `0` | Deadline in seconds for the job to complete. Must be greater than 0 to enforce. If unset or 0, no deadline is enforced. |
263264
| controller.admissionWebhooks.createSecretJob.name | string | `"create"` | |
264265
| controller.admissionWebhooks.createSecretJob.resources | object | `{}` | |
265266
| controller.admissionWebhooks.createSecretJob.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}}` | Security context for secret creation containers |
@@ -290,6 +291,7 @@ metadata:
290291
| controller.admissionWebhooks.patch.serviceAccount.create | bool | `true` | Create a service account or not |
291292
| controller.admissionWebhooks.patch.serviceAccount.name | string | `""` | Custom service account name |
292293
| controller.admissionWebhooks.patch.tolerations | list | `[]` | |
294+
| controller.admissionWebhooks.patchWebhookJob.activeDeadlineSeconds | int | `0` | Deadline in seconds for the job to complete. Must be greater than 0 to enforce. If unset or 0, no deadline is enforced. |
293295
| controller.admissionWebhooks.patchWebhookJob.name | string | `"patch"` | |
294296
| controller.admissionWebhooks.patchWebhookJob.resources | object | `{}` | |
295297
| controller.admissionWebhooks.patchWebhookJob.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}}` | Security context for webhook patch containers |

charts/ingress-nginx/templates/admission-webhooks/job-patch/job-createSecret.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ metadata:
1818
{{- end }}
1919
spec:
2020
ttlSecondsAfterFinished: 0
21+
{{- if gt (int .Values.controller.admissionWebhooks.createSecretJob.activeDeadlineSeconds) 0 }}
22+
activeDeadlineSeconds: {{ .Values.controller.admissionWebhooks.createSecretJob.activeDeadlineSeconds }}
23+
{{- end }}
2124
template:
2225
metadata:
2326
name: {{ include "ingress-nginx.admissionWebhooks.createSecretJob.fullname" . }}

charts/ingress-nginx/templates/admission-webhooks/job-patch/job-patchWebhook.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ metadata:
1818
{{- end }}
1919
spec:
2020
ttlSecondsAfterFinished: 0
21+
{{- if gt (int .Values.controller.admissionWebhooks.patchWebhookJob.activeDeadlineSeconds) 0 }}
22+
activeDeadlineSeconds: {{ .Values.controller.admissionWebhooks.patchWebhookJob.activeDeadlineSeconds }}
23+
{{- end }}
2124
template:
2225
metadata:
2326
name: {{ include "ingress-nginx.admissionWebhooks.patchWebhookJob.fullname" . }}

charts/ingress-nginx/tests/admission-webhooks/job-patch/job-createSecret_test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,11 @@ tests:
1010
- equal:
1111
path: spec.template.spec.automountServiceAccountToken
1212
value: false
13+
14+
- it: should create a Job with `activeDeadlineSeconds` if `controller.admissionWebhooks.createSecretJob.activeDeadlineSeconds ` is set
15+
set:
16+
controller.admissionWebhooks.createSecretJob.activeDeadlineSeconds: 1
17+
asserts:
18+
- equal:
19+
path: spec.activeDeadlineSeconds
20+
value: 1

charts/ingress-nginx/tests/admission-webhooks/job-patch/job-patchWebhook_test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,11 @@ tests:
1010
- equal:
1111
path: spec.template.spec.automountServiceAccountToken
1212
value: false
13+
14+
- it: should create a Job with `activeDeadlineSeconds` if `controller.admissionWebhooks.patchWebhookJob.activeDeadlineSeconds ` is set
15+
set:
16+
controller.admissionWebhooks.patchWebhookJob.activeDeadlineSeconds: 1
17+
asserts:
18+
- equal:
19+
path: spec.activeDeadlineSeconds
20+
value: 1

charts/ingress-nginx/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,8 @@ controller:
776776
type: ClusterIP
777777
createSecretJob:
778778
name: create
779+
# -- Deadline in seconds for the job to complete. Must be greater than 0 to enforce. If unset or 0, no deadline is enforced.
780+
activeDeadlineSeconds: 0
779781
# -- Security context for secret creation containers
780782
securityContext:
781783
runAsNonRoot: true
@@ -797,6 +799,8 @@ controller:
797799
# memory: 20Mi
798800
patchWebhookJob:
799801
name: patch
802+
# -- Deadline in seconds for the job to complete. Must be greater than 0 to enforce. If unset or 0, no deadline is enforced.
803+
activeDeadlineSeconds: 0
800804
# -- Security context for webhook patch containers
801805
securityContext:
802806
runAsNonRoot: true

0 commit comments

Comments
 (0)