-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Update etcd to 3.6 for Kubernetes 1.34 #12634
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
tmurakam
wants to merge
2
commits into
kubernetes-sigs:master
Choose a base branch
from
necposs:feature/kubernetes-1.34-etcd-3.6
base: master
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
2 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| --- | ||
| - name: Debug etcd_current_version | ||
| ansible.builtin.debug: | ||
| msg: "{{ etcd_current_version }}" | ||
| when: etcd_cluster_setup | ||
|
|
||
| # When upgrading from etcd 3.5 to 3.6, need to clean up v2 store before upgrading. | ||
| # Without this, etcd 3.6 will crash with following error: | ||
| # "panic: detected disallowed v2 WAL for stage --v2-deprecation=write-only [recovered]" | ||
| - name: Cleanup v2 store when upgrade etcd from <3.6 to >=3.6 | ||
| when: | ||
| - etcd_cluster_setup | ||
| - etcd_current_version != '' | ||
| - etcd_current_version is version('3.6.0', '<') | ||
| - etcd_version is version('3.6.0', '>=') | ||
| block: | ||
| - name: Ensure etcd version is >=3.5.24 | ||
| when: | ||
| - etcd_current_version is version('3.5.24', '<') | ||
| fail: | ||
| msg: "You need to upgrade etcd to 3.5.24 or later before upgrade to 3.6. Current version is {{ etcd_current_version }}." | ||
|
|
||
| # See: https://github.com/etcd-io/etcd/discussions/20231 | ||
| - name: Change etcd configuration temporally to limit number of WALs and snapshots to clean up v2 store | ||
| ansible.builtin.lineinfile: | ||
| path: /etc/etcd.env | ||
| regexp: "{{ item.regexp }}" | ||
| line: "{{ item.line }}" | ||
| loop: | ||
| - { regexp: '^ETCD_SNAPSHOT_COUNT=', line: 'ETCD_SNAPSHOT_COUNT=1' } | ||
| - { regexp: '^ETCD_MAX_WALS=', line: 'ETCD_MAX_WALS=1' } | ||
| - { regexp: '^ETCD_MAX_SNAPSHOTS=', line: 'ETCD_MAX_SNAPSHOTS=1' } | ||
| - { regexp: '^ETCD_ENABLE_V2=', line: 'ETCD_ENABLE_V2=false' } | ||
|
|
||
| # Restart etcd to apply temporal configuration and prevent some upgrade failures | ||
| # See also: https://etcd.io/blog/2025/upgrade_from_3.5_to_3.6_issue_followup/ | ||
| - name: Stop etcd | ||
| service: | ||
| name: etcd | ||
| state: stopped | ||
|
|
||
| - name: Start etcd | ||
| service: | ||
| name: etcd | ||
| state: started | ||
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
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
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
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
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.
Should we need this debug message?
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.
Not mandatory.
But this is the last chance to show the etcd version before installing a new one, so this might be useful for troubleshooting.