|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "ai-chat-service.fullname" . }} |
| 5 | + labels: |
| 6 | + {{- include "ai-chat-service.labels" . | nindent 4 }} |
| 7 | +spec: |
| 8 | + {{- if not .Values.autoscaling.enabled }} |
| 9 | + replicas: {{ .Values.replicaCount }} |
| 10 | + {{- end }} |
| 11 | + {{- if .Values.updateStrategy }} |
| 12 | + strategy: |
| 13 | + {{- toYaml .Values.updateStrategy | nindent 4 }} |
| 14 | + {{- end }} |
| 15 | + selector: |
| 16 | + matchLabels: |
| 17 | + {{- include "ai-chat-service.selectorLabels" . | nindent 6 }} |
| 18 | + template: |
| 19 | + metadata: |
| 20 | + {{- with .Values.podAnnotations }} |
| 21 | + annotations: |
| 22 | + {{- toYaml . | nindent 8 }} |
| 23 | + {{- end }} |
| 24 | + labels: |
| 25 | + {{- include "ai-chat-service.selectorLabels" . | nindent 8 }} |
| 26 | + spec: |
| 27 | + {{- with .Values.imagePullSecrets }} |
| 28 | + imagePullSecrets: |
| 29 | + {{- toYaml . | nindent 8 }} |
| 30 | + {{- end }} |
| 31 | + {{- if .Values.serviceAccount.create }} |
| 32 | + serviceAccountName: {{ .Values.serviceAccount.name }} |
| 33 | + {{- end }} |
| 34 | + containers: |
| 35 | + - name: {{ .Chart.Name }} |
| 36 | + image: "{{ .Values.image.repository }}:ai-chat-{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 37 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 38 | + {{- if .Values.command }} |
| 39 | + {{- with .Values.command }} |
| 40 | + command: |
| 41 | + {{- toYaml . | nindent 12 }} |
| 42 | + {{- end }} |
| 43 | + {{- end }} |
| 44 | + {{- if .Values.args }} |
| 45 | + {{- with .Values.args }} |
| 46 | + args: |
| 47 | + {{- toYaml . | nindent 12 }} |
| 48 | + {{- end }} |
| 49 | + {{- end }} |
| 50 | + ports: |
| 51 | + - containerPort: {{ .Values.container.port }} |
| 52 | + env: |
| 53 | +###################### START OF APP CONFIG ############################# |
| 54 | + - name: HOST |
| 55 | + value: {{ .Values.appConfig.HOST | quote }} |
| 56 | + - name: PORT |
| 57 | + value: {{ .Values.appConfig.PORT | quote }} |
| 58 | + - name: WORKERS |
| 59 | + value: {{ .Values.appConfig.WORKERS | quote }} |
| 60 | + - name: RELOAD |
| 61 | + value: {{ .Values.appConfig.RELOAD | quote }} |
| 62 | + - name: LOGGING_LEVEL |
| 63 | + value: {{ .Values.appConfig.LOGGING_LEVEL | quote }} |
| 64 | + - name: LOGGING_FORMAT |
| 65 | + value: {{ .Values.appConfig.LOGGING_FORMAT | quote }} |
| 66 | + - name: API_VERSION |
| 67 | + value: {{ .Values.appConfig.API_VERSION | quote }} |
| 68 | + - name: SYSTEM_PROMPT |
| 69 | + value: {{ .Values.appConfig.SYSTEM_PROMPT | quote }} |
| 70 | + - name: AZURE_ENDPOINT_URL |
| 71 | + value: {{ .Values.appConfig.AZURE_ENDPOINT_URL | quote }} |
| 72 | + - name: AZURE_SEARCH_ENDPOINT |
| 73 | + value: {{ .Values.appConfig.AZURE_SEARCH_ENDPOINT | quote }} |
| 74 | + - name: AZURE_SEARCH_INDEX |
| 75 | + value: {{ .Values.appConfig.AZURE_SEARCH_INDEX | quote }} |
| 76 | + - name: AZURE_DEPLOYMENT |
| 77 | + value: {{ .Values.appConfig.AZURE_DEPLOYMENT | quote }} |
| 78 | + - name: CHAT_HISTORY_LEN |
| 79 | + value: {{ .Values.appConfig.CHAT_HISTORY_LEN | quote }} |
| 80 | + - name: SERVICE_CLIENT_TIMEOUT |
| 81 | + value: {{ .Values.appConfig.SERVICE_CLIENT_TIMEOUT | quote }} |
| 82 | + |
| 83 | +# Microservices connections |
| 84 | +#if tenant id is not set |
| 85 | +{{- if not .Values.appConfig.tenant_id }} |
| 86 | + - name: AUTH_SERVICE |
| 87 | + value: "http://auth.utility:5061" |
| 88 | +{{- else }} |
| 89 | + - name: AUTH_SERVICE |
| 90 | + value: "http://auth.{{ .Values.appConfig.tenant_id }}-utility:5061" |
| 91 | +{{- end}} |
| 92 | + |
| 93 | +# redis |
| 94 | +{{- if not .Values.appConfig.tenant_id }} |
| 95 | + - name: REDIS_HOST |
| 96 | + value: {{ .Values.appConfig.REDIS_HOST | quote }} |
| 97 | +{{- else }} |
| 98 | + - name: REDIS_HOST |
| 99 | + value: "redis-master.{{ .Values.appConfig.tenant_id }}-redis" |
| 100 | +{{- end }} |
| 101 | + - name: REDIS_PORT |
| 102 | + value: {{ .Values.appConfig.REDIS_PORT | quote }} |
| 103 | + |
| 104 | +# open telemetry |
| 105 | + - name: OPEN_TELEMETRY_ENABLED |
| 106 | + value: {{ .Values.appConfig.OPEN_TELEMETRY_ENABLED | quote }} |
| 107 | + - name: OPEN_TELEMETRY_HOST |
| 108 | + value: {{ .Values.appConfig.OPEN_TELEMETRY_HOST | quote }} |
| 109 | + - name: OPEN_TELEMETRY_PORT |
| 110 | + value: {{ .Values.appConfig.OPEN_TELEMETRY_PORT | quote }} |
| 111 | +###################### END OF APP CONFIG ############################# |
| 112 | +{{- if .Values.extraEnv }} |
| 113 | + {{- range $key, $value := .Values.extraEnv }} |
| 114 | + - name: {{ $key }} |
| 115 | + value: {{ $value | quote }} |
| 116 | + {{- end }} |
| 117 | +{{- end }} |
| 118 | +{{- with .Values.extraEnvYaml }} |
| 119 | + {{- toYaml . | nindent 10 }} |
| 120 | +{{- end }} |
| 121 | + resources: |
| 122 | + {{- toYaml .Values.resources | nindent 12 }} |
| 123 | + {{- if .Values.readinessProbe }} |
| 124 | + readinessProbe: |
| 125 | + {{- toYaml .Values.readinessProbe | nindent 12 }} |
| 126 | + {{- end }} |
| 127 | + {{- if .Values.livenessProbe }} |
| 128 | + livenessProbe: |
| 129 | + {{- toYaml .Values.livenessProbe | nindent 12 }} |
| 130 | + {{- end }} |
| 131 | + {{- with .Values.nodeSelector }} |
| 132 | + nodeSelector: |
| 133 | + {{- toYaml . | nindent 8 }} |
| 134 | + {{- end }} |
| 135 | + {{- with .Values.affinity }} |
| 136 | + affinity: |
| 137 | + {{- toYaml . | nindent 8 }} |
| 138 | + {{- end }} |
| 139 | + {{- with .Values.tolerations }} |
| 140 | + tolerations: |
| 141 | + {{- toYaml . | nindent 8 }} |
| 142 | + {{- end }} |
0 commit comments