Skip to content

Commit

Permalink
feat[ASM-10596]- Readiness/Liveliness: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-akeyless committed Jun 16, 2024
1 parent 8337291 commit 3ff89bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions charts/akeyless-api-gateway/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,15 @@ Check metrics configuration Secret
{{- end -}}
{{- end -}}

{{- define "gw_version" -}}
{{- define "version" -}}
{{ .Values.version | default .Chart.AppVersion | printf }}
{{- end }}

{{- define "gw_health_path" -}}
{{- if not (regexMatch "^[0-9]+(\\.[0-9]+){2}$" (include "gw_version" .)) -}}
{{- define "health_check_path" -}}
{{- if not (regexMatch "^[0-9]+(\\.[0-9]+){2}$" (include "version" .)) -}}
/health
{{- else -}}
{{- $parts := split "." (include "gw_version" .) -}}
{{- $parts := split "." (include "version" .) -}}
{{- $major := index $parts "_0" | int }}
{{- $minor := index $parts "_1" | int }}
{{- $patch := index $parts "_2" | int }}
Expand Down
6 changes: 3 additions & 3 deletions charts/akeyless-api-gateway/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ spec:
containerPort: 5696
livenessProbe:
httpGet:
path: {{ include "gw_health_path" . }}
path: {{ include "health_check_path" . }}
port: 8080
{{- if .Values.TLSConf.akeylessAPIServices }}
scheme: HTTPS
{{- end }}
{{- toYaml .Values.livenessProbe | trim | nindent 12 }}
readinessProbe:
httpGet:
path: {{ include "gw_health_path" . }}
path: {{ include "health_check_path" . }}
port: 8080
{{- if .Values.TLSConf.akeylessAPIServices }}
scheme: HTTPS
Expand Down Expand Up @@ -389,7 +389,7 @@ spec:
{{- end }}
# end provision
- name: VERSION
value: {{ include "gw_version" . }}
value: {{ include "version" . }}
{{- if .Values.httpProxySettings.http_proxy }}
- name: HTTP_PROXY
value: {{ .Values.httpProxySettings.http_proxy }}
Expand Down

0 comments on commit 3ff89bb

Please sign in to comment.