-
Notifications
You must be signed in to change notification settings - Fork 4
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
Improv(DB): Add yaml for postgres DBs #125
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request introduces comprehensive configuration changes for PostgreSQL deployments in Kubernetes environments. Two separate Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
molecules/cluster-resources/config/externals/postgresql--idp/values.yaml (1)
1172-1172
: Fix indentation in backup storage configuration.The
accessModes
field under backup storage has incorrect indentation.## @param backup.cronjob.storage.accessModes PV Access Mode ## accessModes: - - ReadWriteOnce + - ReadWriteOnce🧰 Tools
🪛 yamllint (1.35.1)
[warning] 1172-1172: wrong indentation: expected 8 but found 7
(indentation)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
molecules/cluster-resources/config/externals/postgresql--idp/values.yaml
(1 hunks)molecules/cluster-resources/config/externals/postgresql/values.yaml
(1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
molecules/cluster-resources/config/externals/postgresql--idp/values.yaml
[error] 157-157: duplication of key "existingSecret" in mapping
(key-duplicates)
[warning] 1172-1172: wrong indentation: expected 8 but found 7
(indentation)
[error] 1614-1614: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (1)
molecules/cluster-resources/config/externals/postgresql/values.yaml (1)
100-101
: Verify Bitnami PostgreSQL image compatibility.The switch to Bitnami's PostgreSQL image (
bitnami/postgresql:16.6.0-debian-12-r2
) is a good choice for better maintenance and security. However, we should verify compatibility with existing data and configurations.✅ Verification successful
Bitnami PostgreSQL image is compatible and properly configured
The verification confirms that:
- The Bitnami PostgreSQL image (16.6.0-debian-12-r2) is recent and officially maintained
- The configuration is consistent across both PostgreSQL instances
- CloudNativePG operator ensures proper PostgreSQL management and handles upgrades safely
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if the specified Bitnami PostgreSQL image exists and get its details curl -s "https://hub.docker.com/v2/repositories/bitnami/postgresql/tags/16.6.0-debian-12-r2" | jq -r '.last_updated' # Check for any known vulnerabilities in this image version docker run --rm -it aquasec/trivy image bitnami/postgresql:16.6.0-debian-12-r2Length of output: 320
Script:
#!/bin/bash # Find current PostgreSQL configuration and version echo "Current PostgreSQL configuration:" rg -A 5 "repository: .*postgresql" --glob "*.yaml" echo -e "\nMigration related files:" fd -i migrate -t f echo -e "\nPostgreSQL related configuration files:" fd -e yaml -e yml | rg -i "postgres|pg"Length of output: 1923
Script:
#!/bin/bash # Check git history for previous PostgreSQL version echo "Previous PostgreSQL version:" git log -p -- molecules/cluster-resources/config/externals/postgresql/values.yaml | rg -B2 "repository:|tag:" | head -n 10 echo -e "\nCNPG Operator configuration:" cat molecules/cluster-resources/config/cnpg-operator-values.yamlLength of output: 22171
replicationPassword: "" | ||
## @param auth.existingSecret Name of existing secret to use for PostgreSQL credentials. `auth.postgresPassword`, `auth.password`, and `auth.replicationPassword` will be ignored and picked up from this secret. The secret might also contains the key `ldap-password` if LDAP is enabled. `ldap.bind_password` will be ignored and picked from this secret in this case. | ||
## | ||
existingSecret: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix duplicate existingSecret
key in configuration.
The existingSecret
key appears twice in the configuration, which could lead to confusion and potential issues.
Remove one of the duplicate entries and ensure all secret-related configuration is consolidated in one place.
Also applies to: 138-138
🧰 Tools
🪛 yamllint (1.35.1)
[error] 157-157: duplication of key "existingSecret" in mapping
(key-duplicates)
pullSecrets: [] | ||
## Set to true if you would like to see extra information on logs | ||
## | ||
debug: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security Risk: Debug mode enabled in production.
Debug mode is enabled which could expose sensitive information in logs.
## Set to true if you would like to see extra information on logs
##
- debug: true
+ debug: false
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
debug: true | |
debug: false |
postgresPassword: "aDpz0PlLCd1" | ||
username: "app" | ||
password: "x2aHwyqzgz1" | ||
database: "app" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security Risk: Credentials in plain text.
The configuration contains hardcoded credentials in plain text. This is a security risk and violates best practices.
Consider using Kubernetes Secrets or a secure secret management solution. Apply this change:
auth:
enablePostgresUser: true
- postgresPassword: "aDpz0PlLCd1"
- username: "app"
- password: "x2aHwyqzgz1"
- database: "app"
+ existingSecret: "postgresql-idp-credentials"
+ secretKeys:
+ adminPasswordKey: postgres-password
+ userPasswordKey: user-password
Committable suggestion skipped: line range outside the PR's diff.
Summary by CodeRabbit