Zack Williams | 3432b94 | 2018-04-24 17:46:41 -0700 | [diff] [blame] | 1 | --- |
Gopinath Taget | b6a79b1 | 2018-03-08 17:27:37 -0800 | [diff] [blame] | 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
Gopinath Taget | 9b609e0 | 2018-03-07 16:02:50 -0800 | [diff] [blame] | 16 | apiVersion: extensions/v1beta1 |
| 17 | kind: Deployment |
| 18 | metadata: |
| 19 | name: xos-db |
| 20 | labels: |
Andy Bavier | 3e262f2 | 2018-03-22 12:24:41 -0700 | [diff] [blame] | 21 | app: xos-db |
Gopinath Taget | 9b609e0 | 2018-03-07 16:02:50 -0800 | [diff] [blame] | 22 | spec: |
| 23 | replicas: 1 |
| 24 | template: |
| 25 | metadata: |
| 26 | labels: |
Andy Bavier | 3e262f2 | 2018-03-22 12:24:41 -0700 | [diff] [blame] | 27 | app: xos-db |
Gopinath Taget | 9b609e0 | 2018-03-07 16:02:50 -0800 | [diff] [blame] | 28 | spec: |
| 29 | containers: |
Andy Bavier | 3e262f2 | 2018-03-22 12:24:41 -0700 | [diff] [blame] | 30 | - name: xos-db |
Zack Williams | d9d6b35 | 2018-10-05 07:53:30 -0700 | [diff] [blame] | 31 | image: {{ .Values.global.registry }}{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }} |
| 32 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
Gopinath Taget | 9b609e0 | 2018-03-07 16:02:50 -0800 | [diff] [blame] | 33 | ports: |
Andy Bavier | 3e262f2 | 2018-03-22 12:24:41 -0700 | [diff] [blame] | 34 | - containerPort: 5432 |
Gopinath Taget | 9b609e0 | 2018-03-07 16:02:50 -0800 | [diff] [blame] | 35 | protocol: TCP |
| 36 | env: |
Zack Williams | 08b07fb | 2018-04-03 14:52:14 -0700 | [diff] [blame] | 37 | - name: POSTGRES_DB |
Zack Williams | 3432b94 | 2018-04-24 17:46:41 -0700 | [diff] [blame] | 38 | value: {{ .Values.xosDBName | quote }} |
Zack Williams | 08b07fb | 2018-04-03 14:52:14 -0700 | [diff] [blame] | 39 | - name: POSTGRES_USER |
Zack Williams | 3432b94 | 2018-04-24 17:46:41 -0700 | [diff] [blame] | 40 | value: {{ .Values.xosDBUser | quote }} |
Zack Williams | 08b07fb | 2018-04-03 14:52:14 -0700 | [diff] [blame] | 41 | - name: POSTGRES_PASSWORD |
| 42 | valueFrom: |
| 43 | secretKeyRef: |
Zack Williams | 3432b94 | 2018-04-24 17:46:41 -0700 | [diff] [blame] | 44 | name: xos-db-secrets |
| 45 | key: password |
Scott Baker | 318975c | 2018-07-13 16:37:49 -0700 | [diff] [blame] | 46 | - name: PGDATA |
| 47 | value: "/var/lib/postgresql/data/pgdata" |
Zack Williams | 9a6b91e | 2018-07-28 19:57:01 -0700 | [diff] [blame] | 48 | {{- if .Values.needDBPersistence }} |
Gopinath Taget | 9d61cb8 | 2018-06-22 17:03:43 -0700 | [diff] [blame] | 49 | volumeMounts: |
| 50 | - name: db-pv-storage |
| 51 | mountPath: "/var/lib/postgresql/data" |
| 52 | volumes: |
| 53 | - name: db-pv-storage |
| 54 | persistentVolumeClaim: |
Zack Williams | 9a6b91e | 2018-07-28 19:57:01 -0700 | [diff] [blame] | 55 | claimName: {{ .Values.pvClaimName }} |
| 56 | {{- include "xos-db.persistent-volume-claim" . }} |
| 57 | {{- end }} |