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

View File

@@ -24,7 +24,7 @@ sources:
- https://github.com/prometheus/mysqld_exporter
- https://mariadb.org
type: application
version: 1.0.0
version: 1.0.1
annotations:
truecharts.org/catagories: |
- database

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"

View File

@@ -40,10 +40,9 @@ podSecurityContext:
runAsGroup: 0
volumeClaimTemplates:
db:
data:
enabled: true
mountPath: "/bitnami/mariadb"
accessMode: ReadWriteOnce
# -- Probe configuration
# -- [[ref]](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)

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

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"

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"

View File

@@ -22,7 +22,7 @@ sources:
- https://github.com/bitnami/bitnami-docker-redis
- http://redis.io/
type: application
version: 1.0.2
version: 1.0.3
annotations:
truecharts.org/catagories: |
- database

View File

@@ -59,9 +59,6 @@ volumeClaimTemplates:
data:
enabled: true
mountPath: "/bitnami/redis"
accessMode: ReadWriteOnce
type: pvc
size: "100Gi"
# -- Probe configuration
# -- [[ref]](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)

View File

@@ -3,7 +3,7 @@ appVersion: "1.5.0"
dependencies:
- name: common
repository: https://truecharts.org
version: 8.5.7
version: 8.6.1
deprecated: false
description: Community developed LDAP software
home: https://www.openldap.org
@@ -23,7 +23,7 @@ sources:
- https://github.com/jp-gouin/helm-openldap
- https://github.com/osixia/docker-openldap
type: application
version: 4.0.12
version: 4.0.13
annotations:
truecharts.org/catagories: |
- cloud

View File

@@ -95,10 +95,6 @@ volumeClaimTemplates:
data:
enabled: true
mountPath: "/var/lib/ldap/"
accessMode: ReadWriteOnce
size: "100Gi"
slapd:
enabled: true
mountPath: "/etc/ldap/slapd.d/"
accessMode: ReadWriteOnce
size: "100Gi"