prole/supabase/helm/prole-supabase/templates/rest/deployment.yaml
chrisfu 5e0a1bda85 feat: Add GitOps (Gitea) and Supabase integration, plus database options
- Makefile: Added 'init' and 'deploy' targets for k3s parity and Gitea staging.

- OpenTofu: Fixed namespace handling in k3s main.tf to prevent metadata overwrites.

- UI: Added 'GitOps' and 'Database Options' configuration screens.

- Core: Enhanced monitoring, milestones, and environment handling for new services.

- Supabase: Integrated full Helm chart and manifest rendering logic.

- Gitea: Added deployment scripts and GitOps sync support.

- Database: Added Percona/Postgres Dockerfile templates and improved TDE scripts.

- Tests: Added coverage for new UI screens and navigation flows.
2026-02-26 18:32:15 -08:00

156 lines
5.9 KiB
YAML

{{- if .Values.deployment.rest.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "supabase.rest.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.rest.enabled }}
replicas: {{ .Values.deployment.rest.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "supabase.rest.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.deployment.rest.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "supabase.rest.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.image.rest.pullSecrets}}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "supabase.rest.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.deployment.rest.podSecurityContext | nindent 8 }}
initContainers:
- name: init-db
image: postgres:15-alpine
imagePullPolicy: IfNotPresent
env:
- name: DB_HOST
{{- if .Values.deployment.db.enabled }}
value: {{ include "supabase.db.fullname" . | quote }}
{{- else }}
value: {{ .Values.environment.auth.DB_HOST | quote }}
{{- end }}
- name: DB_PORT
value: {{ .Values.environment.auth.DB_PORT | quote }}
command: ["/bin/sh", "-c"]
args:
- |
until pg_isready -h $(DB_HOST) -p $(DB_PORT) -U postgres; do
echo "Waiting for database to start..."
sleep 2
done
- echo "Database is ready"
containers:
- name: {{ include "supabase.rest.name" $ }}
securityContext:
{{- toYaml .Values.deployment.rest.securityContext | nindent 12 }}
image: "{{ .Values.image.rest.repository }}:{{ .Values.image.rest.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.rest.pullPolicy }}
env:
{{- range $key, $value := .Values.environment.rest }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.deployment.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_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_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: PGRST_DB_URI
value: $(DB_DRIVER)://$(DB_USER):$(DB_PASSWORD_ENC)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)?sslmode=$(DB_SSL)
- name: PGRST_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: PGRST_APP_SETTINGS_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 }}
{{- with .Values.deployment.rest.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.deployment.rest.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 3000
protocol: TCP
{{- with .Values.deployment.rest.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.deployment.rest.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.deployment.rest.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.rest.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.rest.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.deployment.rest.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}