Skip to content

Commit

Permalink
Add annotation in case of changing ConfigMap (#111)
Browse files Browse the repository at this point in the history
* Add annotation in case of the change of ConfigMap

If a ConfigMap changes that does not trigger re-deployment of Kiali Server. Since the ConfigMap is used for configuring Kiali Server the "rebooting" Kiali Server is mandatory.

* Add condition for root path

* Correct annotation according to web_root
  • Loading branch information
sly-roar authored Oct 13, 2021
1 parent 3752a64 commit aeadb29
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion kiali-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ Determine the default web root.
*/}}
{{- define "kiali-server.server.web_root" -}}
{{- if .Values.server.web_root }}
{{- .Values.server.web_root | trimSuffix "/" }}
{{- if (eq .Values.server.web_root "/") }}
{{- .Values.server.web_root }}
{{- else }}
{{- .Values.server.web_root | trimSuffix "/" }}
{{- end }}
{{- else }}
{{- if .Capabilities.APIVersions.Has "route.openshift.io/v1" }}
{{- "/" }}
Expand Down
1 change: 1 addition & 0 deletions kiali-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spec:
{{- toYaml .Values.deployment.pod_labels | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.server.metrics_enabled }}
prometheus.io/scrape: "true"
prometheus.io/port: {{ .Values.server.metrics_port | quote }}
Expand Down
4 changes: 2 additions & 2 deletions kiali-server/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ metadata:
{{- end }}
{{- if and (not (empty .Values.server.web_fqdn)) (not (empty .Values.server.web_schema)) }}
{{- if empty .Values.server.web_port }}
kiali.io/external-url: {{ .Values.server.web_schema }}://{{ .Values.server.web_fqdn }}{{ default "" .Values.server.web_root }}
kiali.io/external-url: {{ .Values.server.web_schema }}://{{ .Values.server.web_fqdn }}{{ include "kiali-server.server.web_root" . }}
{{- else }}
kiali.io/external-url: {{ .Values.server.web_schema }}://{{ .Values.server.web_fqdn }}:{{ .Values.server.web_port }}{{(default "" .Values.server.web_root) }}
kiali.io/external-url: {{ .Values.server.web_schema }}://{{ .Values.server.web_fqdn }}:{{ .Values.server.web_port }}{{ include "kiali-server.server.web_root" . }}
{{- end }}
{{- end }}
{{- if .Values.deployment.service_annotations }}
Expand Down

0 comments on commit aeadb29

Please sign in to comment.