blob: 8fa7056c1881741851a0df232eaa5eae30836d0d [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
Matteo Scandolo5628d4b2021-01-11 11:46:12 -080016apiVersion: apps/v1
Gopinath Taget9b609e02018-03-07 16:02:50 -080017kind: 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
Matteo Scandolo5628d4b2021-01-11 11:46:12 -080024 selector:
25 matchLabels:
26 name: xos-db
27 release: {{ .Release.Name }}
Gopinath Taget9b609e02018-03-07 16:02:50 -080028 template:
29 metadata:
30 labels:
Andy Bavier3e262f22018-03-22 12:24:41 -070031 app: xos-db
Gopinath Taget9b609e02018-03-07 16:02:50 -080032 spec:
33 containers:
Andy Bavier3e262f22018-03-22 12:24:41 -070034 - name: xos-db
Zack Williams17a0c8a2018-10-11 15:11:21 -070035 image: {{ .Values.global.registry }}{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}
Zack Williamsd9d6b352018-10-05 07:53:30 -070036 imagePullPolicy: {{ .Values.image.pullPolicy }}
Gopinath Taget9b609e02018-03-07 16:02:50 -080037 ports:
Andy Bavier3e262f22018-03-22 12:24:41 -070038 - containerPort: 5432
Gopinath Taget9b609e02018-03-07 16:02:50 -080039 protocol: TCP
40 env:
Zack Williams08b07fb2018-04-03 14:52:14 -070041 - name: POSTGRES_DB
Zack Williams3432b942018-04-24 17:46:41 -070042 value: {{ .Values.xosDBName | quote }}
Zack Williams08b07fb2018-04-03 14:52:14 -070043 - name: POSTGRES_USER
Zack Williams3432b942018-04-24 17:46:41 -070044 value: {{ .Values.xosDBUser | quote }}
Zack Williams08b07fb2018-04-03 14:52:14 -070045 - name: POSTGRES_PASSWORD
46 valueFrom:
47 secretKeyRef:
Zack Williams3432b942018-04-24 17:46:41 -070048 name: xos-db-secrets
49 key: password
Scott Baker318975c2018-07-13 16:37:49 -070050 - name: PGDATA
51 value: "/var/lib/postgresql/data/pgdata"
Gopinath Taget9d61cb82018-06-22 17:03:43 -070052 volumeMounts:
Matteo Scandolo5a0101b2019-01-23 15:24:34 -080053 - name: xos-db-config
54 mountPath: /usr/local/share/postgresql/postgresql.conf.sample
55 subPath: config/postgresql.conf.sample
56{{- if .Values.needDBPersistence }}
Gopinath Taget9d61cb82018-06-22 17:03:43 -070057 - name: db-pv-storage
58 mountPath: "/var/lib/postgresql/data"
Matteo Scandolo5a0101b2019-01-23 15:24:34 -080059{{- end }}
Gopinath Taget9d61cb82018-06-22 17:03:43 -070060 volumes:
Matteo Scandolo5a0101b2019-01-23 15:24:34 -080061 - name: xos-db-config
62 configMap:
63 name: xos-db
64 items:
65 - key: config
66 path: config/postgresql.conf.sample
67{{- if .Values.needDBPersistence }}
Gopinath Taget9d61cb82018-06-22 17:03:43 -070068 - name: db-pv-storage
69 persistentVolumeClaim:
Zack Williams9a6b91e2018-07-28 19:57:01 -070070 claimName: {{ .Values.pvClaimName }}
71{{- include "xos-db.persistent-volume-claim" . }}
72{{- end }}