Skip to content

Commit 9f7f39c

Browse files
ab-andrescsalonichf5
authored andcommitted
gives enough time for argocd to verify job has finished (#3487)
Problem: Argocd can never find the job completion as TTL is set to 0 Solution: Sets the default ttl seconds to 30 so that argocd has enough time to verify.
1 parent 179a5ea commit 9f7f39c

File tree

13 files changed

+95
-22
lines changed

13 files changed

+95
-22
lines changed

charts/nginx-gateway-fabric/README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,19 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
252252

253253
| Key | Description | Type | Default |
254254
|-----|-------------|------|---------|
255-
| `certGenerator` | The certGenerator section contains the configuration for the cert-generator Job. | object | `{"agentTLSSecretName":"agent-tls","annotations":{},"overwrite":false,"serverTLSSecretName":"server-tls"}` |
255+
| `certGenerator` | The certGenerator section contains the configuration for the cert-generator Job. | object | `{"affinity":{},"agentTLSSecretName":"agent-tls","annotations":{},"nodeSelector":{},"overwrite":false,"serverTLSSecretName":"server-tls","tolerations":[],"topologySpreadConstraints":[],"ttlSecondsAfterFinished":30}` |
256+
| `certGenerator.affinity` | The affinity of the cert-generator pod. | object | `{}` |
256257
| `certGenerator.agentTLSSecretName` | The name of the base Secret containing TLS CA, certificate, and key for the NGINX Agent to securely communicate with the NGINX Gateway Fabric control plane. Must exist in the same namespace that the NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway). | string | `"agent-tls"` |
257258
| `certGenerator.annotations` | The annotations of the cert-generator Job. | object | `{}` |
259+
| `certGenerator.nodeSelector` | The nodeSelector of the cert-generator pod. | object | `{}` |
258260
| `certGenerator.overwrite` | Overwrite existing TLS Secrets on startup. | bool | `false` |
259261
| `certGenerator.serverTLSSecretName` | The name of the Secret containing TLS CA, certificate, and key for the NGINX Gateway Fabric control plane to securely communicate with the NGINX Agent. Must exist in the same namespace that the NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway). | string | `"server-tls"` |
262+
| `certGenerator.tolerations` | Tolerations for the cert-generator pod. | list | `[]` |
263+
| `certGenerator.topologySpreadConstraints` | The topology spread constraints for the cert-generator pod. | list | `[]` |
264+
| `certGenerator.ttlSecondsAfterFinished` | How long to wait after the cert generator job has finished before it is removed by the job controller. | int | `30` |
260265
| `clusterDomain` | The DNS cluster domain of your Kubernetes cluster. | string | `"cluster.local"` |
261266
| `gateways` | A list of Gateway objects. View https://gateway-api.sigs.k8s.io/reference/spec/#gateway for full Gateway reference. | list | `[]` |
262-
| `nginx` | The nginx section contains the configuration for all NGINX data plane deployments installed by the NGINX Gateway Fabric control plane. | object | `{"config":{},"container":{},"debug":false,"image":{"pullPolicy":"IfNotPresent","repository":"ghcr.io/nginx/nginx-gateway-fabric/nginx","tag":"2.0.0"},"imagePullSecret":"","imagePullSecrets":[],"kind":"deployment","plus":false,"pod":{},"replicas":1,"service":{"externalTrafficPolicy":"Local","loadBalancerClass":"","loadBalancerIP":"","loadBalancerSourceRanges":[],"nodePorts":[],"type":"LoadBalancer"},"usage":{"caSecretName":"","clientSSLSecretName":"","endpoint":"","resolver":"","secretName":"nplus-license","skipVerify":false}}` |
267+
| `nginx` | The nginx section contains the configuration for all NGINX data plane deployments installed by the NGINX Gateway Fabric control plane. | object | `{"config":{},"container":{},"debug":false,"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric/nginx","tag":"edge"},"imagePullSecret":"","imagePullSecrets":[],"kind":"deployment","plus":false,"pod":{},"replicas":1,"service":{"externalTrafficPolicy":"Local","loadBalancerClass":"","loadBalancerIP":"","loadBalancerSourceRanges":[],"nodePorts":[],"type":"LoadBalancer"},"usage":{"caSecretName":"","clientSSLSecretName":"","endpoint":"","resolver":"","secretName":"nplus-license","skipVerify":false}}` |
263268
| `nginx.config` | The configuration for the data plane that is contained in the NginxProxy resource. This is applied globally to all Gateways managed by this instance of NGINX Gateway Fabric. | object | `{}` |
264269
| `nginx.container` | The container configuration for the NGINX container. This is applied globally to all Gateways managed by this instance of NGINX Gateway Fabric. | object | `{}` |
265270
| `nginx.debug` | Enable debugging for NGINX. Uses the nginx-debug binary. The NGINX error log level should be set to debug in the NginxProxy resource. | bool | `false` |
@@ -283,7 +288,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
283288
| `nginx.usage.resolver` | The nameserver used to resolve the NGINX Plus usage reporting endpoint. Used with NGINX Instance Manager. | string | `""` |
284289
| `nginx.usage.secretName` | The name of the Secret containing the JWT for NGINX Plus usage reporting. Must exist in the same namespace that the NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway). | string | `"nplus-license"` |
285290
| `nginx.usage.skipVerify` | Disable client verification of the NGINX Plus usage reporting server certificate. | bool | `false` |
286-
| `nginxGateway` | The nginxGateway section contains configuration for the NGINX Gateway Fabric control plane deployment. | object | `{"affinity":{},"config":{"logging":{"level":"info"}},"configAnnotations":{},"extraVolumeMounts":[],"extraVolumes":[],"gatewayClassAnnotations":{},"gatewayClassName":"nginx","gatewayControllerName":"gateway.nginx.org/nginx-gateway-controller","gwAPIExperimentalFeatures":{"enable":false},"image":{"pullPolicy":"IfNotPresent","repository":"ghcr.io/nginx/nginx-gateway-fabric","tag":"2.0.0"},"kind":"deployment","labels":{},"leaderElection":{"enable":true,"lockName":""},"lifecycle":{},"metrics":{"enable":true,"port":9113,"secure":false},"nodeSelector":{},"podAnnotations":{},"productTelemetry":{"enable":true},"readinessProbe":{"enable":true,"initialDelaySeconds":3,"port":8081},"replicas":1,"resources":{},"service":{"annotations":{}},"serviceAccount":{"annotations":{},"imagePullSecret":"","imagePullSecrets":[],"name":""},"snippetsFilters":{"enable":false},"terminationGracePeriodSeconds":30,"tolerations":[],"topologySpreadConstraints":[]}` |
291+
| `nginxGateway` | The nginxGateway section contains configuration for the NGINX Gateway Fabric control plane deployment. | object | `{"affinity":{},"config":{"logging":{"level":"info"}},"configAnnotations":{},"extraVolumeMounts":[],"extraVolumes":[],"gatewayClassAnnotations":{},"gatewayClassName":"nginx","gatewayControllerName":"gateway.nginx.org/nginx-gateway-controller","gwAPIExperimentalFeatures":{"enable":false},"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric","tag":"edge"},"kind":"deployment","labels":{},"leaderElection":{"enable":true,"lockName":""},"lifecycle":{},"metrics":{"enable":true,"port":9113,"secure":false},"nodeSelector":{},"podAnnotations":{},"productTelemetry":{"enable":true},"readinessProbe":{"enable":true,"initialDelaySeconds":3,"port":8081},"replicas":1,"resources":{},"service":{"annotations":{}},"serviceAccount":{"annotations":{},"imagePullSecret":"","imagePullSecrets":[],"name":""},"snippetsFilters":{"enable":false},"terminationGracePeriodSeconds":30,"tolerations":[],"topologySpreadConstraints":[]}` |
287292
| `nginxGateway.affinity` | The affinity of the NGINX Gateway Fabric control plane pod. | object | `{}` |
288293
| `nginxGateway.config.logging.level` | Log level. | string | `"info"` |
289294
| `nginxGateway.configAnnotations` | Set of custom annotations for NginxGateway objects. | object | `{}` |
@@ -293,7 +298,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
293298
| `nginxGateway.gatewayClassName` | The name of the GatewayClass that will be created as part of this release. Every NGINX Gateway Fabric must have a unique corresponding GatewayClass resource. NGINX Gateway Fabric only processes resources that belong to its class - i.e. have the "gatewayClassName" field resource equal to the class. | string | `"nginx"` |
294299
| `nginxGateway.gatewayControllerName` | The name of the Gateway controller. The controller name must be of the form: DOMAIN/PATH. The controller's domain is gateway.nginx.org. | string | `"gateway.nginx.org/nginx-gateway-controller"` |
295300
| `nginxGateway.gwAPIExperimentalFeatures.enable` | Enable the experimental features of Gateway API which are supported by NGINX Gateway Fabric. Requires the Gateway APIs installed from the experimental channel. | bool | `false` |
296-
| `nginxGateway.image` | The image configuration for the NGINX Gateway Fabric control plane. | object | `{"pullPolicy":"IfNotPresent","repository":"ghcr.io/nginx/nginx-gateway-fabric","tag":"2.0.0"}` |
301+
| `nginxGateway.image` | The image configuration for the NGINX Gateway Fabric control plane. | object | `{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric","tag":"edge"}` |
297302
| `nginxGateway.image.repository` | The NGINX Gateway Fabric image to use | string | `"ghcr.io/nginx/nginx-gateway-fabric"` |
298303
| `nginxGateway.kind` | The kind of the NGINX Gateway Fabric installation - currently, only deployment is supported. | string | `"deployment"` |
299304
| `nginxGateway.labels` | Set of labels to be added for NGINX Gateway Fabric deployment. | object | `{}` |

charts/nginx-gateway-fabric/templates/certs-job.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,20 @@ spec:
153153
securityContext:
154154
fsGroup: 1001
155155
runAsNonRoot: true
156-
ttlSecondsAfterFinished: 0
156+
{{- if .Values.certGenerator.topologySpreadConstraints }}
157+
topologySpreadConstraints:
158+
{{- toYaml .Values.certGenerator.topologySpreadConstraints | nindent 6 }}
159+
{{- end }}
160+
{{- if .Values.certGenerator.affinity }}
161+
affinity:
162+
{{- toYaml .Values.certGenerator.affinity | nindent 8 }}
163+
{{- end }}
164+
{{- if .Values.certGenerator.tolerations }}
165+
tolerations:
166+
{{- toYaml .Values.certGenerator.tolerations | nindent 6 }}
167+
{{- end }}
168+
{{- if .Values.certGenerator.nodeSelector }}
169+
nodeSelector:
170+
{{- toYaml .Values.certGenerator.nodeSelector | nindent 8 }}
171+
{{- end }}
172+
ttlSecondsAfterFinished: {{ .Values.certGenerator.ttlSecondsAfterFinished }}

charts/nginx-gateway-fabric/values.schema.json

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
"certGenerator": {
55
"description": "The certGenerator section contains the configuration for the cert-generator Job.",
66
"properties": {
7+
"affinity": {
8+
"description": "The affinity of the cert-generator pod.",
9+
"required": [],
10+
"title": "affinity",
11+
"type": "object"
12+
},
713
"agentTLSSecretName": {
814
"default": "agent-tls",
915
"description": "The name of the base Secret containing TLS CA, certificate, and key for the NGINX Agent to securely\ncommunicate with the NGINX Gateway Fabric control plane. Must exist in the same namespace that the\nNGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway).",
@@ -17,6 +23,12 @@
1723
"title": "annotations",
1824
"type": "object"
1925
},
26+
"nodeSelector": {
27+
"description": "The nodeSelector of the cert-generator pod.",
28+
"required": [],
29+
"title": "nodeSelector",
30+
"type": "object"
31+
},
2032
"overwrite": {
2133
"default": false,
2234
"description": "Overwrite existing TLS Secrets on startup.",
@@ -30,6 +42,31 @@
3042
"required": [],
3143
"title": "serverTLSSecretName",
3244
"type": "string"
45+
},
46+
"tolerations": {
47+
"description": "Tolerations for the cert-generator pod.",
48+
"items": {
49+
"required": []
50+
},
51+
"required": [],
52+
"title": "tolerations",
53+
"type": "array"
54+
},
55+
"topologySpreadConstraints": {
56+
"description": "The topology spread constraints for the cert-generator pod.",
57+
"items": {
58+
"required": []
59+
},
60+
"required": [],
61+
"title": "topologySpreadConstraints",
62+
"type": "array"
63+
},
64+
"ttlSecondsAfterFinished": {
65+
"default": 30,
66+
"description": "How long to wait after the cert generator job has finished before it is removed by the job controller.",
67+
"required": [],
68+
"title": "ttlSecondsAfterFinished",
69+
"type": "integer"
3370
}
3471
},
3572
"required": [],
@@ -290,7 +327,7 @@
290327
"image": {
291328
"properties": {
292329
"pullPolicy": {
293-
"default": "IfNotPresent",
330+
"default": "Always",
294331
"enum": [
295332
"Always",
296333
"IfNotPresent",
@@ -307,7 +344,7 @@
307344
"type": "string"
308345
},
309346
"tag": {
310-
"default": "2.0.0",
347+
"default": "edge",
311348
"required": [],
312349
"title": "tag",
313350
"type": "string"
@@ -591,7 +628,7 @@
591628
"description": "The image configuration for the NGINX Gateway Fabric control plane.",
592629
"properties": {
593630
"pullPolicy": {
594-
"default": "IfNotPresent",
631+
"default": "Always",
595632
"enum": [
596633
"Always",
597634
"IfNotPresent",
@@ -608,7 +645,7 @@
608645
"type": "string"
609646
},
610647
"tag": {
611-
"default": "2.0.0",
648+
"default": "edge",
612649
"required": [],
613650
"title": "tag",
614651
"type": "string"

charts/nginx-gateway-fabric/values.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ nginxGateway:
112112
image:
113113
# -- The NGINX Gateway Fabric image to use
114114
repository: ghcr.io/nginx/nginx-gateway-fabric
115-
tag: 2.0.0
115+
tag: edge
116116
# @schema
117117
# enum:
118118
# - Always
119119
# - IfNotPresent
120120
# - Never
121121
# @schema
122-
pullPolicy: IfNotPresent
122+
pullPolicy: Always
123123

124124
productTelemetry:
125125
# -- Enable the collection of product telemetry.
@@ -196,14 +196,14 @@ nginx:
196196
image:
197197
# -- The NGINX image to use.
198198
repository: ghcr.io/nginx/nginx-gateway-fabric/nginx
199-
tag: 2.0.0
199+
tag: edge
200200
# @schema
201201
# enum:
202202
# - Always
203203
# - IfNotPresent
204204
# - Never
205205
# @schema
206-
pullPolicy: IfNotPresent
206+
pullPolicy: Always
207207

208208
# -- Is NGINX Plus image being used.
209209
plus: false
@@ -479,6 +479,21 @@ certGenerator:
479479
# -- Overwrite existing TLS Secrets on startup.
480480
overwrite: false
481481

482+
# -- How long to wait after the cert generator job has finished before it is removed by the job controller.
483+
ttlSecondsAfterFinished: 30
484+
485+
# -- Tolerations for the cert-generator pod.
486+
tolerations: []
487+
488+
# -- The nodeSelector of the cert-generator pod.
489+
nodeSelector: {}
490+
491+
# -- The affinity of the cert-generator pod.
492+
affinity: {}
493+
494+
# -- The topology spread constraints for the cert-generator pod.
495+
topologySpreadConstraints: []
496+
482497
# -- A list of Gateway objects. View https://gateway-api.sigs.k8s.io/reference/spec/#gateway for full Gateway reference.
483498
gateways: []
484499

deploy/azure/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ spec:
367367
fsGroup: 1001
368368
runAsNonRoot: true
369369
serviceAccountName: nginx-gateway-cert-generator
370-
ttlSecondsAfterFinished: 0
370+
ttlSecondsAfterFinished: 30
371371
---
372372
apiVersion: gateway.networking.k8s.io/v1
373373
kind: GatewayClass

deploy/default/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ spec:
365365
fsGroup: 1001
366366
runAsNonRoot: true
367367
serviceAccountName: nginx-gateway-cert-generator
368-
ttlSecondsAfterFinished: 0
368+
ttlSecondsAfterFinished: 30
369369
---
370370
apiVersion: gateway.networking.k8s.io/v1
371371
kind: GatewayClass

deploy/experimental-nginx-plus/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ spec:
373373
fsGroup: 1001
374374
runAsNonRoot: true
375375
serviceAccountName: nginx-gateway-cert-generator
376-
ttlSecondsAfterFinished: 0
376+
ttlSecondsAfterFinished: 30
377377
---
378378
apiVersion: gateway.networking.k8s.io/v1
379379
kind: GatewayClass

deploy/experimental/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ spec:
370370
fsGroup: 1001
371371
runAsNonRoot: true
372372
serviceAccountName: nginx-gateway-cert-generator
373-
ttlSecondsAfterFinished: 0
373+
ttlSecondsAfterFinished: 30
374374
---
375375
apiVersion: gateway.networking.k8s.io/v1
376376
kind: GatewayClass

deploy/nginx-plus/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ spec:
368368
fsGroup: 1001
369369
runAsNonRoot: true
370370
serviceAccountName: nginx-gateway-cert-generator
371-
ttlSecondsAfterFinished: 0
371+
ttlSecondsAfterFinished: 30
372372
---
373373
apiVersion: gateway.networking.k8s.io/v1
374374
kind: GatewayClass

deploy/nodeport/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ spec:
365365
fsGroup: 1001
366366
runAsNonRoot: true
367367
serviceAccountName: nginx-gateway-cert-generator
368-
ttlSecondsAfterFinished: 0
368+
ttlSecondsAfterFinished: 30
369369
---
370370
apiVersion: gateway.networking.k8s.io/v1
371371
kind: GatewayClass

deploy/openshift/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ spec:
387387
fsGroup: 1001
388388
runAsNonRoot: true
389389
serviceAccountName: nginx-gateway-cert-generator
390-
ttlSecondsAfterFinished: 0
390+
ttlSecondsAfterFinished: 30
391391
---
392392
apiVersion: gateway.networking.k8s.io/v1
393393
kind: GatewayClass

deploy/snippets-filters-nginx-plus/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ spec:
371371
fsGroup: 1001
372372
runAsNonRoot: true
373373
serviceAccountName: nginx-gateway-cert-generator
374-
ttlSecondsAfterFinished: 0
374+
ttlSecondsAfterFinished: 30
375375
---
376376
apiVersion: gateway.networking.k8s.io/v1
377377
kind: GatewayClass

deploy/snippets-filters/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ spec:
368368
fsGroup: 1001
369369
runAsNonRoot: true
370370
serviceAccountName: nginx-gateway-cert-generator
371-
ttlSecondsAfterFinished: 0
371+
ttlSecondsAfterFinished: 30
372372
---
373373
apiVersion: gateway.networking.k8s.io/v1
374374
kind: GatewayClass

0 commit comments

Comments
 (0)