2025-03-12 13:52:15 +01:00

115 lines
4.2 KiB
YAML

{{- if .Values.studio.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "supabase.studio.fullname" . }}
labels:
{{- include "supabase.labels" . | nindent 4 }}
spec:
{{- if not .Values.studio.autoscaling.enabled }}
replicas: {{ .Values.studio.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "supabase.studio.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.studio.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "supabase.studio.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.studio.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "supabase.studio.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.studio.podSecurityContext | nindent 8 }}
containers:
- name: {{ include "supabase.studio.name" $ }}
securityContext:
{{- toYaml .Values.studio.securityContext | nindent 12 }}
image: "{{ .Values.studio.image.repository }}:{{ .Values.studio.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.studio.image.pullPolicy }}
env:
{{- range $key, $value := .Values.studio.environment }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.kong.enabled }}
- name: SUPABASE_URL
value: http://{{ include "supabase.kong.fullname" . }}:{{ .Values.kong.service.port }}
{{- end }}
{{- if .Values.meta.enabled }}
- name: STUDIO_PG_META_URL
value: http://{{ include "supabase.meta.fullname" . }}:{{ .Values.meta.service.port }}
{{- 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 }}
{{- if .Values.analytics.enabled }}
- name: LOGFLARE_URL
value: http://{{ include "supabase.analytics.fullname" . }}:{{ .Values.analytics.service.port }}
- name: LOGFLARE_API_KEY
valueFrom:
secretKeyRef:
name: {{ include "supabase.secret.analytics" . }}
key: apiKey
{{- end }}
{{- with .Values.studio.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.studio.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 3000
protocol: TCP
{{- with .Values.studio.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.studio.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.studio.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.studio.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.studio.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.studio.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}