feat(postgresql): move postgresql to use statefullset and cleanup (#1335)

* feat(postgresql): move postgresql to use statefullset by default

* some more misc tweaks

* whoops

* dahhh

* dont use a data distinction for postgresql

* remove unused crap

* bumps

* oops
This commit is contained in:
Kjeld Schouten-Lebbing
2021-11-15 20:50:10 +01:00
committed by GitHub
parent ffcfdcffd0
commit 8db9184061
10 changed files with 65 additions and 36 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ name: postgresql
sources:
- https://www.postgresql.org/
type: application
version: 5.1.18
version: 5.2.0
annotations:
truecharts.org/catagories: |
- database
+5 -11
View File
@@ -34,7 +34,7 @@ questions:
label: "(Advanced) Controller Type"
schema:
type: string
default: "deployment"
default: "statefulset"
required: true
enum:
- value: "deployment"
@@ -55,7 +55,7 @@ questions:
label: "(Advanced) Update Strategy"
schema:
type: string
default: "Recreate"
default: "RollingUpdate"
required: true
enum:
- value: "Recreate"
@@ -178,15 +178,15 @@ questions:
# Include{serviceList}
- variable: persistence
- variable: volumeClaimTemplates
label: "Integrated Persistent Storage"
description: "Integrated Persistent Storage"
group: "Storage and Persistence"
schema:
type: dict
attrs:
- variable: db
label: "Old db Storage"
- variable: data
label: "DB Storage"
description: "Stores the old Application Database."
schema:
type: dict
@@ -207,14 +207,8 @@ questions:
enum:
- value: "simplePVC"
description: "PVC (simple)"
- value: "simpleHP"
description: "HostPath (simple)"
- value: "emptyDir"
description: "emptyDir"
- value: "pvc"
description: "pvc"
- value: "hostPath"
description: "hostPath"
# Include{persistenceBasic}
- variable: hostPath
label: "hostPath"
+49
View File
@@ -3,6 +3,50 @@ image:
pullPolicy: IfNotPresent
tag: 14.1.0@sha256:480fa9cd68d9013ea622b8a6dc71505bc8f0eaeac6d062cb5182bff44d0fcdbb
controller:
# -- Set the controller type.
# Valid options are deployment, daemonset or statefulset
type: statefulset
# -- Number of desired pods
replicas: 1
# -- Set the controller upgrade strategy
# For Deployments, valid values are Recreate (default) and RollingUpdate.
# For StatefulSets, valid values are OnDelete and RollingUpdate (default).
# DaemonSets ignore this.
strategy: RollingUpdate
rollingUpdate:
# -- Set deployment RollingUpdate max unavailable
unavailable: 1
# -- Set deployment RollingUpdate max surge
surge:
# -- Set statefulset RollingUpdate partition
partition:
# -- ReplicaSet revision history limit
revisionHistoryLimit: 3
initContainers:
migrate-db:
image: "{{ .Values.alpineImage.repository}}:{{ .Values.alpineImage.tag }}"
securityContext:
runAsUser: 0
privileged: true
runAsNonRoot: false
command:
- /bin/sh
- -cx
- |
echo 'trying to migrate old db to new location...'
mkdir -p /bitnami/postgresql/data
mv -f /bitnami/postgresql/old/* /bitnami/postgresql/ || true
chown -R {{ .Values.podSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }} /bitnami/postgresql/
chmod 775 /bitnami/postgresql/
imagePullPolicy: IfNotPresent
volumeMounts:
- name: db
mountPath: /bitnami/postgresql/old
- name: data
mountPath: /bitnami/postgresql
securityContext:
readOnlyRootFilesystem: false
@@ -22,6 +66,11 @@ podSecurityContext:
persistence:
db:
enabled: true
mountPath: "/bitnami/postgresql/old"
volumeClaimTemplates:
data:
enabled: true
mountPath: "/bitnami/postgresql"