Woojoong Kim | d3c132c | 2020-08-26 14:46:47 -0700 | [diff] [blame] | 1 | {{- /* |
| 2 | |
| 3 | # Copyright 2020-present Open Networking Foundation |
| 4 | # |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 7 | |
| 8 | */ -}} |
| 9 | |
| 10 | {{ tuple "thingsboard" . | include "thingsboard-iot-platform.service_account" }} |
| 11 | --- |
| 12 | apiVersion: apps/v1 |
| 13 | kind: Deployment |
| 14 | metadata: |
| 15 | name: postgres |
| 16 | labels: |
| 17 | app: postgres |
| 18 | spec: |
| 19 | selector: |
| 20 | matchLabels: |
| 21 | app: postgres |
| 22 | template: |
| 23 | metadata: |
| 24 | labels: |
| 25 | app: postgres |
| 26 | spec: |
| 27 | serviceAccountName: thingsboard |
| 28 | volumes: |
| 29 | - name: postgres-conf |
| 30 | configMap: |
| 31 | name: postgres-conf |
| 32 | items: |
| 33 | - key: config |
| 34 | path: config/postgresql.conf.sample |
| 35 | containers: |
| 36 | - name: postgres |
| 37 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 38 | image: {{ .Values.images.tags.postgres }} |
| 39 | ports: |
| 40 | - containerPort: {{ .Values.config.postgres.port }} |
| 41 | name: postgres |
| 42 | env: |
| 43 | - name: POSTGRES_DB |
| 44 | value: "thingsboard" |
| 45 | - name: POSTGRES_PASSWORD |
| 46 | value: "postgres" |
| 47 | - name: PGDATA |
| 48 | value: /var/lib/postgresql/data/pgdata |
| 49 | volumeMounts: |
| 50 | - mountPath: /usr/share/postgresql/postgresql.conf.sample |
| 51 | subPath: config/postgresql.conf.sample |
| 52 | name: postgres-conf |
| 53 | # volumeMounts: |
| 54 | # - mountPath: /var/lib/postgresql/data |
| 55 | # name: postgres-data |
| 56 | livenessProbe: |
| 57 | exec: |
| 58 | command: |
| 59 | - pg_isready |
| 60 | - -h |
| 61 | - localhost |
| 62 | - -U |
| 63 | - postgres |
| 64 | initialDelaySeconds: 60 |
| 65 | timeoutSeconds: 30 |
| 66 | readinessProbe: |
| 67 | exec: |
| 68 | command: |
| 69 | - pg_isready |
| 70 | - -h |
| 71 | - localhost |
| 72 | - -U |
| 73 | - postgres |
| 74 | initialDelaySeconds: 5 |
| 75 | timeoutSeconds: 1 |
| 76 | restartPolicy: Always |