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

Deploy postgres db using kubernetes secret for configuration. #84

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

chambridge
Copy link
Contributor

  • Update CRD to consume a secret for the db configuration
  • Update playbook for default settings configuration
  • Update postgres role to check for secret or create one based on the CR
  • Postgres will be deployed specific to CR
  • Pulp deployments updated to reference the db secret as a volume mount

closes #8289
https://pulp.plan.io/issues/8289

@pulpbot
Copy link
Member

pulpbot commented Mar 4, 2021

Attached issue: https://pulp.plan.io/issues/8289

@chambridge
Copy link
Contributor Author

Here you can see the created secret:
image

Here you can see the deployed postgres based on the custom resource name:
image

Here you can see the settings.py secret that is mounted instead of a configMap:
image

All items are up and running as expected:
image

@chambridge chambridge marked this pull request as ready for review March 4, 2021 00:54
Comment on lines -12 to -15
database_connection:
username: pulp
password: pulp
admin_password: pulp
Copy link
Member

Choose a reason for hiding this comment

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

sweet!

Comment on lines +47 to +48
postgres_configuration_secret:
description: Secret where the database configuration can be found
Copy link
Member

Choose a reason for hiding this comment

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

👍🏽

deployment_type: pulp

#postgres_image: postgres:12
postgres_image: docker.io/centos/postgresql-96-centos7:9.6
Copy link
Member

Choose a reason for hiding this comment

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

postgres 9.6 uses md5, we are upgrading it to 10 on pulp_installer so we can use scram-sha-256.
Could you please make postgres 10 the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I believe so

Copy link
Member

Choose a reason for hiding this comment

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

@mikedep333 can you confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made this postgres:12 to align with awx-operator

I also set vars to use scram-sha-256:

postgres_initdb_args: '--auth-host=scram-sha-256'
postgres_host_auth_method: 'scram-sha-256'

Copy link
Contributor Author

@chambridge chambridge Mar 4, 2021

Choose a reason for hiding this comment

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

Is it just about having the ability to use scram-sha-256 (so I shouldn't set it) or should this be the default?

I can expose the option via the CRD as necessary.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking about the ability, but I like it as default

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I agree with us setting it as the default.

Copy link
Member

@fao89 fao89 left a comment

Choose a reason for hiding this comment

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

Thank you!
I'm approving but I think @mikedep333 needs to review it

Comment on lines 89 to 90
- ReadWriteMany
- ReadWriteOnce
Copy link
Member

Choose a reason for hiding this comment

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

I actually prefer your indentation style, but the default yamllint rules (spaces, indent-sequences) are for the the 2 spaces in the beginning. So that is what we have been using.

# password: pulp
# Password for db admin user 'postgres'.
# admin_password:
# PostrgreSQL container settings
Copy link
Member

Choose a reason for hiding this comment

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

typo

deployment_type: pulp

#postgres_image: postgres:12
postgres_image: docker.io/centos/postgresql-96-centos7:9.6
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I agree with us setting it as the default.

Copy link
Member

@mikedep333 mikedep333 left a comment

Choose a reason for hiding this comment

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

Thank you!

My 2 comments are trivial, I am not requiring you to fix a typo and an indent to merge.

* Update CRD to consume a secret for the db configuration
* Update playbook for default settings configuration
* Update postgres role to check for secret or create one based on the CR
* Postgres will be deployed specific to CR
* Pulp deployments updated to reference the db secret as a volume mount

closes #8289
https://pulp.plan.io/issues/8289
@chambridge chambridge merged commit 40af134 into pulp:main Mar 4, 2021
@chambridge chambridge deleted the 8289-use-db-secret branch March 4, 2021 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants