114 lines
3.9 KiB
YAML
114 lines
3.9 KiB
YAML
{{- if .Values.meta.enabled -}}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "supabase.meta.fullname" . }}
|
|
labels:
|
|
{{- include "supabase.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.meta.autoscaling.enabled }}
|
|
replicas: {{ .Values.meta.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "supabase.meta.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.meta.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "supabase.meta.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.meta.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "supabase.meta.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.meta.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: {{ include "supabase.meta.name" $ }}
|
|
securityContext:
|
|
{{- toYaml .Values.meta.securityContext | nindent 12 }}
|
|
image: "{{ .Values.meta.image.repository }}:{{ .Values.meta.image.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.meta.image.pullPolicy }}
|
|
env:
|
|
{{- range $key, $value := .Values.meta.environment }}
|
|
- name: {{ $key }}
|
|
value: {{ $value | quote }}
|
|
{{- end }}
|
|
{{- if .Values.db.enabled }}
|
|
- name: DB_HOST
|
|
value: {{ include "supabase.db.fullname" . }}
|
|
{{- end }}
|
|
- name: DB_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
{{- if .Values.secret.db.secretRef }}
|
|
name: {{ .Values.secret.db.secretRef }}
|
|
key: {{ .Values.secret.db.secretRefKey.password | default "password" }}
|
|
{{- else }}
|
|
name: {{ include "supabase.secret.db" . }}
|
|
key: password
|
|
{{- end }}
|
|
- name: DB_NAME
|
|
valueFrom:
|
|
secretKeyRef:
|
|
{{- if .Values.secret.db.secretRef }}
|
|
name: {{ .Values.secret.db.secretRef }}
|
|
key: {{ .Values.secret.db.secretRefKey.database | default "database" }}
|
|
{{- else }}
|
|
name: {{ include "supabase.secret.db" . }}
|
|
key: database
|
|
{{- end }}
|
|
- name: PG_META_DB_HOST
|
|
value: $(DB_HOST)
|
|
- name: PG_META_DB_PORT
|
|
value: $(DB_PORT)
|
|
- name: PG_META_DB_NAME
|
|
value: $(DB_NAME)
|
|
- name: PG_META_DB_USER
|
|
value: $(DB_USER)
|
|
- name: PG_META_DB_PASSWORD
|
|
value: $(DB_PASSWORD)
|
|
- name: PG_META_DB_SSL_MODE
|
|
value: $(DB_SSL)
|
|
{{- with .Values.meta.livenessProbe }}
|
|
livenessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.meta.readinessProbe }}
|
|
readinessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 8080
|
|
protocol: TCP
|
|
{{- with .Values.meta.resources }}
|
|
resources:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.meta.volumeMounts }}
|
|
volumeMounts:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.meta.volumes }}
|
|
volumes:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.meta.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.meta.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.meta.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }} |