mirror of
https://github.com/dredx/prole.git
synced 2026-09-27 07:44:29 +00:00
- align app/db cluster defaults for knoe-dev-0 + knoe-dev-cnpg-0 on e2-standard-2\n- harden Supabase deploy flow for cross-cluster DB ILB, GKE storage class, and node selector fallback\n- migrate Helm chart path to knoe-supabase and make external DB host rendering IP-safe\n- disable Kerberos in prod unattended config to prevent Supabase GSS auth failures\n- add Supabase port-forward mappings and DB backup context handling improvements\n\nBuild status: k8s stable Co-authored-by: Junie <junie@jetbrains.com>
177 lines
7.5 KiB
YAML
177 lines
7.5 KiB
YAML
{{- if .Values.deployment.functions.enabled -}}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "supabase.functions.fullname" . }}
|
|
labels:
|
|
{{- include "supabase.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.functions.enabled }}
|
|
replicas: {{ .Values.deployment.functions.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "supabase.functions.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.deployment.functions.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "supabase.functions.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.image.functions.pullSecrets}}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "supabase.functions.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.deployment.functions.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- args:
|
|
- start
|
|
- --main-service
|
|
- /home/deno/functions/main
|
|
name: {{ include "supabase.functions.name" $ }}
|
|
securityContext:
|
|
{{- toYaml .Values.deployment.functions.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.functions.repository }}:{{ .Values.image.functions.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.functions.pullPolicy }}
|
|
{{- if .Values.deployment.functions.envFrom }}
|
|
envFrom:
|
|
{{- toYaml .Values.deployment.functions.envFrom | nindent 12 }}
|
|
{{- end }}
|
|
env:
|
|
{{- range $key, $value := .Values.environment.functions }}
|
|
{{- if and (ne $key "DB_HOST") (ne $key "DB_HOSTNAME") (ne $key "DB_PORT") (ne $key "DB_SSL") }}
|
|
- name: {{ $key }}
|
|
value: {{ $value | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{- if .Values.deployment.kong.enabled }}
|
|
- name: SUPABASE_URL
|
|
value: {{ printf "http://%s:%v" (include "supabase.kong.fullname" .) .Values.service.kong.port | quote }}
|
|
{{- end }}
|
|
|
|
- name: DB_HOSTNAME
|
|
value: {{ include "supabase.database.host" . | quote }}
|
|
- name: DB_PORT
|
|
value: {{ include "supabase.database.port" . | quote }}
|
|
- name: DB_SSL
|
|
value: {{ include "supabase.database.ssl" . | quote }}
|
|
- 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_PASSWORD_ENC
|
|
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_encoded
|
|
{{- end }}
|
|
- name: DB_DATABASE
|
|
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: JWT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
{{- if .Values.secret.jwt.secretRef }}
|
|
name: {{ .Values.secret.jwt.secretRef }}
|
|
key: {{ .Values.secret.jwt.secretRefKey.secret | default "secret" }}
|
|
{{- else }}
|
|
name: {{ include "supabase.secret.jwt" . }}
|
|
key: secret
|
|
{{- end }}
|
|
- name: SUPABASE_ANON_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
{{- if .Values.secret.jwt.secretRef }}
|
|
name: {{ .Values.secret.jwt.secretRef }}
|
|
key: {{ .Values.secret.jwt.secretRefKey.anonKey | default "anonKey" }}
|
|
{{- else }}
|
|
name: {{ include "supabase.secret.jwt" . }}
|
|
key: anonKey
|
|
{{- end }}
|
|
- name: SUPABASE_SERVICE_ROLE_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
{{- if .Values.secret.jwt.secretRef }}
|
|
name: {{ .Values.secret.jwt.secretRef }}
|
|
key: {{ .Values.secret.jwt.secretRefKey.serviceKey | default "serviceKey" }}
|
|
{{- else }}
|
|
name: {{ include "supabase.secret.jwt" . }}
|
|
key: serviceKey
|
|
{{- end }}
|
|
- name: SUPABASE_DB_URL
|
|
value: $(DB_DRIVER)://$(DB_USERNAME):$(DB_PASSWORD_ENC)@{{ include "supabase.database.host" . }}:{{ include "supabase.database.port" . }}/{{ include "supabase.database.name" . }}?search_path=auth&sslmode={{ include "supabase.database.ssl" . }}
|
|
{{- with .Values.deployment.functions.livenessProbe }}
|
|
livenessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.deployment.functions.readinessProbe }}
|
|
readinessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
{{- with .Values.deployment.functions.volumeMounts }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.persistence.functions.enabled }}
|
|
- name: functions-storage
|
|
mountPath: /home/deno/functions
|
|
{{- end }}
|
|
{{- if .Values.persistence.deno.enabled }}
|
|
- name: deno-cache
|
|
mountPath: /root/.cache/deno
|
|
{{- end }}
|
|
- mountPath: /home/deno/functions/main/index.ts
|
|
name: functions-main
|
|
subPath: index.ts
|
|
{{- with .Values.deployment.functions.resources }}
|
|
resources:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
volumes:
|
|
{{- with .Values.deployment.functions.volumes }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.persistence.functions.enabled }}
|
|
- name: functions-storage
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "supabase.pvc.name" (dict "root" $ "name" "functions") }}
|
|
{{- end }}
|
|
{{- if .Values.persistence.deno.enabled }}
|
|
- name: deno-cache
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "supabase.pvc.name" (dict "root" $ "name" "deno") }}
|
|
{{- end }}
|
|
- name: functions-main
|
|
configMap:
|
|
name: {{ include "supabase.functions.fullname" . }}-main
|
|
{{- include "supabase.enforcedGeneralNodeSelector" (dict "nodeSelector" .Values.deployment.functions.nodeSelector) | nindent 6 }}
|
|
{{- include "supabase.enforcedGeneralAffinity" (dict "affinity" .Values.deployment.functions.affinity) | nindent 6 }}
|
|
{{- with .Values.deployment.functions.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|