blob: a3d3e9162cdc2e21056628062b51c2abb411f876 [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
Matteo Scandolo0faaffd2018-10-04 18:45:00 +000031 image: {{ .Values.postgresImage | quote }}
32 imagePullPolicy: {{ .Values.imagePullPolicy }}
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"
Zack Williams9a6b91e2018-07-28 19:57:01 -070048{{- if .Values.needDBPersistence }}
Gopinath Taget9d61cb82018-06-22 17:03:43 -070049 volumeMounts:
50 - name: db-pv-storage
51 mountPath: "/var/lib/postgresql/data"
52 volumes:
53 - name: db-pv-storage
54 persistentVolumeClaim:
Zack Williams9a6b91e2018-07-28 19:57:01 -070055 claimName: {{ .Values.pvClaimName }}
56{{- include "xos-db.persistent-volume-claim" . }}
57{{- end }}