Skip to content

Commit

Permalink
fix: refactor health probe configuration and update image pull policy…
Browse files Browse the repository at this point in the history
… logic

On-behalf-of: @SAP angel.kafazov@sap.com
Signed-off-by: Angel Kafazov <akafazov@cst-bg.net>
  • Loading branch information
akafazov committed Nov 25, 2024
1 parent 0c6af2c commit 566ff49
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 25 deletions.
13 changes: 1 addition & 12 deletions charts/account-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,7 @@ spec:
containerPort: 9443
protocol: TCP
{{- end }}
livenessProbe:
httpGet:
path: /healthz
port: {{ .Values.health.port}}
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: {{ .Values.health.port}}
initialDelaySeconds: 5
periodSeconds: 10
{{ include "common.operatorHealthAndReadyness" . | nindent 10 }}
resources:
limits:
cpu: {{ .Values.deployment.resources.limits.cpu }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,11 @@ operator match the snapshot:
value: /certs
image: ghcr.io/openmfp/account-operator:0.0.0
livenessProbe:
failureThreshold: 1
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
periodSeconds: 10
name: manager
ports:
- containerPort: 8080
Expand All @@ -344,7 +344,7 @@ operator match the snapshot:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
initialDelaySeconds: 45
periodSeconds: 10
resources:
limits:
Expand All @@ -359,6 +359,12 @@ operator match the snapshot:
seccompProfile:
type: RuntimeDefault
serviceAccountName: account-operator
startupProbe:
failureThreshold: 30
httpGet:
path: /healthz
port: 8081
periodSeconds: 10
volumeMounts: null
serviceAccountName: account-operator
terminationGracePeriodSeconds: 10
Expand Down Expand Up @@ -701,11 +707,11 @@ operator match the snapshot (with kubeconfigSecret):
value: /api-kubeconfig/kubeconfig
image: ghcr.io/openmfp/account-operator:0.0.0
livenessProbe:
failureThreshold: 1
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
periodSeconds: 10
name: manager
ports:
- containerPort: 8080
Expand All @@ -718,7 +724,7 @@ operator match the snapshot (with kubeconfigSecret):
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
initialDelaySeconds: 45
periodSeconds: 10
resources:
limits:
Expand All @@ -733,6 +739,12 @@ operator match the snapshot (with kubeconfigSecret):
seccompProfile:
type: RuntimeDefault
serviceAccountName: account-operator
startupProbe:
failureThreshold: 30
httpGet:
path: /healthz
port: 8081
periodSeconds: 10
volumeMounts:
- mountPath: /api-kubeconfig
name: external-api-server
Expand Down Expand Up @@ -1081,11 +1093,11 @@ operator match the snapshot with webhook enabled:
value: /certs
image: ghcr.io/openmfp/account-operator:0.0.0
livenessProbe:
failureThreshold: 1
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
periodSeconds: 10
name: manager
ports:
- containerPort: 8080
Expand All @@ -1101,7 +1113,7 @@ operator match the snapshot with webhook enabled:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
initialDelaySeconds: 45
periodSeconds: 10
resources:
limits:
Expand All @@ -1116,6 +1128,12 @@ operator match the snapshot with webhook enabled:
seccompProfile:
type: RuntimeDefault
serviceAccountName: account-operator
startupProbe:
failureThreshold: 30
httpGet:
path: /healthz
port: 8081
periodSeconds: 10
volumeMounts:
- mountPath: /certs
name: cert
Expand Down
4 changes: 4 additions & 0 deletions charts/account-operator/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ tests:
- matchSnapshot: {}
- it: operator match the snapshot with webhook enabled
set:
health:
liveness:
path: "/healthz"
# failureThreshold: 1
webhooks:
enabled: true
asserts:
Expand Down
22 changes: 22 additions & 0 deletions charts/account-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,30 @@ webhooks:
enabled: false
certDir: /certs

# The health probe configuration
## @param health.port The port for the health probe
## @param health.periodSeconds The period in seconds for performing the probe
## @param health.readiness.path The path for the readiness probe
## @param health.readiness.initialDelaySeconds The initial delay in seconds before starting the readiness probe
## @param health.readiness.periodSeconds The period in seconds for performing the readiness probe
## @param health.liveness.path The path for the liveness probe
## @param health.liveness.failureThreshold The failure threshold for the liveness probe
## @param health.startup.path The path for the startup probe
## @param health.startup.failureThreshold The failure threshold for the startup probe
health:
port: 8081
# periodSeconds: 10
# readiness:
# path: "/readyz"
# initialDelaySeconds: 5
# periodSeconds: 10
# liveness:
# path: "/healthz"
# failureThreshold: 1
# startup:
# path: "/readyz"
# failureThreshold: 30


metrics:
port: 8080
Expand Down
2 changes: 1 addition & 1 deletion charts/portal/templates/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
containers:
- name: {{ include "common.entity.name" . }}
image: {{ .Values.image.name }}:{{ .Chart.AppVersion }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
imagePullPolicy: {{ include "common.imagePullPolicy" . }}
{{ include "common.security" . | nindent 8 }}
env:
- name: HTTP_PROTOCOL
Expand Down
2 changes: 1 addition & 1 deletion charts/portal/tests/__snapshot__/deploy_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ matches the snapshot:
- name: VALID_WEBCOMPONENT_URLS
value: .?
image: ghcr.io/openmfp/portal:1.0.0
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
name: portal
ports:
- containerPort: 8080
Expand Down
4 changes: 2 additions & 2 deletions charts/portal/tests/__snapshot__/istio_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ matches the snapshot:
- name: VALID_WEBCOMPONENT_URLS
value: .?
image: ghcr.io/openmfp/portal:1.0.0
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
name: portal
ports:
- containerPort: 8080
Expand Down Expand Up @@ -195,7 +195,7 @@ matches the snapshot with istio disabled:
- name: VALID_WEBCOMPONENT_URLS
value: .?
image: ghcr.io/openmfp/portal:1.0.0
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
name: portal
ports:
- containerPort: 8080
Expand Down

0 comments on commit 566ff49

Please sign in to comment.