|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: balius-{{ .Values.balius.network }}-{{ .Values.balius.salt }} |
| 5 | + namespace: {{ default .Release.Namespace }} |
| 6 | + labels: |
| 7 | + app.kubernetes.io/kind: Deployment |
| 8 | + app.kubernetes.io/instance: {{ .Release.Name }} |
| 9 | + cardano_network: {{ .Values.balius.network }} |
| 10 | +spec: |
| 11 | + replicas: {{ .Values.balius.replicas }} |
| 12 | + strategy: |
| 13 | + type: RollingUpdate |
| 14 | + rollingUpdate: |
| 15 | + maxSurge: {{ .Values.balius.rollingUpdate.maxSurge }} |
| 16 | + maxUnavailable: {{ .Values.balius.rollingUpdate.maxUnavailable }} |
| 17 | + selector: |
| 18 | + matchLabels: {{- include "balius.selectorLabels" . | nindent 6 }} |
| 19 | + template: |
| 20 | + metadata: |
| 21 | + name: balius-{{ .Values.balius.network }}-{{ .Values.balius.salt }} |
| 22 | + labels: {{- include "balius.selectorLabels" . | nindent 8 }} |
| 23 | + {{- with .Values.balius.podLabels }} |
| 24 | + {{- toYaml . | nindent 8 }} |
| 25 | + {{- end }} |
| 26 | + annotations: |
| 27 | + {{- with .Values.balius.podAnnotations }} |
| 28 | + {{- toYaml . | nindent 8 }} |
| 29 | + {{- end }} |
| 30 | + spec: |
| 31 | + restartPolicy: Always |
| 32 | + {{- if .Values.balius.serviceAccount.create }} |
| 33 | + serviceAccountName: {{ .Values.balius.serviceAccount.name }} |
| 34 | + {{- end }} |
| 35 | + securityContext: {{toYaml .Values.balius.securityContext | nindent 6 }} |
| 36 | + containers: |
| 37 | + - name: main |
| 38 | + image: {{ .Values.balius.image.repository }}:{{ .Values.balius.image.tag }} |
| 39 | + imagePullPolicy: {{ .Values.balius.image.pullPolicy }} |
| 40 | + env: |
| 41 | + - name: BALIUSD_CONFIG |
| 42 | + value: {{ .Values.balius.env.BALIUSD_CONFIG }} |
| 43 | + - name: POSTGRES_USER |
| 44 | + valueFrom: |
| 45 | + secretKeyRef: |
| 46 | + name: {{ .Values.balius.postgres.usernameSecret.name }} |
| 47 | + key: {{ .Values.balius.postgres.usernameSecret.key }} |
| 48 | + - name: POSTGRES_PASSWORD |
| 49 | + valueFrom: |
| 50 | + secretKeyRef: |
| 51 | + name: {{ .Values.balius.postgres.passwordSecret.name }} |
| 52 | + key: {{ .Values.balius.postgres.passwordSecret.key }} |
| 53 | + - name: POSTGRES_HOST |
| 54 | + value: {{ .Values.balius.postgres_host }} |
| 55 | + - name: BALIUSD_CONNECTION |
| 56 | + value: postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):5432/{{ .Values.balius.network | replace "-" "" }} |
| 57 | + - name: BALIUSD_POD |
| 58 | + valueFrom: |
| 59 | + fieldRef: |
| 60 | + fieldPath: metadata.name |
| 61 | + - name: BALIUSD_NAMESPACE |
| 62 | + valueFrom: |
| 63 | + fieldRef: |
| 64 | + fieldPath: metadata.namespace |
| 65 | + - name: AWS_REGION |
| 66 | + valueFrom: |
| 67 | + secretKeyRef: |
| 68 | + name: {{ .Values.balius.credentialsSecretName }} |
| 69 | + key: aws_region |
| 70 | + - name: AWS_ACCESS_KEY_ID |
| 71 | + valueFrom: |
| 72 | + secretKeyRef: |
| 73 | + name: {{ .Values.balius.credentialsSecretName }} |
| 74 | + key: aws_access_key_id |
| 75 | + - name: AWS_SECRET_ACCESS_KEY |
| 76 | + valueFrom: |
| 77 | + secretKeyRef: |
| 78 | + name: {{ .Values.balius.credentialsSecretName }} |
| 79 | + key: aws_secret_access_key |
| 80 | + ports: |
| 81 | + - name: api |
| 82 | + containerPort: {{ .Values.balius.containerPort }} |
| 83 | + - name: metrics |
| 84 | + containerPort: {{ .Values.balius.prometheusPort }} |
| 85 | + volumeMounts: |
| 86 | + - name: config |
| 87 | + mountPath: /etc/config |
| 88 | + resources: |
| 89 | + {{- toYaml .Values.balius.resources | nindent 12 }} |
| 90 | + volumes: |
| 91 | + - name: config |
| 92 | + configMap: |
| 93 | + name: baliusd-{{ .Values.balius.network }}-config |
| 94 | + {{- with .Values.balius.tolerations }} |
| 95 | + tolerations: |
| 96 | + {{- toYaml . | nindent 8 }} |
| 97 | + {{- end }} |
| 98 | + {{- with .Values.balius.affinity }} |
| 99 | + affinity: |
| 100 | + {{- toYaml . | nindent 8 }} |
| 101 | + {{- end }} |
0 commit comments