369 Commits
Author SHA1 Message Date
Luca Marsella a3d30ad42c fix(etcd): default etcd_secret_changed to false (#13691)
etcd_secret_changed is only set by check_certs.yml, which runs only
when cert_management is "script". With cert_management set to "none",
the "Restart etcd if certs changed" tasks fail because the variable is
undefined.

Signed-off-by: Luca Marsella <marsluca7@gmail.com>
2026-10-29 10:46:47 +00:00
longxiucai 547d4991e8 Add missing retries to the etcd-events ensure-member check (#13669)
The etcd twin of "Join Member | Ensure member is in etcd-events cluster"
retries the etcdctl member list check (retries/delay/until), the events
copy does not: a transient etcdctl failure right after the member was
added - exactly when the events cluster quorum is shifting - aborts the
play on etcd_events_cluster deployments while the main etcd path rides
the same blip out. Mirror the twin's retry block with the events register
variable. Second instance of the etcd/etcd-events task divergence; the
first was #13640.

Signed-off-by: longyuxiang <longyuxiang@kylinos.cn>
2026-10-19 04:09:41 +00:00
longxiucai 527f251431 Fix etcd-events member add failing when the member already exists (#13640)
join_etcd_member.yml tolerates 'Peer URLs already exists' since #6587,
but the etcd-events twin was missed: when a previous run was interrupted
after the member was added, the re-run keeps retrying etcdctl member add
until etcd_retries is exhausted and aborts the play. Mirror the exact
until/failed_when pair from the etcd version.
2026-10-13 09:14:21 +00:00
Ali Afsharzadeh d98540de2c Add etcd_feature_gates and restore the etcd 3.5 flag names (#13569)
Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
2026-10-08 03:41:59 +00:00
Dasmat Hansda a9c2b73d31 fix: ensure consistent etcd certificate permissions on first etcd node (#13367)
* fix(etcd): ensure consistent certificate permissions on first etcd node

The etcd certificate generation script runs on the first etcd node and
creates certs with default ownership and permissions. Subsequent copy
tasks set explicit ownership and permissions on the remaining etcd
nodes, resulting in inconsistent permissions across the cluster.

This can cause issues such as etcd backup jobs failing on the first
node due to missing read access to certificate files.

Add an ansible.builtin.file task after cert generation to explicitly
set the correct ownership and permissions on the first etcd node.

* fix(etcd): guard client certificate permissions

* fix(etcd): set certificate permissions during installation
2026-09-28 07:32:33 +00:00
Ali Afsharzadeh cc65b8d9e3 Upgrade etcd to 3.7 for Kubernetes 1.37 (#13363)
Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
2026-09-25 06:16:30 +00:00
Ali Afsharzadeh 0fd9672b0c Remove obsolete "Flatcar Container Linux by Kinvolk" fact checks (#13528)
Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
2026-09-18 10:12:42 +00:00
Nikhil Kumar cfa983e8c7 Replace injected Ansible fact variables in etcd role (#13338) 2026-09-10 11:24:34 +00:00
Max Gautier c554ee816d fix/ansible-core 2.19: etcd: avoid mutating methods in template (#13474)
2.19 disallow methods with side effects in Jinja. Use a simple loop by
adding all the SANs source in one list.

Also check the sources before hand for failing on CIDR notation.

Link: https://github.com/ansible/ansible/issues/85202
2026-09-08 09:12:32 +00:00
Max Gautier 4b7dfaef87 fix/ansible 2.19: etcd: don't rely on final evaluation (#13475)
Suggested-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
2026-09-08 08:04:32 +00:00
Adesh Deshmukh 63bdde2ade Fix inverted ignore_errors condition for etcd-events service startup (#13343)
The ignore_errors condition on the etcd-events service startup task
(Configure | Ensure etcd-events is running) uses != instead of ==,
which is the inverse of the correct pattern used for the main etcd
service on the line above.

This was introduced in commit 7516fe142 when the # noqa ignore-errors
comment was added to the line, accidentally flipping the operator.
2026-07-07 07:50:27 +00:00
Yang-Ming Lin c3d4864e63 Refactor(defaults): centralize etcd defaults (#13161) 2026-04-28 07:54:48 +05:30
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
Max Gautier 37f7a86014 etcd-certs: only change necessary permissions (#12908)
We currently **recursively** set the permissions of /etc/ssl/etcd/ssl
(default path) to 700. But this removes group permission from the files
under it, and certain composents (like calio with etcd datastore) rely
on it ; thus, the upgrade of a cluster can fail because the
calico-kube-controller can't access the certs, and thus the etcd.

This works in other case because as far as I can tell, the apiserver
which do access the etcd run as root (the owner of the files, not just
the "group owner")

We also for some reasons do this twice.

Only create the etcd cert directory with the correct permissions once,
not recursively.
2026-01-27 20:25:52 +05:30
Max Gautier 2740c13c0c Do not use apiserver LB in etcd certificates
etcd does not use the apiserver load balancer, there is no reason to
include it's DNS into etcd certificates.
2026-01-15 16:50:45 +01:00
Max Gautier 51304d57e2 network_facts: streamline set_fact and setup calls
- invoke setup module only once to gather ipv4 and ipv6 addresses
- eliminate remaining use of `fallback_ip` and `fallback_ip6`, allowing
  us to define (with `set_fact` all the "computed" IPs variable in one
  go, since there is no longer a dependency between them.
2026-01-05 15:54:56 +01:00
Max Gautier c03c68e8c7 Do not suppress output during cert generation (#12479)
Makes debugging easier.
2025-08-28 19:43:09 -07:00
刘旭 62f49822dd fix ETCD_INITIAL_CLUSTER config in etcd.env and etcd-events.env (#12342) 2025-06-27 07:44:29 -07:00
Kubernetes Prow Robot c7c3d2ba95 Merge pull request #12163 from VannTen/cleanup/etcd_inv_sample
Move etcd inventory sample doc to role defaults
2025-05-26 03:16:16 -07:00
Max Gautier 92e8ac9de2 Remove tag 'master' (#12228)
* Remove tag master

Following it's deprecation in 4b324cb0f (Rename master to control plane
- non-breaking changes only (#11394), 2024-09-06)

* Add fail fast path when using removed tags

- Used for the master tag, but this could be used for other things in
  the future
2025-05-22 01:20:36 -07:00
Max Gautier 9c2bdeec63 Decouple etcd defaults in a separate role
This allows us to reuse the defaults in other places without putting
everything in kubespray-defaults.

In that, for kubernetes/control-plane.
2025-05-16 14:51:29 +02:00
Max Gautier 22d3cf9c2b Move 'pretend certificates' **after** cert distribution
The link target will only exist after we distribute the certs on each node.
2025-05-15 18:35:34 +02:00
Max Gautier d6d87e9a83 Move cilium_deploy_additionnaly to kubespray-default (#12191)
Instead of using default(false) all over the place, use
kubespray-defaults
2025-05-07 05:05:17 -07:00
Max Gautier fcc294600c Workaround missing etcd certds on control plane node (#12181) 2025-05-05 01:05:57 -07:00
Max Gautier 9631b5fd44 Move etcd inventory sample doc to role defaults 2025-05-04 21:24:26 +02:00
ERIK 8f41a2886d Update version comparison syntax and optimize whitespace (#12146)
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
2025-04-24 00:56:31 -07:00
Max Gautier f9a263090a Propagate v-less version everywhere 2025-03-05 16:18:39 +01:00
ERIK 768fbeff0b update etcd snapshot count (#11997)
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
2025-02-27 01:30:32 -08:00
Boris a51e7dd07d refact ip stack (#11953) 2025-02-11 03:37:58 -08:00
Antoine Legrand 4373c1be1d Revert "Add support for ipv6 only cluster via "enable_ipv6only_stack_networks…" (#11941)
This reverts commit 76c0a3aa75.
2025-02-03 07:06:58 -08:00
Boris 76c0a3aa75 Add support for ipv6 only cluster via "enable_ipv6only_stack_networks" (#11831) 2025-01-27 04:15:22 -08:00
Max Gautier 12a2c5eaa8 verify_settings: consolidate choices validation 2025-01-23 14:32:42 +01:00
Max Gautier 0f0e24be0f etcd: throttle restart for availability (#11677)
* etcd: throttle restart for availability

During upgrade, etcd member are restarted all at once.
This can impact the availability of the etcd cluster and subsequently of
the Kubernetes cluster.

Limit the concurrent restart so that the etcd cluster can keep quorum.

* Simplify etcd handlers
2024-11-05 06:11:29 +00:00
Kubernetes Prow Robot 3f027abae6 Merge pull request #11598 from VannTen/cleanup/fact_gathering
Do not serialize fact gathering for no_proxy
2024-10-31 10:59:26 +00:00
Max Gautier b4768cfa91 Always copy cert generation scripts to first etcd (#11612)
If we don't, existing installation would not pick up fix to that script,
such as dc33a1971d.
2024-10-09 02:44:22 +01:00
Max Gautier 2826b357d4 Remove serialized collect of ansible_default_ipv4
The fallback_ips tasks are essentially serializing the gathering of one
fact on all the hosts, which can have dramatic performance implications
on large clusters (several minutes).

This is essentially a reversal of 35f248dff0
Being able to run without refreshing the cache facts is not worth it.

We keep fallback_ip for now, simply changing the access to a normal
hostvars variable instead of a custom dictionnary.
2024-10-04 14:19:20 +02:00
Max Gautier 2ec1c93897 Test group membership with group_names
Testing for group membership with group names makes Kubespray more
tolerant towards the structure of the inventory.
Where 'inventory_hostname in groups["some_group"] would fail if
"some_group" is not defined, '"some_group" in group_names' would not.
2024-09-21 14:09:09 +02:00
Bogdan Sass 4b324cb0f0 Rename master to control plane - non-breaking changes only (#11394)
K8s is moving away from the "master" terminology, so kubespray should follow the same naming conventions. See https://github.com/kubernetes/community/blob/65d886bb3029e73d9729e1d4f27422a7985233ed/sig-architecture/naming/recommendations/001-master-control-plane.md
2024-09-06 07:56:19 +01:00
刘旭 3da6c4fc18 Allow for configuring etcd progress notify interval and default set to 5s (#11499) 2024-09-05 06:29:05 +01:00
Vlad Korolev 9a7b021eb8 Do not use ‘yes/no’ for boolean values (#11472)
Consistent boolean values in ansible playbooks
2024-08-28 06:30:56 +01:00
Lihai Tu 8208a3f04f Rename systemd module to systemd_service (#11396)
Signed-off-by: tu1h <lihai.tu@daocloud.io>
2024-07-26 01:11:39 -07:00
Tom M. 242edd14ff Fix etcd certificate to acces address as SAN (#11388) 2024-07-25 18:49:23 -07:00
Bas 8f5f75211f Improving yamllint configuration (#11389)
Signed-off-by: Bas Meijer <bas.meijer@enexis.nl>
2024-07-25 18:42:20 -07:00
Max Gautier d50f61eae5 pre-commit: apply autofixes hooks and fix the rest manually
- markdownlint (manual fix)
- end-of-file-fixer
- requirements-txt-fixer
- trailing-whitespace
2024-05-28 13:26:44 +02:00
Ugur Can Ozturk a512b861e0 [etcd/tracing]: fix etcd sampling rate flag (#11175)
Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
2024-05-13 03:14:39 -07:00
yun 13e1f33898 Correct the POLY1305 cipher suites by adding the suffix _SHA256 (#10641) 2024-01-22 18:00:52 +01:00
Ugur Can Ozturk ae780e6a9b [etcd]: add etcd distributed tracing flags (#10666)
* [etcd]: add etcd distributed tracing flags

Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>

* [etcd]: add etcd distributed tracing flags - fix

Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>

* [etcd]: add etcd distributed tracing flags - fix

Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>

---------

Signed-off-by: Ugur Ozturk <ugurozturk918@gmail.com>
2023-12-19 04:00:10 +01:00
Max Gautier 0fb404c775 etcd: use dynamic group for certs generation check (#10610)
We take advantage of group_by to create the list of nodes needing new
certs, instead of manually looping inside a Jinja template.

This should make the role more readable and less susceptible to
white space problems.
2023-12-12 11:22:29 +01:00
Max Gautier 0d4f57aa22 Validate systemd unit files (#10597)
* Validate systemd unit files

This ensure that we fail early if we have a bad systemd unit file
(syntax error, using a version not available in the local version, etc)

* Hack to check systemd version for service files validation

factory-reset.target was introduced in system 250, same version as the
aliasing feature we need for verifying systemd services with ansible.
So we only actually executes the validation if that target is present.

This is an horrible hack which should be reverted as soon as we drop
support for distributions with systemd<250.
2023-11-17 20:01:23 +01:00
Max Gautier 8ebeb88e57 Refactor "multi" handlers to use listen (#10542)
* containerd: refactor handlers to use 'listen'

* cri-dockerd: refactor handlers to use 'listen'

* cri-o: refactor handlers to use 'listen'

* docker: refactor handlers to use 'listen'

* etcd: refactor handlers to use 'listen'

* control-plane: refactor handlers to use 'listen'

* kubeadm: refactor handlers to use 'listen'

* node: refactor handlers to use 'listen'

* preinstall: refactor handlers to use 'listen'

* calico: refactor handlers to use 'listen'

* kube-router: refactor handlers to use 'listen'

* macvlan: refactor handlers to use 'listen'
2023-11-08 12:28:30 +01:00