Files
kubespray/roles/etcd/tasks/install_host.yml
Takuya Murakami 0bfd43499a Update etcd to 3.6 (#12634)
* [etcd] Update etcd 3.5.x to 3.6.5

- Add hashes for etcd 3.6.5
- Remove etcd v2 backup task for etcd 3.6
  The etcd 3.6 removes 'etcdctl backup' command with ETCDCTL_API=2
- Downgrade etcd to 3.5 in netchecker
  The netchecker does not work with etcd 3.6 becaust it removes v2 API support (--enable-v2).
  And netchekcer does not support v3 API.

* Fix: Change etcd config to clean up v2 store before upgrading etcd to 3.6

* Bump etcd to 3.6.8
2026-02-16 19:16:01 +05:30

41 lines
1.3 KiB
YAML

---
- name: Get currently-deployed etcd version
command: "{{ bin_dir }}/etcd --version"
register: etcd_current_host_version
# There's a chance this play could run before etcd is installed at all
# TODO: figure out whether this happens. "A chance" is not enough information
ignore_errors: true
when: etcd_cluster_setup
- name: Restart etcd if necessary
command: /bin/true
notify: Restart etcd
when:
- etcd_cluster_setup
- etcd_version not in etcd_current_host_version.stdout | default('')
- name: Restart etcd-events if necessary
command: /bin/true
notify: Restart etcd-events
when:
- etcd_events_cluster_setup
- etcd_version not in etcd_current_host_version.stdout | default('')
- name: Get currently-deployed etcd version as x.y.z format
set_fact:
etcd_current_version: "{{ (etcd_current_host_version.stdout | regex_search('etcd Version: ([0-9]+\\.[0-9]+\\.[0-9]+)', '\\1'))[0] | default('') }}"
when: etcd_cluster_setup
- name: Cleanup v2 store data
import_tasks: clean_v2_store.yml
- name: Install | Copy etcd binary from download dir
copy:
src: "{{ local_release_dir }}/etcd-v{{ etcd_version }}-linux-{{ host_architecture }}/{{ item }}"
dest: "{{ bin_dir }}/{{ item }}"
mode: "0755"
remote_src: true
with_items:
- etcd
when: etcd_cluster_setup