mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
[stable/postgresql] Add read-only connection to the replica slaves (#10186)
Signed-off-by: Javier J. Salmeron Garcia <jsalmeron@bitnami.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
f6eacf9ef1
commit
15535e4a9e
@@ -1,5 +1,5 @@
|
||||
name: postgresql
|
||||
version: 3.5.0
|
||||
version: 3.6.0
|
||||
appVersion: 10.6.0
|
||||
description: Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance.
|
||||
keywords:
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
|
||||
PostgreSQL can be accessed via port 5432 on the following DNS name from within your cluster:
|
||||
|
||||
{{ template "postgresql.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
|
||||
|
||||
{{ template "postgresql.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local - Read/Write connection
|
||||
{{- if .Values.replication.enabled }}
|
||||
{{ template "postgresql.fullname" . }}-read.{{ .Release.Namespace }}.svc.cluster.local - Read only connection
|
||||
{{- end }}
|
||||
To get the password for "{{ .Values.postgresqlUsername }}" run:
|
||||
|
||||
export POSTGRESQL_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ if .Values.existingSecret }}{{ .Values.existingSecret }}{{ else }}{{ template "postgresql.fullname" . }}{{ end }} -o jsonpath="{.data.postgresql-password}" | base64 --decode)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
{{- if .Values.replication.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "postgresql.fullname" . }}-read
|
||||
labels:
|
||||
app: {{ template "postgresql.name" . }}
|
||||
chart: {{ template "postgresql.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
{{- with .Values.service.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if and .Values.service.loadBalancerIP (eq .Values.service.type "LoadBalancer") }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: postgresql
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: postgresql
|
||||
{{- if .Values.service.nodePort }}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "postgresql.name" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
role: slave
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user