Clay Rosenthal 0ea257d030
adding secrets to helm (#1541)
* adding secrets to helm

* incrementing chart version
2024-05-31 19:11:36 -07:00

82 lines
2.9 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "danswer-stack.fullname" . }}-api
labels:
{{- include "danswer-stack.labels" . | nindent 4 }}
spec:
{{- if not .Values.api.autoscaling.enabled }}
replicas: {{ .Values.api.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "danswer-stack.selectorLabels" . | nindent 6 }}
{{- if .Values.api.deploymentLabels }}
{{- toYaml .Values.api.deploymentLabels | nindent 6 }}
{{- end }}
template:
metadata:
{{- with .Values.api.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "danswer-stack.labels" . | nindent 8 }}
{{- with .Values.api.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "danswer-stack.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.api.podSecurityContext | nindent 8 }}
containers:
- name: api-server
securityContext:
{{- toYaml .Values.api.securityContext | nindent 12 }}
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
command:
- "/bin/sh"
- "-c"
- |
alembic upgrade head &&
echo "Starting Danswer Api Server" &&
uvicorn danswer.main:app --host 0.0.0.0 --port 8080
ports:
- name: api-server-port
containerPort: {{ .Values.api.service.port }}
protocol: TCP
resources:
{{- toYaml .Values.api.resources | nindent 12 }}
envFrom:
- configMapRef:
name: {{ .Values.config.envConfigMapName }}
env:
{{- include "danswer-stack.envSecrets" . | nindent 12}}
volumeMounts:
- name: dynamic-storage
mountPath: /home/storage
- name: file-connector-storage
mountPath: /home/file_connector_storage
{{- if .Values.api.volumeMounts }}
{{- .Values.api.volumeMounts | toYaml | nindent 12}}
{{- end }}
volumes:
- name: dynamic-storage
persistentVolumeClaim:
claimName: {{ include "danswer-stack.fullname" . }}-api-dynamic
- name: file-connector-storage
{{- if .Values.persistence.api.connector.enabled }}
persistentVolumeClaim:
claimName: {{ include "danswer-stack.fullname" . }}-api-connector
{{- else }}
emptyDir: { }
{{- end }}
{{- if .Values.api.volumes }}
{{- .Values.api.volumes | toYaml | nindent 8}}
{{- end }}