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

Conversation

amitsagtani97
Copy link
Contributor

@amitsagtani97 amitsagtani97 commented Jan 24, 2023

Ticket - https://wearezeta.atlassian.net/browse/SQPIT-574

This the wrapper chart for bitnami/postgresql that can be used in different bots and related services.
An example use case - #2935

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@amitsagtani97 amitsagtani97 temporarily deployed to cachix January 24, 2023 09:39 — with GitHub Actions Inactive
@amitsagtani97 amitsagtani97 temporarily deployed to cachix January 24, 2023 09:39 — with GitHub Actions Inactive
Copy link
Member

@jschaul jschaul left a comment

Choose a reason for hiding this comment

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

This should not be called -external. Since postgres from this chart runs inside kubernetes.

(The cassandra-external chart forwards traffic to cassandra deployed outside kubernetes on bare VMs. This is different.)

I'm not sure why we need a hand-rolled postgres helm chart here. There are many postgres charts maintained by the community, for example from bitnami, here: https://github.com/bitnami/charts/tree/main/bitnami/postgresql

Let's use their existing chart instead of needing to maintain a helm chart on software we do not develop.

If you need to re-host this helm chart as part of wire-server (why though?), you could require a third-party helm chart using a requirements.yaml file. But I don't see the benefit really, just use the third-party postgres chart wherever you wish to make use of it.

Your PR does not link to any issue / jira ticket so unfortunately I don't see the added value from this PR, if there might be a usecase I can't easily imagine, please provide more context.

@amitsagtani97
Copy link
Contributor Author

This should not be called -external. Since postgres from this chart runs inside kubernetes.

(The cassandra-external chart forwards traffic to cassandra deployed outside kubernetes on bare VMs. This is different.)

I'm not sure why we need a hand-rolled postgres helm chart here. There are many postgres charts maintained by the community, for example from bitnami, here: https://github.com/bitnami/charts/tree/main/bitnami/postgresql

Let's use their existing chart instead of needing to maintain a helm chart on software we do not develop.

If you need to re-host this helm chart as part of wire-server (why though?), you could require a third-party helm chart using a requirements.yaml file. But I don't see the benefit really, just use the third-party postgres chart wherever you wish to make use of it.

Your PR does not link to any issue / jira ticket so unfortunately I don't see the added value from this PR, if there might be a usecase I can't easily imagine, please provide more context.

I was little worried if the latest postgresql versions will work with the existing bots, and in the Bitnami chart I tried to replace the image and tags to use older postgresql version, but that didn't worked.
But, the latest versions of Postgresql(at least 14) works with bots, so removing this custom chart and replacing with Bitnami one as you suggested.

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Feb 14, 2023
Comment on lines 10 to 14
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).

Comment on lines 4 to 9
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

@@ -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 👍

@amitsagtani97 amitsagtani97 changed the title Postgres-external chart to use in different bots and related services bitnami/postgresql wrapper to use in different bots and related services Feb 20, 2023
Copy link
Member

@jschaul jschaul left a comment

Choose a reason for hiding this comment

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

Looks good now! (I added one small commit to add the chart to the list of charts to be released, this list is hardcoded inside the Makefile currently)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants