charts/teslamate/templates/deployment.yaml
Jeff Billimek b332249e9d
Introduces the teslamate chart (#106)
* Introduces the teslamate chart

Fixes #101

Signed-off-by: Jeff Billimek <jeff@billimek.com>

* get on the startupprobe bandwagon
2019-12-22 00:19:10 -05:00

109 lines
4.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "teslamate.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "teslamate.name" . }}
helm.sh/chart: {{ include "teslamate.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "teslamate.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "teslamate.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- if .Values.postgresql.postgresqlUsername }}
- name: DATABASE_USER
value: {{ .Values.postgresql.postgresqlUsername | quote }}
{{- end }}
{{- if .Values.postgresql.postgresqlPassword }}
- name: DATABASE_PASS
value: {{ .Values.postgresql.postgresqlPassword | quote }}
{{- end }}
{{- if .Values.postgresql.postgresqlDatabase }}
- name: DATABASE_NAME
value: {{ .Values.postgresql.postgresqlDatabase | quote }}
{{- end }}
- name: DATABASE_HOST
value: {{ template "teslamate.postgresql.fullname" . }}
{{- if .Values.mqtt.enabled }}
- name: MQTT_HOST
value: {{ .Values.mqtt.host | quote }}
- name: MQTT_USERNAME
value: {{ .Values.mqtt.username | quote }}
- name: MQTT_PASSWORD
value: {{ .Values.mqtt.password | quote }}
- name: MQTT_TLS
value: {{ .Values.mqtt.tls | quote }}
- name: MQTT_TLS_ACCEPT_INVALID_CERTS
value: {{ .Values.mqtt.tlsAcceptInvalid | quote }}
{{- else }}
- name: DISABLE_MQTT
value: "true"
{{- end }}
{{- if .Values.timeZone }}
- name: TZ
value: {{ .Values.timeZone | quote }}
{{- end }}
{{- if .Values.checkOrigin }}
- name: CHECK_ORIGIN
value: {{ .Values.checkOrigin | quote }}
{{- end }}
{{- if .Values.virtualHost }}
- name: VIRTUAL_HOST
value: {{ .Values.virtualHost | quote }}
{{- end }}
{{- if .Values.locale }}
- name: LOCALE
value: {{ .Values.locale | quote }}
{{- end }}
ports:
- name: http
containerPort: 4000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
readinessProbe:
httpGet:
path: /
port: http
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
startupProbe:
httpGet:
path: /
port: http
initialDelaySeconds: {{ .Values.probes.startup.initialDelaySeconds }}
failureThreshold: {{ .Values.probes.startup.failureThreshold }}
periodSeconds: {{ .Values.probes.startup.periodSeconds }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}