blob: 4f0bee6d6c38672072810a74e8c0296d4991bd2f [file] [log] [blame]
Zack Williams3432b942018-04-24 17:46:41 -07001---
Gopinath Tagetb6a79b12018-03-08 17:27:37 -08002# 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 Taget9b609e02018-03-07 16:02:50 -080016apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
19 name: xos-db
20 labels:
Andy Bavier3e262f22018-03-22 12:24:41 -070021 app: xos-db
Gopinath Taget9b609e02018-03-07 16:02:50 -080022spec:
23 replicas: 1
24 template:
25 metadata:
26 labels:
Andy Bavier3e262f22018-03-22 12:24:41 -070027 app: xos-db
Gopinath Taget9b609e02018-03-07 16:02:50 -080028 spec:
29 containers:
Andy Bavier3e262f22018-03-22 12:24:41 -070030 - name: xos-db
Zack Williams17a0c8a2018-10-11 15:11:21 -070031 image: {{ .Values.global.registry }}{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}
Zack Williamsd9d6b352018-10-05 07:53:30 -070032 imagePullPolicy: {{ .Values.image.pullPolicy }}
Gopinath Taget9b609e02018-03-07 16:02:50 -080033 ports:
Andy Bavier3e262f22018-03-22 12:24:41 -070034 - containerPort: 5432
Gopinath Taget9b609e02018-03-07 16:02:50 -080035 protocol: TCP
36 env:
Zack Williams08b07fb2018-04-03 14:52:14 -070037 - name: POSTGRES_DB
Zack Williams3432b942018-04-24 17:46:41 -070038 value: {{ .Values.xosDBName | quote }}
Zack Williams08b07fb2018-04-03 14:52:14 -070039 - name: POSTGRES_USER
Zack Williams3432b942018-04-24 17:46:41 -070040 value: {{ .Values.xosDBUser | quote }}
Zack Williams08b07fb2018-04-03 14:52:14 -070041 - name: POSTGRES_PASSWORD
42 valueFrom:
43 secretKeyRef:
Zack Williams3432b942018-04-24 17:46:41 -070044 name: xos-db-secrets
45 key: password
Scott Baker318975c2018-07-13 16:37:49 -070046 - name: PGDATA
47 value: "/var/lib/postgresql/data/pgdata"
Gopinath Taget9d61cb82018-06-22 17:03:43 -070048 volumeMounts:
Matteo Scandolo5a0101b2019-01-23 15:24:34 -080049 - name: xos-db-config
50 mountPath: /usr/local/share/postgresql/postgresql.conf.sample
51 subPath: config/postgresql.conf.sample
52{{- if .Values.needDBPersistence }}
Gopinath Taget9d61cb82018-06-22 17:03:43 -070053 - name: db-pv-storage
54 mountPath: "/var/lib/postgresql/data"
Matteo Scandolo5a0101b2019-01-23 15:24:34 -080055{{- end }}
Gopinath Taget9d61cb82018-06-22 17:03:43 -070056 volumes:
Matteo Scandolo5a0101b2019-01-23 15:24:34 -080057 - name: xos-db-config
58 configMap:
59 name: xos-db
60 items:
61 - key: config
62 path: config/postgresql.conf.sample
63{{- if .Values.needDBPersistence }}
Gopinath Taget9d61cb82018-06-22 17:03:43 -070064 - name: db-pv-storage
65 persistentVolumeClaim:
Zack Williams9a6b91e2018-07-28 19:57:01 -070066 claimName: {{ .Values.pvClaimName }}
67{{- include "xos-db.persistent-volume-claim" . }}
68{{- end }}