-
Notifications
You must be signed in to change notification settings - Fork 476
Add docs for decommissioning nodes with the operator #20520
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
jhlodin
wants to merge
3
commits into
main
Choose a base branch
from
jl/doc-15029
base: main
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.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -104,3 +104,52 @@ Do not scale down to fewer than 3 nodes. This is considered an anti-pattern on C | |||||
~~~ shell | ||||||
kubectl get pods | ||||||
~~~ | ||||||
|
||||||
## Decommission nodes | ||||||
|
||||||
When a Kubernetes node is scheduled for removal or maintenance, the {{ site.data.products.cockroachdb-operator }} can be instructed to decommission the CockroachDB nodes scheduled on this Kubernetes node. Decommissioning safely moves data and workloads away before the node goes offline. | ||||||
|
||||||
{{site.data.alerts.callout_info}} | ||||||
Once annotated, the Kubernetes node is cordoned so no further pods are scheduled on the node. The annotation is not a mark for future removal, as CockroachDB is decommissioned on the node immediately. | ||||||
|
||||||
If cluster capacity is limited, replacement pods may remain in the `Pending` state until new nodes are available. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we modify this to be more generic as
Suggested change
|
||||||
{{site.data.alerts.end}} | ||||||
|
||||||
The following prerequisites are necessary for the {{ site.data.products.cockroachdb-operator }} to be able to decommission a CockroachDB node: | ||||||
|
||||||
- The `--enable-k8s-node-/controller=true` flag must be enabled in the operator's `.yaml` values file, for example: | ||||||
{% include_cached copy-clipboard.html %} | ||||||
~~~ yaml | ||||||
containers: | ||||||
- name: cockroach-operator | ||||||
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }} | ||||||
args: | ||||||
- "-enable-k8s-node-controller=true" | ||||||
~~~ | ||||||
- At least one replica of the operator must not be on the target node. | ||||||
- There must be no under-replicated ranges on the CockroachDB cluster. | ||||||
|
||||||
To mark a node for decommissioning, follow these steps: | ||||||
|
||||||
1. Identify the name of the Kubernetes node that is to be removed. | ||||||
|
||||||
1. Annotate the Kubernetes node with `crdb.cockroachlabs.com/decommission="true"`. The decommissioning process begins immediately after this annotation is applied. Using `kubectl`, for example: | ||||||
|
||||||
{% include_cached copy-clipboard.html %} | ||||||
~~~ shell | ||||||
kubectl annotate node {example-node-name} crdb.cockroachlabs.com/decommission="true" | ||||||
~~~ | ||||||
|
||||||
1. Monitor the cluster: | ||||||
- Confirm the decommissioned node's cordoned status: | ||||||
jhlodin marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
{% include_cached copy-clipboard.html %} | ||||||
~~~ shell | ||||||
kubectl describe node {example-node-name} | ||||||
~~~ | ||||||
- Monitor operator events and logs for decommission start and completion messages: | ||||||
{% include_cached copy-clipboard.html %} | ||||||
~~~ shell | ||||||
kubectl logs pod {operator-pod-name} | ||||||
~~~ | ||||||
|
||||||
If the replacement pods remain in a `Pending` state, this typically means there is not enough available capacity in the cluster for these pods to be scheduled. |
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
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
Oops, something went wrong.
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.