summaryrefslogtreecommitdiffstats
path: root/kubernetes/common/postgres/templates
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/common/postgres/templates')
-rw-r--r--kubernetes/common/postgres/templates/configmap.yaml2
-rw-r--r--kubernetes/common/postgres/templates/deployment-primary.yaml4
-rw-r--r--kubernetes/common/postgres/templates/deployment-replica.yaml4
-rw-r--r--kubernetes/common/postgres/templates/pv-primary.yaml6
-rw-r--r--kubernetes/common/postgres/templates/pv-replica.yaml6
-rw-r--r--kubernetes/common/postgres/templates/pvc-primary.yaml7
-rw-r--r--kubernetes/common/postgres/templates/pvc-replica.yaml6
-rw-r--r--kubernetes/common/postgres/templates/secrets.yaml2
-rw-r--r--kubernetes/common/postgres/templates/service-common.yaml4
-rw-r--r--kubernetes/common/postgres/templates/service-primary.yaml4
-rw-r--r--kubernetes/common/postgres/templates/service-replica.yaml4
11 files changed, 31 insertions, 18 deletions
diff --git a/kubernetes/common/postgres/templates/configmap.yaml b/kubernetes/common/postgres/templates/configmap.yaml
index 7abd39b9b9..26ba390040 100644
--- a/kubernetes/common/postgres/templates/configmap.yaml
+++ b/kubernetes/common/postgres/templates/configmap.yaml
@@ -20,7 +20,7 @@ metadata:
labels:
app: {{ include "common.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
data:
{{ tpl (.Files.Glob "configs/*").AsConfig . | indent 2 }}
diff --git a/kubernetes/common/postgres/templates/deployment-primary.yaml b/kubernetes/common/postgres/templates/deployment-primary.yaml
index 9cb3007400..b234dc2092 100644
--- a/kubernetes/common/postgres/templates/deployment-primary.yaml
+++ b/kubernetes/common/postgres/templates/deployment-primary.yaml
@@ -21,7 +21,7 @@ metadata:
labels:
app: {{ include "common.name" . }}-primary
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
name: "{{ .Values.container.name.primary }}"
spec:
@@ -31,7 +31,7 @@ spec:
metadata:
labels:
app: {{ include "common.name" . }}-primary
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
name: "{{ .Values.container.name.primary }}"
spec:
initContainers:
diff --git a/kubernetes/common/postgres/templates/deployment-replica.yaml b/kubernetes/common/postgres/templates/deployment-replica.yaml
index 8f09a2f48f..72a8736e17 100644
--- a/kubernetes/common/postgres/templates/deployment-replica.yaml
+++ b/kubernetes/common/postgres/templates/deployment-replica.yaml
@@ -21,7 +21,7 @@ metadata:
labels:
app: {{ include "common.name" . }}-replica
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
name: "{{ .Values.container.name.replica }}"
spec:
@@ -31,7 +31,7 @@ spec:
metadata:
labels:
app: {{ include "common.name" . }}-replica
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
name: "{{ .Values.container.name.replica }}"
spec:
initContainers:
diff --git a/kubernetes/common/postgres/templates/pv-primary.yaml b/kubernetes/common/postgres/templates/pv-primary.yaml
index 096f0c9d2b..e1ff1f9f4e 100644
--- a/kubernetes/common/postgres/templates/pv-primary.yaml
+++ b/kubernetes/common/postgres/templates/pv-primary.yaml
@@ -14,6 +14,7 @@
# # limitations under the License.
*/}}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if include "common.needPV" . -}}
kind: PersistentVolume
apiVersion: v1
metadata:
@@ -22,7 +23,7 @@ metadata:
labels:
app: {{ include "common.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
- release: "{{ .Release.Name }}"
+ release: "{{ include "common.release" . }}"
heritage: "{{ .Release.Service }}"
name: {{ include "common.fullname" . }}
spec:
@@ -33,5 +34,6 @@ spec:
storageClassName: "{{ include "common.fullname" . }}-primary"
persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
hostPath:
- path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/primary
+ path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ include "common.release" . }}/{{ .Values.persistence.mountSubPath }}/primary
+{{- end -}}
{{- end -}}
diff --git a/kubernetes/common/postgres/templates/pv-replica.yaml b/kubernetes/common/postgres/templates/pv-replica.yaml
index a98abefba0..d553c36680 100644
--- a/kubernetes/common/postgres/templates/pv-replica.yaml
+++ b/kubernetes/common/postgres/templates/pv-replica.yaml
@@ -14,6 +14,7 @@
# # limitations under the License.
*/}}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if include "common.needPV" . -}}
kind: PersistentVolume
apiVersion: v1
metadata:
@@ -22,7 +23,7 @@ metadata:
labels:
app: {{ include "common.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
- release: "{{ .Release.Name }}"
+ release: "{{ include "common.release" . }}"
heritage: "{{ .Release.Service }}"
name: {{ include "common.fullname" . }}
spec:
@@ -33,5 +34,6 @@ spec:
storageClassName: "{{ include "common.fullname" . }}-replica"
persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
hostPath:
- path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/replica
+ path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ include "common.release" . }}/{{ .Values.persistence.mountSubPath }}/replica
+{{- end -}}
{{- end -}}
diff --git a/kubernetes/common/postgres/templates/pvc-primary.yaml b/kubernetes/common/postgres/templates/pvc-primary.yaml
index 05a5088966..fa25f19077 100644
--- a/kubernetes/common/postgres/templates/pvc-primary.yaml
+++ b/kubernetes/common/postgres/templates/pvc-primary.yaml
@@ -23,7 +23,7 @@ metadata:
labels:
app: {{ include "common.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
- release: "{{ .Release.Name }}"
+ release: "{{ include "common.release" . }}"
heritage: "{{ .Release.Service }}"
name: {{ include "common.fullname" . }}
{{- if .Values.persistence.annotations }}
@@ -36,5 +36,10 @@ spec:
resources:
requests:
storage: {{ .Values.persistence.size }}
+{{- if include "common.needPV" . }}
+ storageClassName: "{{ include "common.fullname" . }}-primary"
+{{- else }}
+ storageClassName: {{ include "common.storageClass" . }}
+{{- end }}
storageClassName: "{{ include "common.fullname" . }}-primary"
{{- end -}}
diff --git a/kubernetes/common/postgres/templates/pvc-replica.yaml b/kubernetes/common/postgres/templates/pvc-replica.yaml
index f740521919..1e453fbcfd 100644
--- a/kubernetes/common/postgres/templates/pvc-replica.yaml
+++ b/kubernetes/common/postgres/templates/pvc-replica.yaml
@@ -23,7 +23,7 @@ metadata:
labels:
app: {{ include "common.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
- release: "{{ .Release.Name }}"
+ release: "{{ include "common.release" . }}"
heritage: "{{ .Release.Service }}"
name: {{ include "common.fullname" . }}
{{- if .Values.persistence.annotations }}
@@ -36,5 +36,9 @@ spec:
resources:
requests:
storage: {{ .Values.persistence.size }}
+{{- if include "common.needPV" . }}
storageClassName: "{{ include "common.fullname" . }}-replica"
+{{- else }}
+ storageClassName: {{ include "common.storageClass" . }}
+{{- end }}
{{- end -}}
diff --git a/kubernetes/common/postgres/templates/secrets.yaml b/kubernetes/common/postgres/templates/secrets.yaml
index 29de3af260..db1bc5bb15 100644
--- a/kubernetes/common/postgres/templates/secrets.yaml
+++ b/kubernetes/common/postgres/templates/secrets.yaml
@@ -21,7 +21,7 @@ metadata:
labels:
app: {{ include "common.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
type: Opaque
data:
diff --git a/kubernetes/common/postgres/templates/service-common.yaml b/kubernetes/common/postgres/templates/service-common.yaml
index da0505cfa6..6e74a06616 100644
--- a/kubernetes/common/postgres/templates/service-common.yaml
+++ b/kubernetes/common/postgres/templates/service-common.yaml
@@ -21,7 +21,7 @@ metadata:
labels:
app: {{ include "common.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
annotations:
spec:
@@ -38,4 +38,4 @@ spec:
{{- end}}
selector:
app: {{ include "common.name" . }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
diff --git a/kubernetes/common/postgres/templates/service-primary.yaml b/kubernetes/common/postgres/templates/service-primary.yaml
index 501c01ecfe..2965b7df81 100644
--- a/kubernetes/common/postgres/templates/service-primary.yaml
+++ b/kubernetes/common/postgres/templates/service-primary.yaml
@@ -21,7 +21,7 @@ metadata:
labels:
app: {{ include "common.name" . }}-primary
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
annotations:
spec:
@@ -38,4 +38,4 @@ spec:
{{- end}}
selector:
name: "{{.Values.container.name.primary}}"
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
diff --git a/kubernetes/common/postgres/templates/service-replica.yaml b/kubernetes/common/postgres/templates/service-replica.yaml
index 34f76d125e..d92a0833af 100644
--- a/kubernetes/common/postgres/templates/service-replica.yaml
+++ b/kubernetes/common/postgres/templates/service-replica.yaml
@@ -21,7 +21,7 @@ metadata:
labels:
app: {{ include "common.name" . }}-replica
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
annotations:
spec:
@@ -38,4 +38,4 @@ spec:
{{- end}}
selector:
name: "{{.Values.container.name.replica}}"
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}