-
Notifications
You must be signed in to change notification settings - Fork 573
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
Operator: add support for downscaling #5019
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2711976
operator: split readyReplicas from replicas and add currentReplicas
nicolaferraro 8b3559d
operator: add decommissioningNode status field
nicolaferraro 0131182
operator: change webhook to allow decommissioning
nicolaferraro d6dac46
operator: move types to their own package to avoid dependency loop
nicolaferraro e9ecea7
rpk: add enum for membership status
nicolaferraro f8a7bcd
operator: allow scoping internal admin API to specific nodes
nicolaferraro 1913822
operator: remove stack trace from logs when delay is requested
nicolaferraro 33c1034
operator: enable decommission API functions in internal admin API
nicolaferraro 4d74d4f
operator: add scale handler to properly decommission and recommission…
nicolaferraro 5d62c76
operator: implement progressive initialization to let node 0 create i…
nicolaferraro d48e957
operator: consider draining field when checking maintenance mode status
nicolaferraro 2b02d34
operator: add controller tests for scaling
nicolaferraro 3b7b77e
operator: add kuttl test for decommission
nicolaferraro e9bba61
operator: disable maintenance mode hook on node 0 when starting up a …
nicolaferraro 90812c1
operator: add documentation to the scale handler
nicolaferraro a9efa0a
operator: fix maintenance mode activation on decommissioning node (wo…
nicolaferraro b1e3fac
operator: make decommission wait interval configurable and add jitter
nicolaferraro 5bd42df
operator: mark downscaling as alpha feature and add a startup flag
nicolaferraro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
# Set the --allow-downscaling=true parameter in the controller manager | ||
- command: kubectl patch deployment redpanda-controller-manager -n redpanda-system --type='json' -p='[{"op":"add", "path":"/spec/template/spec/containers/1/args/-", "value":"--allow-downscaling=true"}]' | ||
- command: kubectl get deployment redpanda-controller-manager -n redpanda-system -o json |
This file contains 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
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
job-name: wait-for-2-brokers | ||
status: | ||
containerStatuses: | ||
- name: curl | ||
state: | ||
terminated: | ||
message: | | ||
2 | ||
phase: Succeeded | ||
--- | ||
|
||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
collectors: | ||
- type: pod | ||
selector: app.kubernetes.io/name=redpanda | ||
tail: -1 | ||
- type: pod | ||
namespace: redpanda-system | ||
selector: control-plane=controller-manager | ||
tail: -1 | ||
- type: command | ||
command: kubectl get clusters -o jsonpath={@} -n $NAMESPACE | ||
- type: command | ||
command: kubectl get pods -o jsonpath={@} -n $NAMESPACE |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
src/go/k8s/tests/e2e/decommission/05-restore-downscaling.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
# Downscaling will be set to the default value | ||
- command: kubectl patch deployment redpanda-controller-manager -n redpanda-system --type='json' -p='[{"op":"remove", "path":"/spec/template/spec/containers/1/args/4"}]' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- command: kubectl rollout status deployment redpanda-controller-manager -n redpanda-system | ||
- command: hack/wait-for-webhook-ready.sh | ||
|
||
--- | ||
|
||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
collectors: | ||
- type: pod | ||
selector: app.kubernetes.io/name=redpanda | ||
tail: -1 | ||
- type: pod | ||
namespace: redpanda-system | ||
selector: control-plane=controller-manager | ||
tail: -1 | ||
- type: command | ||
command: kubectl get clusters -o jsonpath={@} -n $NAMESPACE | ||
- type: command | ||
command: kubectl get pods -o jsonpath={@} -n $NAMESPACE |
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.
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.
It would be good to describe in commit message or in this comment what consequences might happen if someone will downscale the cluster while Kafka clients are still connect.
cc @jcsp @mmaslankaprv