7572d7f4446125017af839d73ca8a67d0282c6de
[oom.git] / kubernetes / common / postgres-legacy / charts / pgpool / templates / deployment.yaml
1 {{/*
2 # Copyright © 2018 Amdocs, AT&T, Bell Canada
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 */}}
16 kind: Deployment
17 apiVersion: extensions/v1beta1
18 metadata:
19   name: {{ include "common.fullname" . }}
20   namespace: {{ include "common.namespace" . }}
21   labels:
22     app: {{ include "common.name" . }}
23     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24     release: {{ include "common.release" . }}
25     heritage: {{ .Release.Service }}
26 spec:
27   replicas: 2
28   template:
29     metadata:
30       labels:
31         app: {{ include "common.name" . }}
32         release: {{ include "common.release" . }}
33     spec:
34       containers:
35       - image: "{{.Values.repository}}/{{.Values.image}}"
36         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
37         name: {{ include "common.name" . }}
38         env:
39         - name: PG_PRIMARY_SERVICE_NAME
40           value: {{.Values.container.name.primary}}
41         - name: PG_REPLICA_SERVICE_NAME
42           value: {{.Values.container.name.replica}}
43         - name: PG_USERNAME
44           value: {{.Values.credentials.pgusername}}
45         - name: PG_PASSWORD
46           value: {{.Values.credentials.pgpassword}}
47         ports:
48         - containerPort: 5432
49           name: pgpool
50           protocol: TCP
51         readinessProbe:
52           tcpSocket:
53             port: 5432
54           initialDelaySeconds: 20
55           periodSeconds: 10
56         livenessProbe:
57           tcpSocket:
58             port: 5432
59         initialDelaySeconds: 15
60         periodSeconds: 20
61         volumeMounts:
62         - name: pgpool-pgconf
63           mountPath: /pgconf/pgpoolconfigdir
64           readOnly: false
65       volumes:
66       - name: pgpool-pgconf
67         configMap:
68           name: {{ include "common.fullname" . }}-pgpool-configmap