NEXUS-50170: Fix StatefulSet updateStrategy to always use RollingUpdate#152
Open
SraavanChevireddy wants to merge 1 commit into
Open
NEXUS-50170: Fix StatefulSet updateStrategy to always use RollingUpdate#152SraavanChevireddy wants to merge 1 commit into
SraavanChevireddy wants to merge 1 commit into
Conversation
Problem: The Nexus HA Helm chart was conditionally setting the StatefulSet updateStrategy to "OnDelete" when zeroDowntimeEnabled was false (default). This prevented customers from performing standard Kubernetes rolling updates and administrative activities, as reported by Hyundai. Root Cause: Lines 23-26 in statefulset.yaml contained conditional logic that set updateStrategy.type to "OnDelete" when zeroDowntimeEnabled was false. When zeroDowntimeEnabled was true, the updateStrategy block was omitted entirely (defaulting to RollingUpdate). Fix: - Removed the conditional logic checking zeroDowntimeEnabled - Changed updateStrategy to always use "RollingUpdate" type - Updated tests to expect RollingUpdate in all scenarios Impact: - Customers can now perform normal Kubernetes rolling updates without enabling Zero Downtime Upgrade workaround - StatefulSet pods will be automatically updated in rolling fashion when Helm chart is upgraded - Zero Downtime Upgrade functionality remains unaffected as it operates at the application level via NEXUS_ZERO_DOWNTIME_ENABLED env var Testing: - Updated test "should set zdu env to true and rollingUpgrades when zeroDowntimeEnabled is true" to expect RollingUpdate - Updated test "should create nxrm-app container with dynamic nexusdata volume" to expect RollingUpdate instead of OnDelete JIRA: https://sonatype.atlassian.net/browse/NEXUS-50170 Co-Authored-By: Claude <noreply@anthropic.com>
bobotimi
requested changes
Jan 29, 2026
Contributor
bobotimi
left a comment
There was a problem hiding this comment.
This was done on purpose. Rolling upgrades should not be attempted unless ZDU is enabled to prevent database corruption.
It was intentionally done this way as we don't want rolling upgrades unless Zero downtime flag is enabled. Doing so will mean you can have two different versions of nexus (i.e., current version and new version being upgraded to) connected to the same postgres instance without the checks we have in place for the zero downtime feature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Statement
The Nexus HA Helm chart was conditionally setting the StatefulSet
updateStrategytoOnDeletewhenzeroDowntimeEnabledwas false (which is the default configuration). This prevented customers from performing standard Kubernetes rolling updates and administrative activities.Customer Impact: Hyundai reported that this affects their Kubernetes administration activities, as they cannot perform normal pod updates without manually deleting pods.
Root Cause Analysis
The issue was in
nxrm-ha/templates/statefulset.yamllines 23-26:Before:
This conditional logic meant:
zeroDowntimeEnabled: false(default) →updateStrategy.type: OnDeletezeroDowntimeEnabled: true→ No updateStrategy block (defaults to RollingUpdate)The
OnDeletestrategy requires manual intervention to delete pods before they are updated, which is not standard Kubernetes behavior.Solution Details
Changed the StatefulSet template to always use
RollingUpdatestrategy:After:
This ensures that Kubernetes will automatically perform rolling updates of StatefulSet pods when the Helm chart is upgraded, regardless of the Zero Downtime Upgrade setting.
Testing Verification
Template Changes
nxrm-ha/templates/statefulset.yamlupdateStrategy.type: RollingUpdateTest Updates
Updated two tests in
nxrm-ha/tests/statefulset_test.yaml:Test: "should set zdu env to true and rollingUpgrades when zeroDowntimeEnabled is true"
spec.updateStrategyto be nullspec.updateStrategy.type: RollingUpdateTest: "should create nxrm-app container with dynamic nexusdata volume"
spec.updateStrategy.type: OnDeletespec.updateStrategy.type: RollingUpdateExpected Behavior
With this fix, the rendered StatefulSet YAML will always include:
This applies to both scenarios:
zeroDowntimeEnabled: false(default)zeroDowntimeEnabled: trueImpact on Customers
Positive Impact:
Zero Downtime Upgrade (ZDU) Functionality:
NEXUS_ZERO_DOWNTIME_ENABLEDenvironment variableRelated Links
Generated with Claude Code