|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "helm-chart.fullname" . }} |
| 5 | + labels: |
| 6 | + {{- include "helm-chart.labels" . | nindent 4 }} |
| 7 | +spec: |
| 8 | + {{- if not .Values.autoscaling.enabled }} |
| 9 | + replicas: {{ .Values.replicaCount }} |
| 10 | + {{- end }} |
| 11 | + selector: |
| 12 | + matchLabels: |
| 13 | + {{- include "helm-chart.selectorLabels" . | nindent 6 }} |
| 14 | + template: |
| 15 | + metadata: |
| 16 | + {{- with .Values.podAnnotations }} |
| 17 | + annotations: |
| 18 | + {{- toYaml . | nindent 8 }} |
| 19 | + {{- end }} |
| 20 | + labels: |
| 21 | + {{- include "helm-chart.selectorLabels" . | nindent 8 }} |
| 22 | + spec: |
| 23 | + {{- with .Values.imagePullSecrets }} |
| 24 | + imagePullSecrets: |
| 25 | + {{- toYaml . | nindent 8 }} |
| 26 | + {{- end }} |
| 27 | + {{- with .Values.hostAliases }} |
| 28 | + hostAliases: |
| 29 | + {{ toYaml . | nindent 8 }} |
| 30 | + {{- end }} |
| 31 | + serviceAccountName: {{ include "helm-chart.serviceAccountName" . }} |
| 32 | + securityContext: |
| 33 | + {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 34 | + containers: |
| 35 | + {{- with .Values.db }} |
| 36 | + - name: {{ $.Chart.Name }}-db |
| 37 | + image: "{{ .image.repository }}:{{ .image.tag | default $.Chart.AppVersion }}" |
| 38 | + imagePullPolicy: {{ .image.pullPolicy }} |
| 39 | + env: |
| 40 | + - name: POSTGRES_DB |
| 41 | + value: paws |
| 42 | + envFrom: |
| 43 | + - secretRef: |
| 44 | + name: db-pass |
| 45 | + ports: |
| 46 | + - name: postgresql |
| 47 | + containerPort: 5432 |
| 48 | + protocol: TCP |
| 49 | + # volumeMounts: |
| 50 | + # - name: {{ $.Release.Name }}-db |
| 51 | + # mountPath: /var/lib/postgresql/data |
| 52 | + # subPath: postgresql-data |
| 53 | + {{- end }} |
| 54 | + {{- with .Values.server }} |
| 55 | + - name: {{ $.Chart.Name }}-server |
| 56 | + image: "{{ .image.repository }}:{{ .image.tag | default $.Chart.AppVersion }}" |
| 57 | + imagePullPolicy: {{ .image.pullPolicy }} |
| 58 | + envFrom: |
| 59 | + - secretRef: |
| 60 | + name: api-server-pws |
| 61 | + - secretRef: |
| 62 | + name: db-pass |
| 63 | + ports: |
| 64 | + - containerPort: 5000 |
| 65 | + protocol: TCP |
| 66 | + livenessProbe: |
| 67 | + httpGet: |
| 68 | + path: /api/user/test |
| 69 | + port: 5000 |
| 70 | + readinessProbe: |
| 71 | + httpGet: |
| 72 | + path: /api/user/test |
| 73 | + port: 5000 |
| 74 | + {{- end }} |
| 75 | + |
| 76 | + {{- with .Values.client }} |
| 77 | + - name: {{ $.Chart.Name }}-client |
| 78 | + image: "{{ .image.repository }}:{{ .image.tag | default $.Chart.AppVersion }}" |
| 79 | + imagePullPolicy: {{ .image.pullPolicy }} |
| 80 | + ports: |
| 81 | + - name: http |
| 82 | + containerPort: 80 |
| 83 | + protocol: TCP |
| 84 | + livenessProbe: |
| 85 | + httpGet: |
| 86 | + path: / |
| 87 | + port: http |
| 88 | + readinessProbe: |
| 89 | + httpGet: |
| 90 | + path: / |
| 91 | + port: http |
| 92 | + {{- end }} |
| 93 | + {{- with .Values.nodeSelector }} |
| 94 | + nodeSelector: |
| 95 | + {{- toYaml . | nindent 8 }} |
| 96 | + {{- end }} |
| 97 | + {{- with .Values.affinity }} |
| 98 | + affinity: |
| 99 | + {{- toYaml . | nindent 8 }} |
| 100 | + {{- end }} |
| 101 | + {{- with .Values.tolerations }} |
| 102 | + tolerations: |
| 103 | + {{- toYaml . | nindent 8 }} |
| 104 | + {{- end }} |
0 commit comments