mirror of
https://github.com/dredx/prole.git
synced 2026-09-24 14:44:32 +00:00
- Introduced `enforceGeneralNodeRole` to make node affinity and selector enforcement configurable. - Updated `_split_frontdoor_docs` to handle custom release labels for Kong services. - Enhanced Helm templates to support dynamic scheduling configurations. - Added `reconcile_db_frontdoor_studio_pvcs` to migrate PVCs to the target storage class. - Updated tests to validate custom release labels and scheduling logic.
221 lines
9.3 KiB
YAML
221 lines
9.3 KiB
YAML
{{- if .Values.deployment.studio.enabled -}}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "supabase.studio.fullname" . }}
|
|
labels:
|
|
{{- include "supabase.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.autoscaling.studio.enabled }}
|
|
replicas: {{ .Values.deployment.studio.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "supabase.studio.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.deployment.studio.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "supabase.studio.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.image.studio.pullSecrets}}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "supabase.studio.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.deployment.studio.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: {{ include "supabase.studio.name" $ }}
|
|
securityContext:
|
|
{{- toYaml .Values.deployment.studio.securityContext | nindent 12 }}
|
|
image: "{{ .Values.image.studio.repository }}:{{ .Values.image.studio.tag | default .Chart.AppVersion }}"
|
|
imagePullPolicy: {{ .Values.image.studio.pullPolicy }}
|
|
env:
|
|
{{- range $key, $value := .Values.environment.studio }}
|
|
{{- if and (ne $key "POSTGRES_HOST") (ne $key "POSTGRES_PORT") }}
|
|
- 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 }}
|
|
{{- if .Values.deployment.meta.enabled }}
|
|
- name: STUDIO_PG_META_URL
|
|
value: {{ printf "http://%s:%v" (include "supabase.meta.fullname" .) .Values.service.meta.port | quote }}
|
|
{{- end }}
|
|
|
|
- name: POSTGRES_HOST
|
|
value: {{ include "supabase.database.host" . | quote }}
|
|
- name: POSTGRES_PORT
|
|
value: {{ include "supabase.database.port" . | quote }}
|
|
|
|
- name: POSTGRES_DB
|
|
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: POSTGRES_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: PG_META_CRYPTO_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
{{- if .Values.secret.meta.secretRef }}
|
|
name: {{ .Values.secret.meta.secretRef }}
|
|
key: {{ .Values.secret.meta.secretRefKey.cryptoKey | default "cryptoKey" }}
|
|
{{- else }}
|
|
name: {{ include "supabase.secret.meta" . }}
|
|
key: cryptoKey
|
|
{{- end }}
|
|
|
|
|
|
- name: OPENAI_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
{{- if .Values.secret.dashboard.secretRef }}
|
|
name: {{ .Values.secret.dashboard.secretRef }}
|
|
key: {{ .Values.secret.dashboard.secretRefKey.openAiApiKey | default "openAiApiKey" }}
|
|
{{- else }}
|
|
name: {{ include "supabase.secret.dashboard" . }}
|
|
key: openAiApiKey
|
|
{{- 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_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: AUTH_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 }}
|
|
|
|
{{- if .Values.deployment.analytics.enabled }}
|
|
- name: LOGFLARE_URL
|
|
value: {{ printf "http://%s:%v" (include "supabase.analytics.fullname" .) .Values.service.analytics.port | quote }}
|
|
- name: LOGFLARE_PUBLIC_ACCESS_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
{{- if .Values.secret.analytics.secretRef }}
|
|
name: {{ .Values.secret.analytics.secretRef }}
|
|
key: {{ .Values.secret.analytics.secretRefKey.publicAccessToken | default "publicAccessToken" }}
|
|
{{- else }}
|
|
name: {{ include "supabase.secret.analytics" . }}
|
|
key: publicAccessToken
|
|
{{- end }}
|
|
- name: LOGFLARE_PRIVATE_ACCESS_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
{{- if .Values.secret.analytics.secretRef }}
|
|
name: {{ .Values.secret.analytics.secretRef }}
|
|
key: {{ .Values.secret.analytics.secretRefKey.privateAccessToken | default "privateAccessToken" }}
|
|
{{- else }}
|
|
name: {{ include "supabase.secret.analytics" . }}
|
|
key: privateAccessToken
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.persistence.functions.enabled }}
|
|
- name: EDGE_FUNCTIONS_MANAGEMENT_FOLDER
|
|
value: /home/deno/functions
|
|
{{- end }}
|
|
{{- if .Values.persistence.snippets.enabled }}
|
|
- name: SNIPPETS_MANAGEMENT_FOLDER
|
|
value: /app/snippets
|
|
{{- end }}
|
|
{{- with .Values.deployment.studio.livenessProbe }}
|
|
livenessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.deployment.studio.readinessProbe }}
|
|
readinessProbe:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 3000
|
|
protocol: TCP
|
|
{{- with .Values.deployment.studio.resources }}
|
|
resources:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- if or .Values.deployment.studio.volumeMounts .Values.persistence.functions.enabled }}
|
|
volumeMounts:
|
|
{{- with .Values.deployment.studio.volumeMounts }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- if .Values.persistence.functions.enabled }}
|
|
- name: functions-storage
|
|
mountPath: /home/deno/functions
|
|
{{- end }}
|
|
{{- if .Values.persistence.snippets.enabled }}
|
|
- name: snippets-storage
|
|
mountPath: /app/snippets
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if or .Values.deployment.studio.volumes .Values.persistence.functions.enabled }}
|
|
volumes:
|
|
{{- with .Values.deployment.studio.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.snippets.enabled }}
|
|
- name: snippets-storage
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "supabase.pvc.name" (dict "root" $ "name" "snippets") }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- include "supabase.enforcedGeneralNodeSelector" (dict "nodeSelector" .Values.deployment.studio.nodeSelector "enforceGeneralNodeRole" .Values.scheduling.enforceGeneralNodeRole) | nindent 6 }}
|
|
{{- include "supabase.enforcedGeneralAffinity" (dict "affinity" .Values.deployment.studio.affinity "enforceGeneralNodeRole" .Values.scheduling.enforceGeneralNodeRole) | nindent 6 }}
|
|
{{- with .Values.deployment.studio.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|