blob: 82f1507d8fc41ee61de29929a5961bcc81a215bd [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 Williams3432b942018-04-24 17:46:41 -070031 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
Gopinath Taget9d61cb82018-06-22 17:03:43 -070046 {{- if .Values.needDBPersistence }}
47 volumeMounts:
48 - name: db-pv-storage
49 mountPath: "/var/lib/postgresql/data"
50 volumes:
51 - name: db-pv-storage
52 persistentVolumeClaim:
53 claimName: {{ .Values.dbPvClaimName }}
54 {{- end }}