From a2bfad8d05ac6176253e2c11c08307ad8e00bb28 Mon Sep 17 00:00:00 2001 From: Cole Walker Date: Tue, 4 Jun 2024 15:03:40 -0400 Subject: [PATCH] Add override parameters to configure liveness probes Update the ptp-notification helm charts and values to allow users to override the liveness probe parameter values for the locationservice, ptptracking and ptptrackingv2 containers. Adds overrides for: - initialDelaySeconds - failureThreshold - periodSeconds - timeoutSeconds The successThreshold value is not configurable and must remain as "1". Test plan: Pass: Verify package build Pass: Verify ptp-notification upload/override/apply/remove/delete Pass: Verify overrides are accepted and applied for each containers liveness probes Pass: Verify application startup with liveness probes enabled and disabled Story: 2011090 Task: 50266 Signed-off-by: Cole Walker Change-Id: Id196047d6a018bfecae5a123482425aa8256e412 --- .../ptp-notification/templates/daemonset.yaml | 24 +++++++++---------- .../ptp-notification/values.yaml | 12 ++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/templates/daemonset.yaml b/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/templates/daemonset.yaml index 555b913..7b7a52c 100644 --- a/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/templates/daemonset.yaml +++ b/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/templates/daemonset.yaml @@ -100,15 +100,15 @@ spec: command: ["python3", "/opt/locationservice/locationservice_start.py"] {{- if .Values.location.endpoint.liveness }} livenessProbe: - failureThreshold: 3 + failureThreshold: {{ .Values.location.endpoint.livenessFailureThreshold}} httpGet: path: /health port: {{ .Values.location.endpoint.port }} scheme: HTTP - initialDelaySeconds: 60 - periodSeconds: 3 + initialDelaySeconds: {{ .Values.location.endpoint.livenessDelaySeconds }} + periodSeconds: {{ .Values.location.endpoint.livenessPeriodSeconds }} successThreshold: 1 - timeoutSeconds: 3 + timeoutSeconds: {{ .Values.location.endpoint.livenessTimeoutSeconds }} {{ end }} volumeMounts: - name: scripts @@ -179,15 +179,15 @@ spec: command: ["python3", "/mnt/ptptracking_start_v2.py"] {{- if .Values.ptptrackingv2.endpoint.liveness }} livenessProbe: - failureThreshold: 3 + failureThreshold: {{ .Values.ptptrackingv2.endpoint.livenessFailureThreshold }} httpGet: path: /health port: {{ .Values.ptptrackingv2.endpoint.port }} scheme: HTTP - initialDelaySeconds: 60 - periodSeconds: 3 + initialDelaySeconds: {{ .Values.ptptrackingv2.endpoint.livenessDelaySeconds }} + periodSeconds: {{ .Values.ptptrackingv2.endpoint.livenessPeriodSeconds }} successThreshold: 1 - timeoutSeconds: 3 + timeoutSeconds: {{ .Values.ptptrackingv2.endpoint.livenessTimeoutSeconds }} {{ end }} securityContext: privileged: true @@ -282,15 +282,15 @@ spec: command: ["python3", "/mnt/ptptracking_start.py"] {{- if .Values.ptptracking.endpoint.liveness }} livenessProbe: - failureThreshold: 3 + failureThreshold: {{ .Values.ptptracking.endpoint.livenessFailureThreshold }} httpGet: path: /health port: {{ .Values.ptptracking.endpoint.port }} scheme: HTTP - initialDelaySeconds: 60 - periodSeconds: 3 + initialDelaySeconds: {{ .Values.ptptracking.endpoint.livenessDelaySeconds }} + periodSeconds: {{ .Values.ptptracking.endpoint.livenessPeriodSeconds }} successThreshold: 1 - timeoutSeconds: 3 + timeoutSeconds: {{ .Values.ptptracking.endpoint.livenessTimeoutSeconds }} {{ end }} securityContext: privileged: true diff --git a/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/values.yaml b/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/values.yaml index f3f7650..932fdda 100644 --- a/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/values.yaml +++ b/helm-charts/custom/ptp-notification-helm/ptp-notification-helm/ptp-notification/values.yaml @@ -66,6 +66,10 @@ location: endpoint: port: 8080 liveness: False + livenessDelaySeconds: 60 + livenessPeriodSeconds: 3 + livenessFailureThreshold: 3 + livenessTimeoutSeconds: 3 image: repository: starlingx/locationservice-base tag: stx.10.0-v2.2.1 @@ -83,6 +87,10 @@ ptptracking: endpoint: port: 8081 liveness: False + livenessDelaySeconds: 60 + livenessPeriodSeconds: 3 + livenessFailureThreshold: 3 + livenessTimeoutSeconds: 3 image: repository: starlingx/notificationservice-base tag: stx.10.0-v2.2.1 @@ -105,6 +113,10 @@ ptptrackingv2: endpoint: port: 8082 liveness: False + livenessDelaySeconds: 60 + livenessPeriodSeconds: 3 + livenessFailureThreshold: 3 + livenessTimeoutSeconds: 3 image: repository: starlingx/notificationservice-base-v2 tag: stx.10.0-v2.2.1