mirror of https://github.com/requarks/wiki
Replace Bitnami PostgreSQL dependency with custom PostgreSQL StatefulSet implementation Add new PostgreSQL templates: statefulset, service, and PVC Update values.yaml to include PostgreSQL image configuration with official postgres:17.4 image Implement custom PostgreSQL deployment using official Docker Hub image instead of Bitnami chart Add PostgreSQL resource, nodeSelector, tolerations, and affinity configuration options Update helper templates to support new PostgreSQL implementation Update deployment template to connect to the new PostgreSQL implementation Update README.md to document the new PostgreSQL configuration parameters BREAKING CHANGE: This replaces the Bitnami PostgreSQL dependency with a custom PostgreSQL implementation using the official PostgreSQL image from Docker Hub, changing how PostgreSQL is deployed and configured. Signed-off-by: Ilya Gilev jazer23569@gmail.compull/7831/head
parent
dd48f28827
commit
a7dc23a1a8
@ -1,6 +0,0 @@
|
||||
dependencies:
|
||||
- name: postgresql
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 8.10.14
|
||||
digest: sha256:db7c1e0bc9ec0ed45520521bd76bb390d04711fd0f04affaadafa1dc498ce68b
|
||||
generated: "2020-07-21T20:34:41.41180748-04:00"
|
||||
Binary file not shown.
@ -0,0 +1,21 @@
|
||||
{{- if and .Values.postgresql.enabled .Values.postgresql.persistence.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "wiki.postgresql.fullname" . }}
|
||||
labels:
|
||||
{{- include "wiki.labels" . | nindent 4 }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.postgresql.persistence.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.postgresql.persistence.size | quote }}
|
||||
{{- if .Values.postgresql.persistence.storageClass }}
|
||||
{{- if (eq "-" .Values.postgresql.persistence.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: {{ .Values.postgresql.persistence.storageClass | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@ -0,0 +1,13 @@
|
||||
{{- if and .Values.postgresql.enabled (not .Values.postgresql.existingSecret) -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "wiki.postgresql.fullname" . }}
|
||||
labels:
|
||||
{{- include "wiki.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
postgresql-password: {{ .Values.postgresql.postgresqlPassword | b64enc | quote }}
|
||||
postgresql-username: {{ .Values.postgresql.postgresqlUser | b64enc | quote }}
|
||||
postgresql-database: {{ .Values.postgresql.postgresqlDatabase | b64enc | quote }}
|
||||
{{- end }}
|
||||
@ -0,0 +1,21 @@
|
||||
{{- if .Values.postgresql.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "wiki.postgresql.fullname" . }}
|
||||
labels:
|
||||
{{- include "wiki.labels" . | nindent 4 }}
|
||||
{{- with .Values.postgresql.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.postgresql.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.postgresql.service.port }}
|
||||
targetPort: 5432
|
||||
protocol: TCP
|
||||
name: postgresql
|
||||
selector:
|
||||
{{- include "wiki.postgresql.selectorLabels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
@ -0,0 +1,90 @@
|
||||
{{- if .Values.postgresql.enabled -}}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "wiki.postgresql.fullname" . }}
|
||||
labels:
|
||||
{{- include "wiki.labels" . | nindent 4 }}
|
||||
spec:
|
||||
serviceName: {{ include "wiki.postgresql.fullname" . }}
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "wiki.postgresql.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "wiki.postgresql.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.postgresql.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.postgresql.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.postgresql.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: postgresql
|
||||
image: {{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}
|
||||
imagePullPolicy: {{ .Values.postgresql.image.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
name: postgresql
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "wiki.postgresql.fullname" . }}
|
||||
key: postgresql-database
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "wiki.postgresql.fullname" . }}
|
||||
key: postgresql-username
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "wiki.postgresql.fullname" . }}
|
||||
key: postgresql-password
|
||||
- name: PGDATA
|
||||
value: /var/lib/postgresql/data/pgdata
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- exec pg_isready -U {{ .Values.postgresql.postgresqlUser }} -d {{ .Values.postgresql.postgresqlDatabase }}
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- exec pg_isready -U {{ .Values.postgresql.postgresqlUser }} -d {{ .Values.postgresql.postgresqlDatabase }}
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 6
|
||||
resources:
|
||||
{{- toYaml .Values.postgresql.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: postgresql-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
subPath: postgresql
|
||||
volumes:
|
||||
- name: postgresql-data
|
||||
{{- if .Values.postgresql.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "wiki.postgresql.fullname" . }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Loading…
Reference in new issue