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 mkdir -p /podroot/data$i; done
44 valueFrom: { fieldRef: { fieldPath: metadata.name } }
47 image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.busyboxImage }}
48 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
51 - name: {{ include "common.fullname" . }}-init
54 - name: {{ include "common.name" . }}
55 image: "{{ .Values.postgresRepository }}/{{ .Values.image }}"
56 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
58 - containerPort: {{ .Values.service.internalPort }}
60 # disable liveness probe when breakpoints set in debugger
61 # so K8s doesn't restart unresponsive container
62 {{- if eq .Values.liveness.enabled true }}
65 port: {{ .Values.service.internalPort }}
66 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
67 periodSeconds: {{ .Values.liveness.periodSeconds }}
68 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
72 port: {{ .Values.service.internalPort }}
73 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
74 periodSeconds: {{ .Values.readiness.periodSeconds }}
78 - name: PG_PRIMARY_USER
82 - name: PG_PRIMARY_HOST
83 value: "{{.Values.container.name.primary}}"
84 - name: PG_REPLICA_HOST
85 value: "{{.Values.container.name.replica}}"
86 - name: PG_PRIMARY_PORT
87 value: "{{.Values.service.internalPort}}"
88 - name: PG_PRIMARY_PASSWORD
91 name: {{ template "common.fullname" . }}
92 key: pg-primary-password
94 value: "{{.Values.config.pgUserName}}"
98 name: {{ template "common.fullname" . }}
101 value: "{{.Values.config.pgDatabase}}"
102 - name: PG_ROOT_PASSWORD
105 name: {{ template "common.fullname" . }}
106 key: pg-root-password
109 name: {{ include "common.fullname" . }}-data
111 name: {{ include "common.fullname" . }}-backup
114 {{ toYaml .Values.resources | indent 12 }}
115 {{- if .Values.nodeSelector }}
117 {{ toYaml .Values.nodeSelector | indent 10 }}
119 {{- if .Values.affinity }}
121 {{ toYaml .Values.affinity | indent 10 }}
127 - name: {{ include "common.fullname" . }}-init
129 path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Namespace }}/{{ .Values.persistence.mountInitPath }}
130 - name: {{ include "common.fullname" . }}-backup
132 #{{ if not .Values.persistence.enabled }}
133 - name: {{ include "common.fullname" . }}-data
136 volumeClaimTemplates:
138 name: {{ include "common.fullname" . }}-data
140 name: {{ include "common.fullname" . }}
142 accessModes: [ {{ .Values.persistence.accessMode }} ]
143 storageClassName: {{ include "common.fullname" . }}-data
146 storage: {{ .Values.persistence.size }}