Skip to content

Commit

Permalink
Merge pull request #20 from tamcore/feature/flavor
Browse files Browse the repository at this point in the history
add image.flavor
  • Loading branch information
tananaev authored Feb 11, 2023
2 parents fd3f5b1 + a3c0760 commit 02ff085
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,16 @@ The command removes all the Kubernetes components associated with the deplyoment

### Parameters
The chart incorporates every configuration file setting, which can be found [ here](https://www.traccar.org/configuration-file/)

### Image flavors
The [traccar container image](https://github.com/traccar/traccar-docker) comes in _different flavors_. Currently available are
* alpine
* debian
* ubuntu
If none is specified during installation of this chart, the default is alpine based.

To set your preferred flavor, you can use `--set image.flavor=debian` for example, or, for more reusability, append the following lines to your installation's `values.yaml`
```yaml
image:
flavor: "debian"
```
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.3.0
version: 1.4.0
appVersion: "5.6"
dependencies:
- name: mysql
Expand Down
9 changes: 9 additions & 0 deletions charts/traccar/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,12 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "traccar.image" -}}
{{- $tag := .Values.image.tag | default .Chart.AppVersion }}
{{- if .Values.image.flavor }}
{{- printf "%s:%s-%s" .Values.image.repository $tag .Values.image.flavor }}
{{- else }}
{{- printf "%s:%s" .Values.image.repository $tag }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/traccar/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: {{ include "traccar.image" . }}
command: ["java", "-Xms512m", "-Xmx512m", "-Djava.net.preferIPv4Stack=true"]
args: ["-jar", "tracker-server.jar", "conf/traccar.xml"]
imagePullPolicy: {{ .Values.image.pullPolicy }}
Expand Down
1 change: 1 addition & 0 deletions charts/traccar/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ mysql:
image:
repository: traccar/traccar
pullPolicy: IfNotPresent
# flavor: "" # available are alpine, debian or ubuntu
# Overrides the image tag whose default is the chart appVersion.
tag: ""

Expand Down

0 comments on commit 02ff085

Please sign in to comment.