-
Notifications
You must be signed in to change notification settings - Fork 136
Update CNPG postgres-operator v1.25.0 #575
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
Conversation
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
WalkthroughThis pull request introduces significant updates to the CloudNativePG Operator Helm Chart, enhancing its configuration and deployment flexibility. The changes include version upgrades from Changes
Possibly related PRs
Suggested labels
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: 0
🧹 Nitpick comments (2)
packages/system/postgres-operator/charts/cloudnative-pg/templates/NOTES.txt (1)
20-20: Consider adding a note about the scope of the command.The command now lists clusters across all namespaces, which is appropriate for the new cluster-wide capabilities. However, it might be helpful to add a comment explaining this behavior to users.
-kubectl get -A cluster +# List PostgreSQL clusters across all namespaces +kubectl get -A clusterpackages/system/postgres-operator/charts/cloudnative-pg/values.schema.json (1)
20-22: Add validation constraints for numeric fields.While the schema correctly defines the new properties, consider adding validation constraints for
maxConcurrentReconcilesto ensure reasonable values."maxConcurrentReconciles": { - "type": "integer" + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 10 },Also applies to: 29-31, 167-169, 218-223
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
packages/system/postgres-operator/charts/cloudnative-pg/Chart.yaml(2 hunks)packages/system/postgres-operator/charts/cloudnative-pg/README.md(4 hunks)packages/system/postgres-operator/charts/cloudnative-pg/templates/NOTES.txt(1 hunks)packages/system/postgres-operator/charts/cloudnative-pg/templates/_helpers.tpl(2 hunks)packages/system/postgres-operator/charts/cloudnative-pg/templates/config.yaml(2 hunks)packages/system/postgres-operator/charts/cloudnative-pg/templates/deployment.yaml(4 hunks)packages/system/postgres-operator/charts/cloudnative-pg/templates/monitoring-configmap.yaml(1 hunks)packages/system/postgres-operator/charts/cloudnative-pg/templates/podmonitor.yaml(1 hunks)packages/system/postgres-operator/charts/cloudnative-pg/templates/rbac.yaml(5 hunks)packages/system/postgres-operator/charts/cloudnative-pg/templates/service.yaml(2 hunks)packages/system/postgres-operator/charts/cloudnative-pg/values.schema.json(3 hunks)packages/system/postgres-operator/charts/cloudnative-pg/values.yaml(3 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
packages/system/postgres-operator/charts/cloudnative-pg/README.md
35-35: null
Bare URL used
(MD034, no-bare-urls)
🪛 LanguageTool
packages/system/postgres-operator/charts/cloudnative-pg/README.md
[style] ~72-~72: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ...should be applied to ClusterIP as well. Can be IPv4 and/or IPv6. | | service.ipFami...
(MISSING_IT_THERE)
🪛 yamllint (1.35.1)
packages/system/postgres-operator/charts/cloudnative-pg/templates/podmonitor.yaml
[error] 16-16: syntax error: expected the node content, but found '-'
(syntax)
🔇 Additional comments (18)
packages/system/postgres-operator/charts/cloudnative-pg/templates/NOTES.txt (1)
11-13: LGTM! Well-structured conditional namespace specification.The conditional block correctly implements namespace specification based on the clusterWide configuration, which aligns with the operator's new cluster-wide capabilities.
packages/system/postgres-operator/charts/cloudnative-pg/templates/_helpers.tpl (3)
1-10: Namespace override helper function implemented correctlyThe new helper function
cloudnative-pg.namespacecorrectly allows overriding the release namespace, enhancing flexibility for multi-namespace deployments in combined charts.
74-271: Common RBAC rules are appropriately definedThe
cloudnative-pg.commonRulesfunction defines a comprehensive set of RBAC rules for namespace-scoped operations. The resources and verbs specified align well with the operator's requirements.
276-301: Cluster-wide RBAC rules are appropriately definedThe
cloudnative-pg.clusterwideRulesfunction specifies necessary cluster-wide permissions, including access to nodes and webhook configurations, which are essential for the operator's cluster-wide functionalities.packages/system/postgres-operator/charts/cloudnative-pg/Chart.yaml (1)
2-2: Verify the correctness of updatedappVersionand chartversionThe
appVersionhas been updated to1.25.0, and the chartversionto0.23.0. Please verify that these versions correspond to valid and stable releases of the CloudNativePG operator and Helm chart.Run the following script to confirm the availability of these versions:
Also applies to: 25-25
✅ Verification successful
✓ Version updates are correct and correspond to stable releases
Both the CloudNativePG operator version 1.25.0 and Helm chart version 0.23.0 are verified as valid, stable releases available in their respective official repositories.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check the availability of specified versions. # Confirm CloudNativePG operator release v1.25.0 exists curl -s https://api.github.com/repos/cloudnative-pg/cloudnative-pg/releases/tags/v1.25.0 | jq '.tag_name' # Confirm Helm chart version 0.23.0 exists on Artifact Hub curl -s https://artifacthub.io/api/v1/packages/helm/cloudnative-pg/cloudnative-pg | jq -r '.version' | grep '0\.23\.0'Length of output: 241
packages/system/postgres-operator/charts/cloudnative-pg/templates/monitoring-configmap.yaml (1)
21-21: Namespace inclusion in ConfigMap metadata is correctly implementedAdding
namespace: {{ include "cloudnative-pg.namespace" . }}ensures the ConfigMap is deployed in the correct namespace, especially whennamespaceOverrideis used.packages/system/postgres-operator/charts/cloudnative-pg/templates/service.yaml (1)
21-21: LGTM! Enhanced service configuration capabilities.The changes appropriately add namespace configuration and flexible IP family settings, improving the service's networking capabilities.
Also applies to: 30-35
packages/system/postgres-operator/charts/cloudnative-pg/templates/config.yaml (1)
22-22: LGTM! Verify the configuration merge behavior.The changes correctly implement conditional configuration based on cluster-wide deployment mode. The merge operation preserves existing configuration while adding namespace-specific settings when needed.
Also applies to: 30-36, 50-56
✅ Verification successful
✅ Configuration merge behavior verified and correct
The implementation correctly handles both cluster-wide and namespace-scoped configurations:
- Preserves existing configuration when merging WATCH_NAMESPACE
- Consistently applies namespace restrictions across config and deployment
- Properly documented in values.yaml with multi-namespace support
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify the configuration merge behavior # Check for any existing configurations that might conflict with the new merge logic rg -l 'WATCH_NAMESPACE' --type yamlLength of output: 752
Script:
#!/bin/bash # Check the specific implementation in relevant files echo "=== Config Implementation ===" rg "WATCH_NAMESPACE" packages/system/postgres-operator/charts/cloudnative-pg/templates/config.yaml -B 2 -A 2 echo -e "\n=== Deployment Implementation ===" rg "WATCH_NAMESPACE" packages/system/postgres-operator/charts/cloudnative-pg/templates/deployment.yaml -B 2 -A 2 echo -e "\n=== Values Configuration ===" cat packages/system/postgres-operator/charts/cloudnative-pg/values.yaml | grep -A 5 -B 5 "WATCH_NAMESPACE\|clusterWide"Length of output: 2143
packages/system/postgres-operator/charts/cloudnative-pg/templates/rbac.yaml (1)
22-22: LGTM! Enhanced RBAC configuration with proper scope separation.The changes correctly implement:
- Proper RBAC separation for cluster-wide vs namespace-scoped deployments
- Addition of new resources to view/edit roles
- Appropriate namespace-specific role bindings
Also applies to: 44-51, 71-112, 131-135, 157-161
✅ Verification successful
RBAC changes verified - proper implementation of namespace scoping and resource access
The changes correctly implement:
- Proper namespace scoping through template variables
- Separation of cluster-wide vs namespace-scoped permissions
- Least-privilege access for new resources (databases, publications, subscriptions)
- Correct RBAC aggregation for admin/edit/view roles
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify RBAC changes don't introduce over-privileged access # Check for any existing cluster roles that might conflict # Check for existing cluster roles rg -A 5 'kind:\s+ClusterRole' --type yaml # Check for references to the new resources rg -A 3 'databases|publications|subscriptions' --type yamlLength of output: 67099
Script:
#!/bin/bash # Examine RBAC rules in cloudnative-pg operator's rbac.yaml cat packages/system/postgres-operator/charts/cloudnative-pg/templates/rbac.yaml # Also check for any Role (namespace-scoped) definitions rg -A 5 'kind:\s+Role\s*$' --type yaml packages/system/postgres-operator/charts/cloudnative-pg/templates/rbac.yamlLength of output: 5210
packages/system/postgres-operator/charts/cloudnative-pg/templates/deployment.yaml (1)
21-21: LGTM! Enhanced deployment configuration with proper change detection.The changes add:
- Configuration checksums for proper pod updates
- Concurrent reconciliation control
- Proper namespace scoping
Also applies to: 36-38, 62-62, 85-88
✅ Verification successful
Configuration parameters are properly implemented and aligned with operator patterns
The max-concurrent-reconciles value of 10 and namespace-scoped watching are consistent with other operators in the system, following established patterns for Kubernetes operators.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify the impact of max-concurrent-reconciles parameter # Check for any existing reconciliation configurations # Check for existing reconciliation settings rg -A 3 'concurrent.*reconcile' --type yaml # Check for existing namespace configurations rg -A 3 'WATCH_NAMESPACE' --type yamlLength of output: 8561
packages/system/postgres-operator/charts/cloudnative-pg/README.md (3)
3-3: Version updates look good.The version updates align with the changes in Chart.yaml:
- Chart version: 0.22.0 → 0.23.0
- App version: 1.24.0 → 1.25.0
33-36: New configuration options enhance operator flexibility.The new configuration options provide better control over the operator's behavior:
config.clusterWide: Controls cluster-wide vs namespace-scoped operationconfig.maxConcurrentReconciles: Controls concurrent reconciliation limit🧰 Tools
🪛 Markdownlint (0.37.0)
35-35: null
Bare URL used(MD034, no-bare-urls)
72-73: Verify dual-stack configuration documentation.The documentation for dual-stack configuration should include examples of valid values for
ipFamiliesandipFamilyPolicy.Consider adding examples like:
| service.ipFamilyPolicy | string | `""` | Set the ip family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services) | +| | | | Example values: SingleStack, PreferDualStack, RequireDualStack | | service.ipFamilies | list | `[]` | Sets the families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6. | +| | | | Example values: ["IPv4"], ["IPv6"], ["IPv4", "IPv6"], ["IPv6", "IPv4"] |✅ Verification successful
Documentation examples would improve clarity and usability
The suggested examples are accurate and would be valuable additions to the documentation. The values match the Kubernetes implementation as verified in the CRDs, and currently, there are no examples in the documentation to guide users.
🏁 Scripts executed
The following scripts were executed for the analysis:
Error: No shell scripts found
Script:
#!/bin/bash # Search for documentation and configuration files echo "=== Searching for relevant documentation files ===" fd -e md -e yaml . packages/system/postgres-operator/charts/cloudnative-pg/ echo -e "\n=== Searching for ipFamilies and ipFamilyPolicy mentions ===" rg -i "ipfamil(y|ies)" packages/system/postgres-operator/charts/cloudnative-pg/ -A 2 -B 2 echo -e "\n=== Checking values.yaml for default configurations ===" cat packages/system/postgres-operator/charts/cloudnative-pg/values.yaml | grep -A 5 -B 5 "ipFamil"Length of output: 18417
🧰 Tools
🪛 LanguageTool
[style] ~72-~72: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ...should be applied to ClusterIP as well. Can be IPv4 and/or IPv6. | | service.ipFami...(MISSING_IT_THERE)
packages/system/postgres-operator/charts/cloudnative-pg/values.yaml (3)
31-31: LGTM: Namespace override option added.The
namespaceOverrideoption provides flexibility in deployment namespace configuration.
54-74: Operator configuration enhancements look good.The operator configuration section has been enhanced with:
- Clear documentation for cluster-wide operation
- Configurable concurrent reconciliation limit
- Well-structured comments explaining each option
136-139: Service networking configuration looks good.The service configuration has been enhanced with dual-stack support:
ipFamilyPolicyfor dual-stack configurationipFamiliesfor IP family order preferencepackages/system/postgres-operator/charts/cloudnative-pg/templates/podmonitor.yaml (2)
1-15: LGTM: Copyright notice added.The Apache 2.0 license header has been properly added to the file.
21-21: LGTM: Dynamic namespace configuration.The namespace is correctly set using the
cloudnative-pg.namespacetemplate function.
Signed-off-by: Andrei Kvapil kvapss@gmail.com
Summary by CodeRabbit
New Features
Version Updates
Configuration Improvements