-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat(infra): enable HA and increase retention for postgresql #1955
Conversation
📝 WalkthroughWalkthroughThis pull request introduces new configuration options for PostgreSQL deployments, specifically high availability and backup retention settings. Two parameters, Changes
Suggested reviewers
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
Documentation and Community
|
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)
.azure/modules/postgreSql/create.bicep (2)
55-57
: Introduce High Availability Parameter for Module FlexibilityThe new parameter
enableHighAvailability
has been added to the module with an appropriate description, which facilitates conditional HA configuration.
Optional Improvement: Consider providing a default value (for example,false
) if you want to make the parameter optional in scenarios where HA is not desired by default.
92-96
: Conditional HA Configuration LogicThe variable
highAvailabilityConfig
is defined conditionally based on theenableHighAvailability
flag. This configuration uses a static setting with:
mode
set to'ZoneRedundant'
standbyAvailabilityZone
set to'2'
Optional Improvement: To make the module more flexible across different regions or setups, consider making
standbyAvailabilityZone
configurable through a separate parameter.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.azure/infrastructure/main.bicep
(2 hunks).azure/infrastructure/prod.bicepparam
(1 hunks).azure/infrastructure/staging.bicepparam
(1 hunks).azure/infrastructure/test.bicepparam
(1 hunks).azure/infrastructure/yt01.bicepparam
(1 hunks).azure/modules/postgreSql/create.bicep
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Dry run deploy infrastructure / Deploy to test
🔇 Additional comments (7)
.azure/infrastructure/test.bicepparam (1)
39-39
: High availability configuration looks good for test environment.Setting
highAvailability: false
for the test environment is appropriate to reduce costs while still maintaining the same parameter structure across environments..azure/infrastructure/yt01.bicepparam (1)
41-41
: High availability configuration looks good for yt01 environment.Setting
highAvailability: false
for the yt01 environment is consistent with the approach for other non-production environments, helping to minimize resource costs where high availability isn't critical..azure/infrastructure/prod.bicepparam (1)
39-39
: High availability enabled for production - perfect!Setting
highAvailability: true
for the production environment aligns perfectly with the PR objective to enable HA for PostgreSQL in production. This critical setting will enhance reliability and minimize potential downtime..azure/infrastructure/staging.bicepparam (1)
39-39
: High availability enabled for staging - looks good!Setting
highAvailability: true
for the staging environment is appropriate as it aligns with the PR objective and follows best practices. Having the same HA configuration in staging as in production allows for proper testing of HA behavior before changes reach production..azure/infrastructure/main.bicep (2)
60-66
: High Availability Parameter Addition in postgresConfigurationThe addition of the
enableHighAvailability
boolean within thepostgresConfiguration
parameter object is clear and directly supports the PR objective for enabling HA on PostgreSQL. Please ensure that all environment-specific parameter files set this flag appropriately.
217-220
: Correct Passing of the HA Parameter to the PostgreSQL ModuleThe module instantiation for PostgreSQL correctly passes the
enableHighAvailability
parameter (i.e.enableHighAvailability: postgresConfiguration.enableHighAvailability
). This ensures that the high availability configuration will be correctly applied during deployment..azure/modules/postgreSql/create.bicep (1)
117-118
: Integration of High Availability Settings in PostgreSQL ResourceThe PostgreSQL resource correctly integrates the high availability settings by assigning
highAvailability: highAvailabilityConfig
. This ensures that if high availability is enabled, the server is provisioned with the appropriate configuration.
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 (1)
.azure/infrastructure/main.bicep (1)
65-66
: Add Descriptive Annotations for New PostgreSQL Configuration Parameters
The addition ofenableHighAvailability: bool
andbackupRetentionDays: int
to thepostgresConfiguration
object meets the PR objectives. For clarity and maintainability, consider adding@description
annotations for these new parameters so future readers can immediately understand their purpose and impact.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.azure/infrastructure/main.bicep
(2 hunks).azure/infrastructure/prod.bicepparam
(1 hunks).azure/infrastructure/staging.bicepparam
(1 hunks).azure/infrastructure/test.bicepparam
(1 hunks).azure/infrastructure/yt01.bicepparam
(1 hunks).azure/modules/postgreSql/create.bicep
(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- .azure/infrastructure/test.bicepparam
- .azure/infrastructure/staging.bicepparam
- .azure/infrastructure/yt01.bicepparam
- .azure/infrastructure/prod.bicepparam
- .azure/modules/postgreSql/create.bicep
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Dry run deploy infrastructure / Deploy to test
🔇 Additional comments (1)
.azure/infrastructure/main.bicep (1)
219-220
: Ensure Consistent Handling of New Parameters in PostgreSQL Module
The new parameters are correctly passed to thepostgresql
module asenableHighAvailability: postgresConfiguration.enableHighAvailability
andbackupRetentionDays: postgresConfiguration.backupRetentionDays
. Please verify that the downstream module (../modules/postgreSql/create.bicep
) is updated to properly handle these parameters.
🤖 I have created a release *beep* *boop* --- ## [1.56.0](v1.55.5...v1.56.0) (2025-02-26) ### Features * **infra:** enable HA and increase retention for postgresql ([#1955](#1955)) ([84a3fc6](84a3fc6)) ### Miscellaneous Chores * **e2e:** put filter on createdAfter for search in cleanup-step e2e-tests ([#1970](#1970)) ([f9d2099](f9d2099)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
Enables High Availability for Staging and Production instances using availability zones: https://learn.microsoft.com/en-us/azure/reliability/reliability-postgresql-flexible-server?toc=%2Fazure%2Fpostgresql%2Ftoc.json&bc=%2Fazure%2Fpostgresql%2Fbreadcrumb%2Ftoc.json#availability-zone-support
Add retention to 32 days in production, using the default 7 days for other environments.
Related Issue(s)
Verification
Documentation
docs
-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)