|
| 1 | +{{- with $.Values.backend }} |
| 2 | +kind: Deployment |
| 3 | +apiVersion: apps/v1 |
| 4 | +metadata: |
| 5 | + name: {{ $.Release.Name }} |
| 6 | + namespace: {{ $.Release.Namespace }} |
| 7 | + |
| 8 | +spec: |
| 9 | + revisionHistoryLimit: 0 |
| 10 | + replicas: {{ .replicas }} |
| 11 | + strategy: |
| 12 | + type: Recreate |
| 13 | + |
| 14 | + selector: |
| 15 | + matchLabels: |
| 16 | + app: {{ $.Release.Name }}-backend |
| 17 | + template: |
| 18 | + metadata: |
| 19 | + labels: |
| 20 | + app: {{ $.Release.Name }}-backend |
| 21 | + spec: |
| 22 | + enableServiceLinks: false |
| 23 | + {{- if .nodeSelector }} |
| 24 | + nodeSelector: |
| 25 | + {{- .nodeSelector | toYaml | nindent 8 }} |
| 26 | + {{- end }} |
| 27 | + volumes: |
| 28 | + - name: config |
| 29 | + configMap: |
| 30 | + name: {{ .configMap.existingName }} |
| 31 | + - name: keys |
| 32 | + secret: |
| 33 | + secretName: {{ .keysSecret.existingName }} |
| 34 | + - name: cache |
| 35 | + emptyDir: {} |
| 36 | + |
| 37 | + containers: |
| 38 | + - name: traq |
| 39 | + image: {{ .image }} |
| 40 | + imagePullPolicy: Always |
| 41 | + ports: |
| 42 | + - name: http |
| 43 | + containerPort: 3000 |
| 44 | + env: |
| 45 | + # TODO: use "envFrom" for less configuration mess |
| 46 | + - name: TRAQ_MARIADB_PASSWORD |
| 47 | + valueFrom: |
| 48 | + secretKeyRef: |
| 49 | + name: {{ .secret.existingName }} |
| 50 | + key: mariadb_password |
| 51 | + - name: TRAQ_STORAGE_S3_ACCESSKEY |
| 52 | + valueFrom: |
| 53 | + secretKeyRef: |
| 54 | + name: {{ .secret.existingName }} |
| 55 | + key: storage_s3_access_key |
| 56 | + - name: TRAQ_STORAGE_S3_SECRETKEY |
| 57 | + valueFrom: |
| 58 | + secretKeyRef: |
| 59 | + name: {{ .secret.existingName }} |
| 60 | + key: storage_s3_secretKey |
| 61 | + - name: TRAQ_SKYWAY_SECRETKEY |
| 62 | + valueFrom: |
| 63 | + secretKeyRef: |
| 64 | + name: {{ .secret.existingName }} |
| 65 | + key: skyway_secretKey |
| 66 | + - name: TRAQ_ES_PASSWORD |
| 67 | + valueFrom: |
| 68 | + secretKeyRef: |
| 69 | + name: {{ .secret.existingName }} |
| 70 | + key: es_password |
| 71 | + - name: TRAQ_LIVEKIT_APIKEY |
| 72 | + valueFrom: |
| 73 | + secretKeyRef: |
| 74 | + name: {{ .secret.existingName }} |
| 75 | + key: livekit_apiKey |
| 76 | + - name: TRAQ_LIVEKIT_APISECRET |
| 77 | + valueFrom: |
| 78 | + secretKeyRef: |
| 79 | + name: {{ .secret.existingName }} |
| 80 | + key: livekit_apiSecret |
| 81 | + volumeMounts: |
| 82 | + - name: config |
| 83 | + mountPath: /app/config.yml |
| 84 | + subPath: config.yml |
| 85 | + - name: keys |
| 86 | + mountPath: /keys |
| 87 | + - name: cache |
| 88 | + mountPath: /storage |
| 89 | + {{- if .resources }} |
| 90 | + resources: |
| 91 | + {{- .resources | toYaml | nindent 12 }} |
| 92 | + {{- end }} |
| 93 | + |
| 94 | +{{- end }} |
0 commit comments