Skip to content

Commit

Permalink
Configure external redis
Browse files Browse the repository at this point in the history
  • Loading branch information
filippo.merante committed Jan 7, 2024
1 parent 246dede commit 705d892
Show file tree
Hide file tree
Showing 6 changed files with 701 additions and 687 deletions.
2 changes: 1 addition & 1 deletion charts/traccar/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: traccar
description: A Helm chart for Traccar GPS Server
type: application
version: 1.8.0
version: 1.9.0
appVersion: "5.10"
dependencies:
- name: mysql
Expand Down
1 change: 1 addition & 0 deletions charts/traccar/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ generate-template:
rm -rf ./manifests || true
helm template test-values . -f ./ci/test-values.yaml --namespace default --output-dir ./manifests/test-test --include-crds
helm template traccar-default . -f values.yaml --namespace default --output-dir ./manifests/traccar-default --include-crds
helm template traccar-redis-ha . -f ./ci/ha-with-redis-values.yaml --namespace default --output-dir ./manifests/traccar-redis-ha --include-crds
13 changes: 13 additions & 0 deletions charts/traccar/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ Create the name of the service account to use
{{- printf "%s:%s" .Values.image.repository $tag }}
{{- end }}
{{- end }}

{{- define "traccar.deploymentStrategy" -}}
{{- if or (.Values.traccar.broadcast.enabled) (index .Values "redis-ha").enabled }}
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: {{.Values.deploymentStrategy.maxSurge | default "25%" | quote }}
maxUnavailable: {{.Values.deploymentStrategy.maxUnavailable | default "25%" | quote }}
{{- else }}
strategy:
type: Recreate
{{- end }}
{{- end }}
7 changes: 5 additions & 2 deletions charts/traccar/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ data:
<entry key='logger.file'>/dev/stdout</entry>
<entry key='logger.rotate'>false</entry>
{{- end }}
{{ else }}
{{- else }}
<entry key='logger.enable'>false</entry>
{{- end }}

Expand Down Expand Up @@ -362,7 +362,6 @@ data:
{{- end }}
{{- end }}
{{- end }}

{{- if .Values.traccar.notificator }}
{{- if .Values.traccar.notificator.types }}
<entry key='notificator.types'>{{ .Values.traccar.notificator.types }}</entry>
Expand Down Expand Up @@ -392,6 +391,10 @@ data:
{{- if (index .Values "redis-ha").enabled }}
<entry key='broadcast.type'>redis</entry>
<entry key='broadcast.address'>redis://{{ include "traccar.fullname" . }}-redis-ha-haproxy:6379</entry>
{{- end }}
{{- if and (.Values.traccar.broadcast.enabled) (not (index .Values "redis-ha").enabled) }}
<entry key='broadcast.type'>redis</entry>
<entry key='broadcast.address'>{{ .Values.traccar.broadcast.address }}</entry>
{{- end }}
</properties>
{{- end }}
5 changes: 1 addition & 4 deletions charts/traccar/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ spec:
selector:
matchLabels:
{{- include "traccar.selectorLabels" . | nindent 6 }}
{{- with .Values.deploymentStrategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- include "traccar.deploymentStrategy" . | nindent 2 }}
template:
metadata:
annotations:
Expand Down
Loading

0 comments on commit 705d892

Please sign in to comment.