Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure external redis #30

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 3 additions & 0 deletions charts/traccar/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ Get the application URL by running these commands:
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
{{- if .Values.deploymentStrategy.type }}
{{ printf "WARNING DEPRECATION: .Values.deploymentStrategy.type is no longer supported."}}
{{- end }}
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" -}}
filippolmt marked this conversation as resolved.
Show resolved Hide resolved
{{- if or (.Values.traccar.broadcast.enabled) (index .Values "redis-ha").enabled }}
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: {{ coalesce .Values.deploymentStrategy.maxSurge "25%" | quote }}
maxUnavailable: {{ coalesce .Values.deploymentStrategy.maxUnavailable "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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to change this to {{ required "A Redis address must be configured!" .Values.traccar.broadcast.address }} or something similar, to avoid issues where . Values.traccar.broadcast.enabled could be enabled without an address configured.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't change it, I don't think it's a good idea to add exceptions, plus to date it hasn't been configured/thought out to make it as you suggested.

{{- 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
Loading