Skip to content

Commit

Permalink
Fix readinessProbe and livenessProbe when authnUrl containes path
Browse files Browse the repository at this point in the history
  • Loading branch information
obukhov committed Apr 4, 2020
1 parent 274106a commit 27027ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion keratin-authn-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ home: https://keratin.tech
icon: https://keratin.tech/pangolin-logo-dark.gif

type: application
version: 0.2.1
version: 0.2.2
appVersion: 1.8.0
maintainers:
- email: [email protected]
Expand Down
8 changes: 8 additions & 0 deletions keratin-authn-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Redis master connection string
{{- printf "mysql://%s-%s:3306/0" .Release.Name "-database" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "urlPath" -}}
{{ mustRegexReplaceAll "https?://([^/]*)(/.*)?" . "${2}" | trimSuffix "/" }}
{{- end -}}

{{- define "urlHost" -}}
{{ mustRegexReplaceAll "https?://([^/]*)(/.*)?" . "${1}" }}
{{- end -}}

{{- define "envs" -}}
{{- if $.Values.envFromSecret }}
{{- range $key, $value := $.Values.envFromSecret }}
Expand Down
9 changes: 4 additions & 5 deletions keratin-authn-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,18 @@ spec:
protocol: TCP
livenessProbe:
httpGet:
path: /health
path: {{ include "urlPath" .Values.appSettings.authnUrl }}/health
port: http
httpHeaders:
- name: Host
value: {{ .Values.appSettings.authnUrl | quote }}
value: {{ include "urlHost" .Values.appSettings.authnUrl }}
readinessProbe:
httpGet:
path: /health
path: {{ include "urlPath" .Values.appSettings.authnUrl }}/health
port: http
httpHeaders:
- name: Host
value: {{ .Values.appSettings.authnUrl | quote }}

value: {{ include "urlHost" .Values.appSettings.authnUrl }}
env:
{{- include "envs" . }}

Expand Down

0 comments on commit 27027ac

Please sign in to comment.