2 # Copyright © 2018 Amdocs, AT&T, Bell Canada
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
8 # # http://www.apache.org/licenses/LICENSE-2.0
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.
16 apiVersion: apps/v1beta1
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24 release: {{ .Release.Name }}
25 heritage: {{ .Release.Service }}
27 serviceName: {{ .Values.service.name }}
28 replicas: {{ .Values.replicaCount }}
32 app: {{ include "common.name" . }}
33 release: {{ .Release.Name }}
40 for i in $(seq 0 $(({{ .Values.replicaCount }}-1))); do
41 if [ ! -d /podroot/data$i ]; then
42 mkdir -p /podroot/data$i;
43 chown 26:26 /podroot/data$i;
44 chmod 700 /podroot/data$i;
49 valueFrom: { fieldRef: { fieldPath: metadata.name } }
52 image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.busyboxImage }}
53 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56 - name: {{ include "common.fullname" . }}-init
59 - name: {{ include "common.name" . }}
60 image: "{{ .Values.postgresRepository }}/{{ .Values.image }}"
61 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63 - containerPort: {{ .Values.service.internalPort }}
65 # disable liveness probe when breakpoints set in debugger
66 # so K8s doesn't restart unresponsive container
67 {{- if eq .Values.liveness.enabled true }}
70 port: {{ .Values.service.internalPort }}
71 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
72 periodSeconds: {{ .Values.liveness.periodSeconds }}
73 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
77 port: {{ .Values.service.internalPort }}
78 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
79 periodSeconds: {{ .Values.readiness.periodSeconds }}
83 - name: PG_PRIMARY_USER
87 - name: PG_PRIMARY_HOST
88 value: "{{.Values.container.name.primary}}"
89 - name: PG_REPLICA_HOST
90 value: "{{.Values.container.name.replica}}"
91 - name: PG_PRIMARY_PORT
92 value: "{{.Values.service.internalPort}}"
93 - name: PG_PRIMARY_PASSWORD
96 name: {{ template "common.fullname" . }}
97 key: pg-primary-password
99 value: "{{.Values.config.pgUserName}}"
103 name: {{ template "common.fullname" . }}
104 key: pg-user-password
106 value: "{{.Values.config.pgDatabase}}"
107 - name: PG_ROOT_PASSWORD
110 name: {{ template "common.fullname" . }}
111 key: pg-root-password
114 name: {{ include "common.fullname" . }}-data
116 name: {{ include "common.fullname" . }}-backup
119 {{ include "common.resources" . | indent 12 }}
120 {{- if .Values.nodeSelector }}
122 {{ toYaml .Values.nodeSelector | indent 10 }}
124 {{- if .Values.affinity }}
126 {{ toYaml .Values.affinity | indent 10 }}
132 - name: {{ include "common.fullname" . }}-init
134 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountInitPath }}
135 - name: {{ include "common.fullname" . }}-backup
137 #{{ if not .Values.persistence.enabled }}
138 - name: {{ include "common.fullname" . }}-data
141 volumeClaimTemplates:
143 name: {{ include "common.fullname" . }}-data
145 name: {{ include "common.fullname" . }}
147 accessModes: [ {{ .Values.persistence.accessMode }} ]
148 storageClassName: {{ include "common.fullname" . }}-data
151 storage: {{ .Values.persistence.size }}