From 3396a93d92bf3db411ecb50dd4dacb0b2bd54538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Massimiliano=20Dess=C3=AC=20-=20=28Fast=20Chauffeur=29?= Date: Wed, 4 Dec 2024 14:15:29 +0100 Subject: [PATCH] Configurable Probe initial delay in seconds (#134) Signed-off-by: desmax74 --- roles/tpa_single_node/README.md | 1 + roles/tpa_single_node/meta/argument_specs.yml | 5 +++++ .../templates/manifests/bombastic/api/Deployment.yaml.j2 | 4 ++-- .../templates/manifests/bombastic/indexer/Deployment.yaml.j2 | 4 ++-- .../templates/manifests/bombastic/walker/Deployment.yaml.j2 | 4 ++-- .../templates/manifests/collector/osv/Deployment.yaml.j2 | 4 ++-- .../templates/manifests/collectorist/api/Deployment.yaml.j2 | 4 ++-- .../templates/manifests/guac/graphql/Deployment.yaml.j2 | 2 +- .../templates/manifests/spog/api/Deployment.yaml.j2 | 4 ++-- .../templates/manifests/spog/ui/Deployment.yaml.j2 | 4 ++-- .../templates/manifests/v11y/api/Deployment.yaml.j2 | 4 ++-- .../templates/manifests/v11y/indexer/Deployment.yaml.j2 | 4 ++-- .../templates/manifests/vexination/api/Deployment.yaml.j2 | 4 ++-- .../manifests/vexination/indexer/Deployment.yaml.j2 | 4 ++-- roles/tpa_single_node/vars/main.yml | 3 +++ 15 files changed, 32 insertions(+), 23 deletions(-) diff --git a/roles/tpa_single_node/README.md b/roles/tpa_single_node/README.md index cef1ea1e..bc907637 100644 --- a/roles/tpa_single_node/README.md +++ b/roles/tpa_single_node/README.md @@ -82,6 +82,7 @@ Deploy the [RHTPA](https://docs.redhat.com/en/documentation/red_hat_trusted_prof | tpa_single_node_dataset_job_suspended | Dataset job suspended flag | bool | `True` | | tpa_single_node_vexination_walker_suspended | Vexination walker job suspended flag | bool | `True` | | tpa_single_node_v11y_walker_suspended | V11y walker job suspended flag | bool | `False` | +| tpa_single_node_probe_initial_delay_seconds | Initial prob delay in seconds | int | `30` | ## Example Playbook diff --git a/roles/tpa_single_node/meta/argument_specs.yml b/roles/tpa_single_node/meta/argument_specs.yml index c58c00f1..a2226872 100644 --- a/roles/tpa_single_node/meta/argument_specs.yml +++ b/roles/tpa_single_node/meta/argument_specs.yml @@ -349,3 +349,8 @@ argument_specs: type: "bool" version_added: "1.2.0" default: false + tpa_single_node_probe_initial_delay_seconds: + description: "Initial prob delay in seconds" + type: "int" + version_added: "1.2.1" + default: 30 diff --git a/roles/tpa_single_node/templates/manifests/bombastic/api/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/bombastic/api/Deployment.yaml.j2 index 9dacaaf8..855fc2fe 100644 --- a/roles/tpa_single_node/templates/manifests/bombastic/api/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/bombastic/api/Deployment.yaml.j2 @@ -130,12 +130,12 @@ spec: mountPath: /etc/config/auth.yaml subPath: auth.yaml livenessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/live port: 9010 readinessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/ready port: 9010 diff --git a/roles/tpa_single_node/templates/manifests/bombastic/indexer/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/bombastic/indexer/Deployment.yaml.j2 index 502b2f81..cb6da2be 100644 --- a/roles/tpa_single_node/templates/manifests/bombastic/indexer/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/bombastic/indexer/Deployment.yaml.j2 @@ -43,12 +43,12 @@ spec: image: "{{ tpa_single_node_trustification_image }}" imagePullPolicy: IfNotPresent livenessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/live port: 9010 readinessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/ready port: 9010 diff --git a/roles/tpa_single_node/templates/manifests/bombastic/walker/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/bombastic/walker/Deployment.yaml.j2 index 29a19f2b..36c2a807 100644 --- a/roles/tpa_single_node/templates/manifests/bombastic/walker/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/bombastic/walker/Deployment.yaml.j2 @@ -79,12 +79,12 @@ spec: httpGet: path: /health/live port: 9010 - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} readinessProbe: httpGet: path: /health/ready port: 9010 - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} startupProbe: httpGet: path: /health/startup diff --git a/roles/tpa_single_node/templates/manifests/collector/osv/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/collector/osv/Deployment.yaml.j2 index ee0c7cc2..44c0af48 100644 --- a/roles/tpa_single_node/templates/manifests/collector/osv/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/collector/osv/Deployment.yaml.j2 @@ -111,12 +111,12 @@ spec: mountPath: /etc/trust-anchor readOnly: true livenessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/live port: 9010 readinessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/ready port: 9010 diff --git a/roles/tpa_single_node/templates/manifests/collectorist/api/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/collectorist/api/Deployment.yaml.j2 index 1954af2c..7a2386cf 100644 --- a/roles/tpa_single_node/templates/manifests/collectorist/api/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/collectorist/api/Deployment.yaml.j2 @@ -115,12 +115,12 @@ spec: mountPath: /etc/trust-anchor readOnly: true livenessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/live port: 9010 readinessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/ready port: 9010 diff --git a/roles/tpa_single_node/templates/manifests/guac/graphql/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/guac/graphql/Deployment.yaml.j2 index 2aff9d74..5cc9e9f7 100644 --- a/roles/tpa_single_node/templates/manifests/guac/graphql/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/guac/graphql/Deployment.yaml.j2 @@ -68,7 +68,7 @@ spec: port: 9010 scheme: HTTPS livenessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /healthz port: 9010 diff --git a/roles/tpa_single_node/templates/manifests/spog/api/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/spog/api/Deployment.yaml.j2 index 48307c89..e091ed93 100644 --- a/roles/tpa_single_node/templates/manifests/spog/api/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/spog/api/Deployment.yaml.j2 @@ -114,12 +114,12 @@ spec: - name: user-preferences-db-path mountPath: /data/db/ livenessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/live port: 9010 readinessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/ready port: 9010 diff --git a/roles/tpa_single_node/templates/manifests/spog/ui/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/spog/ui/Deployment.yaml.j2 index df341e95..77442cdd 100644 --- a/roles/tpa_single_node/templates/manifests/spog/ui/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/spog/ui/Deployment.yaml.j2 @@ -93,9 +93,9 @@ spec: httpGet: path: / port: {{ tpa_single_node_spog_ui_port }} - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} readinessProbe: httpGet: path: / port: {{ tpa_single_node_spog_ui_port }} - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} diff --git a/roles/tpa_single_node/templates/manifests/v11y/api/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/v11y/api/Deployment.yaml.j2 index 3084b7a8..5594ef37 100644 --- a/roles/tpa_single_node/templates/manifests/v11y/api/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/v11y/api/Deployment.yaml.j2 @@ -81,12 +81,12 @@ spec: mountPath: /etc/trust-anchor readOnly: true livenessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/live port: 9010 readinessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/ready port: 9010 diff --git a/roles/tpa_single_node/templates/manifests/v11y/indexer/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/v11y/indexer/Deployment.yaml.j2 index 1c72e126..57782dd0 100644 --- a/roles/tpa_single_node/templates/manifests/v11y/indexer/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/v11y/indexer/Deployment.yaml.j2 @@ -49,13 +49,13 @@ spec: imagePullPolicy: IfNotPresent livenessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/live port: 9010 readinessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/ready port: 9010 diff --git a/roles/tpa_single_node/templates/manifests/vexination/api/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/vexination/api/Deployment.yaml.j2 index 38dd0231..351d1d09 100644 --- a/roles/tpa_single_node/templates/manifests/vexination/api/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/vexination/api/Deployment.yaml.j2 @@ -81,12 +81,12 @@ spec: - mountPath: /etc/oidc-secret name: oidc-secret livenessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/live port: 9010 readinessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/ready port: 9010 diff --git a/roles/tpa_single_node/templates/manifests/vexination/indexer/Deployment.yaml.j2 b/roles/tpa_single_node/templates/manifests/vexination/indexer/Deployment.yaml.j2 index af881dc0..c14ca1cf 100644 --- a/roles/tpa_single_node/templates/manifests/vexination/indexer/Deployment.yaml.j2 +++ b/roles/tpa_single_node/templates/manifests/vexination/indexer/Deployment.yaml.j2 @@ -43,12 +43,12 @@ spec: image: "{{ tpa_single_node_trustification_image }}" imagePullPolicy: IfNotPresent livenessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/live port: 9010 readinessProbe: - initialDelaySeconds: 2 + initialDelaySeconds: {{ tpa_single_node_probe_initial_delay_seconds }} httpGet: path: /health/ready port: 9010 diff --git a/roles/tpa_single_node/vars/main.yml b/roles/tpa_single_node/vars/main.yml index eb0dd881..a8c89658 100644 --- a/roles/tpa_single_node/vars/main.yml +++ b/roles/tpa_single_node/vars/main.yml @@ -89,6 +89,9 @@ tpa_single_node_dataset_job_suspended: true tpa_single_node_vexination_walker_suspended: true tpa_single_node_v11y_walker_suspended: false +# Probes +tpa_single_node_probe_initial_delay_seconds: 30 + # defaults file for tpa_single_node tpa_single_node_system_packages: - podman