-
Notifications
You must be signed in to change notification settings - Fork 118
CSPL-3354: REBASED Add Lifecycle Hooks and Configurable Termination Grace Period to Splunk Operator #1450
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
Open
patrykw-splunk
wants to merge
19
commits into
develop
Choose a base branch
from
CSPL-3354-rebased
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
27ee68e
to
c21215c
Compare
Pull Request Test Coverage Report for Build 13568057412Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 14198533480Details
💛 - Coveralls |
fca32c0
to
3c32089
Compare
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.
what happened to old PR , also we need description in the PR,
rlieberman-splunk
approved these changes
Mar 24, 2025
Signed-off-by: Vivek Reddy <vivekrsplunk@github.com>
e71a71f
to
5653ba3
Compare
This reverts commit 5653ba3.
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.
Overview
This Pull Request introduces enhancements to the Splunk Operator by integrating Lifecycle Hooks and allowing customers to configure the Termination Grace Period via the Custom Resource (
Common Spec
). These changes aim to ensure graceful shutdowns of Splunk pods, thereby maintaining data integrity and improving the reliability of Splunk deployments on Kubernetes.Problem Statement
Customers running Splunk on Kubernetes have reported issues related to abrupt pod terminations, especially during node recycling or maintenance operations. Without proper shutdown procedures, Splunk instances may not decommission gracefully, leading to potential data loss and increased operational churn. Additionally, the lack of configurable grace periods limits customers' ability to tailor shutdown behaviors to their specific environments and requirements.
Proposed Solution
Integrate Lifecycle Hooks:
preStop
Hook: Executessplunk offline
andsplunk stop
commands before the pod is terminated. This ensures that Splunk instances decommission gracefully, preventing data corruption and loss.Configurable Termination Grace Period:
Common Spec
of the Splunk Operator’s Custom Resource to allow customers to specifyterminationGracePeriodSeconds
.Changes Made
Custom Resource Definition:
terminationGracePeriodSeconds
under thecommonSpec
section to allow customization.StatefulSet Template Update:
lifecycle
section with thepreStop
hook.terminationGracePeriodSeconds
value from theCommon Spec
.Benefits
Related Issues
Testing Performed
Unit Tests:
terminationGracePeriodSeconds
from the Custom Resource is correctly applied to the StatefulSet.preStop
lifecycle hook executes the appropriate Splunk commands.Integration Tests:
splunk offline
andsplunk stop
commands were executed before termination.terminationGracePeriodSeconds
values to ensure flexibility and correctness.Manual Testing:
Documentation Updates
Operator README:
terminationGracePeriodSeconds
field in the Custom Resource.Configuration Guides:
terminationGracePeriodSeconds
based on different deployment scenarios.How to Test
Update Custom Resource:
terminationGracePeriodSeconds
in your Splunk Operator Custom Resource.Deploy or Update Splunk Cluster:
Verify StatefulSet Configuration:
preStop
lifecycle hook and the correctterminationGracePeriodSeconds
.Simulate Pod Termination:
preStop
hook.Future Considerations
splunk decommission
if it provides more comprehensive shutdown procedures compared tosplunk offline
andsplunk stop
.terminationGracePeriodSeconds
without requiring full cluster redeployments.Reviewer Notes
terminationGracePeriodSeconds
field continue to operate with the default grace period.Pull Request Checklist: