Listory/charts/listory/templates/deployment.yaml

108 lines
3.6 KiB
YAML
Raw Permalink Normal View History

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "listory.fullname" . }}
labels:
{{- include "listory.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "listory.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "listory.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "listory.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: DB_HOST
value: {{ .Values.externalDatabase.host }}
- name: DB_USERNAME
value: {{ .Values.externalDatabase.user }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "listory.fullname" . }}-external-db
key: postgres-password
- name: DB_DATABASE
value: {{ .Values.externalDatabase.database }}
- name: DB_POOL_MAX
value: "{{ .Values.database.poolMax }}"
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: {{ include "listory.fullname" . }}
key: jwt-secret
- name: APP_URL
value: https://{{ .Values.ingress.host }}
- name: SPOTIFY_CLIENT_ID
value: {{ .Values.spotify.clientId }}
- name: SPOTIFY_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ include "listory.fullname" . }}
key: spotify-client-secret
- name: SPOTIFY_USER_FILTER
value: {{ .Values.spotify.userFilter }}
2020-11-17 22:36:51 +01:00
{{- if .Values.sentry.enabled }}
2020-11-17 22:36:51 +01:00
- name: SENTRY_ENABLED
value: "true"
2020-11-17 22:36:51 +01:00
- name: SENTRY_DSN
value: {{ .Values.sentry.dsn }}
{{- end }}
{{- if .Values.opentelemetry.metrics.enabled }}
- name: OTEL_METRICS_ENABLED
value: "true"
- name: OTEL_EXPORTER_PROMETHEUS_PORT
value: "{{ .Values.opentelemetry.metrics.port }}"
{{- end }}
{{- if .Values.opentelemetry.traces.enabled }}
- name: OTEL_TRACES_ENABLED
value: "true"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "{{ .Values.opentelemetry.traces.otlpEndpoint }}"
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
ports:
- name: http
containerPort: 3000
protocol: TCP
{{- if .Values.opentelemetry.metrics.enabled }}
- name: metrics
containerPort: {{ .Values.opentelemetry.metrics.port }}
protocol: TCP
{{- end }}
readinessProbe:
httpGet:
path: /api/v1/health
port: http
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 }}