Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitnami/postgresql wrapper to use in different bots and related services #3012

Merged
merged 7 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions charts/postgresql-external/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions charts/postgresql-external/templates/postgres-configmap.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions charts/postgresql-external/templates/postgres-service.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions charts/postgresql-external/templates/postgres-statefulset.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions charts/postgresql-external/templates/postgres-storage.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions charts/postgresql-external/values.yaml

This file was deleted.

File renamed without changes.
44 changes: 44 additions & 0 deletions charts/postgresql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
This is the PostgreSQL Bitnami chart.

Configure the values.yaml file to create the database, username, password and other configuration.
List of parameters available - https://artifacthub.io/packages/helm/bitnami/postgresql#parameters

For persisting data, you can configure your choice of storageClass with your provisioner.

Or, create a storage class and of PVs based on no. of replicas with no provisioner -
```
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Retain
allowVolumeExpansion: true

---

Prepare volume on host and give right permissions -
mkdir -p /data/local-storage
chmod -R 775 /data/local-storage

---
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: local-storage
hostPath:
path: /data/local-storage
```

To deploy the helm chart -
```
helm install postgresql charts/postgresql --values charts/postgresql/values.yaml
```
4 changes: 4 additions & 0 deletions charts/postgresql/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies:
- name: postgresql
version: 11.9.8
repository: https://charts.bitnami.com/bitnami
14 changes: 14 additions & 0 deletions charts/postgresql/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
architecture: replication
global:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the values inside values.yaml currently have no effect. If you wish to override the defaults provided inside the upstream values.yaml, here: https://github.com/bitnami/charts/blob/main/bitnami/postgresql/values.yaml, then you need to indent them under a top-level postgresql: section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 👍

storageClass: local-storage
auth:
replicationPassword: externalPostgresql
postgresPassword: externalPostgresql
username: externalPostgresql
password: externalPostgresql
database: externalPostgresql
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh. Can you remove the whole auth block? There should never be any default passwords in plaintext. The user of a helm chart should specify their own passwords. Same for database name and username. Please remove the whole auth block here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

readReplicas:
name: read
replicaCount: 2
replication:
numSynchronousReplicas: 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need more than one replica in your use case (bots)? Would it not be sufficient to have one single replica (and no read replicas)?

Perhaps the first line architecture: replication could be changed to architecture: standalone (already the default). If not, please motivate why you need higher availability here at this level, and what this chart is used for (and also where it is used).