|
| 1 | +{{ $fullname := include "bricksllm.fullname" . -}} |
| 2 | +--- |
| 3 | +apiVersion: apps/v1 |
| 4 | +kind: Deployment |
| 5 | +metadata: |
| 6 | + name: {{ $fullname }} |
| 7 | + labels: |
| 8 | + {{- include "bricksllm.labels" . | nindent 4 }} |
| 9 | +spec: |
| 10 | + {{- if not .Values.autoscaling.enabled }} |
| 11 | + replicas: {{ .Values.replicaCount }} |
| 12 | + {{- end }} |
| 13 | + selector: |
| 14 | + matchLabels: |
| 15 | + {{- include "bricksllm.selectorLabels" . | nindent 6 }} |
| 16 | + template: |
| 17 | + metadata: |
| 18 | + {{- with .Values.podAnnotations }} |
| 19 | + annotations: |
| 20 | + {{- toYaml . | nindent 8 }} |
| 21 | + {{- end }} |
| 22 | + labels: |
| 23 | + {{- include "bricksllm.labels" . | nindent 8 }} |
| 24 | + {{- with .Values.podLabels }} |
| 25 | + {{- toYaml . | nindent 8 }} |
| 26 | + {{- end }} |
| 27 | + spec: |
| 28 | + {{- with .Values.imagePullSecrets }} |
| 29 | + imagePullSecrets: |
| 30 | + {{- toYaml . | nindent 8 }} |
| 31 | + {{- end }} |
| 32 | + serviceAccountName: {{ include "bricksllm.serviceAccountName" . }} |
| 33 | + securityContext: |
| 34 | + {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 35 | + containers: |
| 36 | + - name: {{ .Chart.Name }} |
| 37 | + securityContext: |
| 38 | + {{- toYaml .Values.securityContext | nindent 12 }} |
| 39 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 40 | + env: |
| 41 | + - name: POSTGRESQL_HOSTS |
| 42 | + value: '{{ $fullname }}-postgresql' |
| 43 | + - name: POSTGRESQL_USERNAME |
| 44 | + value: postgres |
| 45 | + - name: POSTGRESQL_PASSWORD |
| 46 | + valueFrom: |
| 47 | + secretKeyRef: |
| 48 | + name: '{{ $fullname }}-postgresql' |
| 49 | + key: postgres-password |
| 50 | + - name: REDIS_HOSTS |
| 51 | + value: '{{ $fullname }}-redis-master' |
| 52 | + - name: REDIS_PASSWORD |
| 53 | + valueFrom: |
| 54 | + secretKeyRef: |
| 55 | + name: '{{ $fullname }}-redis' |
| 56 | + key: redis-password |
| 57 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 58 | + ports: |
| 59 | + {{- range $n, $p := .Values.services.ports }} |
| 60 | + - name: {{ $n }} |
| 61 | + containerPort: {{ $p }} |
| 62 | + protocol: TCP |
| 63 | + {{- end }} |
| 64 | + {{- with .Values.livenessProbe }} |
| 65 | + livenessProbe: |
| 66 | + {{- toYaml . | nindent 12 }} |
| 67 | + {{- end }} |
| 68 | + {{- with .Values.readinesProbe }} |
| 69 | + readinessProbe: |
| 70 | + {{- toYaml . | nindent 12 }} |
| 71 | + {{- end }} |
| 72 | + {{- with .Values.resources }} |
| 73 | + resources: |
| 74 | + {{- toYaml . | nindent 12 }} |
| 75 | + {{- end }} |
| 76 | + {{- with .Values.volumeMounts }} |
| 77 | + volumeMounts: |
| 78 | + {{- toYaml . | nindent 12 }} |
| 79 | + {{- end }} |
| 80 | + {{- with .Values.volumes }} |
| 81 | + volumes: |
| 82 | + {{- toYaml . | nindent 8 }} |
| 83 | + {{- end }} |
| 84 | + {{- with .Values.nodeSelector }} |
| 85 | + nodeSelector: |
| 86 | + {{- toYaml . | nindent 8 }} |
| 87 | + {{- end }} |
| 88 | + {{- with .Values.affinity }} |
| 89 | + affinity: |
| 90 | + {{- toYaml . | nindent 8 }} |
| 91 | + {{- end }} |
| 92 | + {{- with .Values.tolerations }} |
| 93 | + tolerations: |
| 94 | + {{- toYaml . | nindent 8 }} |
| 95 | + {{- end }} |
0 commit comments