diff --git a/.github/workflows/helm-ci.yaml b/.github/workflows/helm-ci.yaml index fd4d107..5aacfa7 100644 --- a/.github/workflows/helm-ci.yaml +++ b/.github/workflows/helm-ci.yaml @@ -19,10 +19,10 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v3 with: - version: v3.13.3 + version: v3.16.4 - name: Install helm-unittest plugin - run: helm plugin install https://github.com/helm-unittest/helm-unittest + run: helm plugin install https://github.com/helm-unittest/helm-unittest --version v0.6.0 - name: Lint Helm chart run: helm lint charts/iag4 diff --git a/charts/iag4/templates/statefulset.yaml b/charts/iag4/templates/statefulset.yaml index b79ff70..f10bcf1 100644 --- a/charts/iag4/templates/statefulset.yaml +++ b/charts/iag4/templates/statefulset.yaml @@ -207,10 +207,11 @@ spec: {{- if .Values.livenessProbe.enabled }} livenessProbe: failureThreshold: {{ .Values.livenessProbe.failureThreshold }} - httpGet: - path: {{ .Values.livenessProbe.path }} - port: {{ .Values.applicationPort }} - scheme: {{ ternary "HTTPS" "HTTP" .Values.useTLS }} + exec: + command: + - sh + - -c + - 'test $(pgrep -f automation-gateway | wc -l) -ge 2' periodSeconds: {{ .Values.livenessProbe.periodSeconds }} successThreshold: {{ .Values.livenessProbe.successThreshold }} timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} diff --git a/charts/iag4/tests/statefulset_test.yaml b/charts/iag4/tests/statefulset_test.yaml index aa10ac2..b91c2c9 100644 --- a/charts/iag4/tests/statefulset_test.yaml +++ b/charts/iag4/tests/statefulset_test.yaml @@ -285,28 +285,44 @@ tests: set: statefulset.enabled: true serviceAccount.name: "test-sa" - applicationPort: 8080 - useTLS: false livenessProbe: enabled: true periodSeconds: 20 timeoutSeconds: 10 failureThreshold: 5 successThreshold: 1 - path: "/health" applicationSettings: enabled: true env: {} asserts: - equal: - path: spec.template.spec.containers[0].livenessProbe.httpGet.scheme - value: "HTTP" + path: spec.template.spec.containers[0].livenessProbe.exec.command + value: + - sh + - -c + - 'test $(pgrep -f automation-gateway | wc -l) -ge 2' - equal: path: spec.template.spec.containers[0].livenessProbe.periodSeconds value: 20 - equal: path: spec.template.spec.containers[0].livenessProbe.failureThreshold value: 5 + - notExists: + path: spec.template.spec.containers[0].livenessProbe.httpGet + + # Test 12b: Test liveness probe is not created when disabled + - it: should not configure liveness probe when disabled + set: + statefulset.enabled: true + serviceAccount.name: "test-sa" + livenessProbe: + enabled: false + applicationSettings: + enabled: true + env: {} + asserts: + - notExists: + path: spec.template.spec.containers[0].livenessProbe # Test 13: Test readiness probe - it: should configure readiness probe when enabled diff --git a/charts/iag4/values.yaml b/charts/iag4/values.yaml index 465569f..89f6f5e 100644 --- a/charts/iag4/values.yaml +++ b/charts/iag4/values.yaml @@ -25,7 +25,8 @@ external-dns: # The image name will depend on the entitlement that has been granted. image: # -- The image repository - repository: 497639811223.dkr.ecr.us-east-2.amazonaws.com/automation-gateway + # -- Contact Itential to get the correct image repository for your entitlement. + repository: # -- The image pull policy pullPolicy: IfNotPresent # -- The image tag @@ -159,7 +160,6 @@ livenessProbe: timeoutSeconds: 5 failureThreshold: 3 successThreshold: 1 - path: "/api/v2.0/poll" # The readiness probe used to determine if the container is ready to accept requests. If the # readiness probe fails, the endpoints controller removes the pod’s IP address from the @@ -167,7 +167,7 @@ livenessProbe: # initial delay is failure. If a container does not provide a readiness probe, the default # state is success. These are suggested values. readinessProbe: - readinessProbe: false + enabled: false periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3