mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
Merge pull request #12219 from VannTen/test/ha_etcd_separate
Fix broken workaround for separate etcd setup
This commit is contained in:
@@ -55,6 +55,7 @@ pr:
|
||||
- ubuntu22-calico-all-in-one
|
||||
- ubuntu22-calico-all-in-one-upgrade
|
||||
- ubuntu24-calico-etcd-datastore
|
||||
- ubuntu24-ha-separate-etcd
|
||||
|
||||
# The ubuntu20-calico-all-in-one jobs are meant as early stages to prevent running the full CI if something is horribly broken
|
||||
ubuntu20-calico-all-in-one:
|
||||
|
||||
@@ -98,28 +98,6 @@
|
||||
loop_control:
|
||||
label: "{{ item.item }}"
|
||||
|
||||
# This is a hack around the fact kubeadm expect the same certs path on all kube_control_plane
|
||||
# TODO: fix certs generation to have the same file everywhere
|
||||
# OR work with kubeadm on node-specific config
|
||||
- name: Gen_certs | Pretend all control plane have all certs (with symlinks)
|
||||
file:
|
||||
state: link
|
||||
src: "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}{{ item[0] }}.pem"
|
||||
dest: "{{ etcd_cert_dir }}/node-{{ item[1] }}{{ item[0] }}.pem"
|
||||
mode: "0640"
|
||||
loop: "{{ suffixes | product(groups['kube_control_plane']) }}"
|
||||
vars:
|
||||
suffixes:
|
||||
- ''
|
||||
- '-key'
|
||||
when:
|
||||
- ('kube_control_plane' in group_names)
|
||||
- item[1] != inventory_hostname
|
||||
register: symlink_created
|
||||
failed_when:
|
||||
- symlink_created is failed
|
||||
- ('refusing to convert from file to symlink' not in symlink_created.msg)
|
||||
|
||||
- name: Gen_certs | Gather node certs from first etcd node
|
||||
slurp:
|
||||
src: "{{ item }}"
|
||||
@@ -175,3 +153,25 @@
|
||||
owner: "{{ etcd_owner }}"
|
||||
mode: "{{ etcd_cert_dir_mode }}"
|
||||
recurse: true
|
||||
|
||||
# This is a hack around the fact kubeadm expect the same certs path on all kube_control_plane
|
||||
# TODO: fix certs generation to have the same file everywhere
|
||||
# OR work with kubeadm on node-specific config
|
||||
- name: Gen_certs | Pretend all control plane have all certs (with symlinks)
|
||||
file:
|
||||
state: link
|
||||
src: "{{ etcd_cert_dir }}/node-{{ inventory_hostname }}{{ item[0] }}.pem"
|
||||
dest: "{{ etcd_cert_dir }}/node-{{ item[1] }}{{ item[0] }}.pem"
|
||||
mode: "0640"
|
||||
loop: "{{ suffixes | product(groups['kube_control_plane']) }}"
|
||||
vars:
|
||||
suffixes:
|
||||
- ''
|
||||
- '-key'
|
||||
when:
|
||||
- ('kube_control_plane' in group_names)
|
||||
- item[1] != inventory_hostname
|
||||
register: symlink_created
|
||||
failed_when:
|
||||
- symlink_created is failed
|
||||
- ('refusing to convert from file to symlink' not in symlink_created.msg)
|
||||
|
||||
13
tests/files/ubuntu24-ha-separate-etcd.yml
Normal file
13
tests/files/ubuntu24-ha-separate-etcd.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
cloud_image: ubuntu-2404
|
||||
cluster_layout:
|
||||
- node_groups: ['kube_control_plane']
|
||||
- node_groups: ['kube_control_plane']
|
||||
- node_groups: ['kube_control_plane']
|
||||
- node_groups: ['kube_node']
|
||||
- node_groups: ['etcd']
|
||||
- node_groups: ['etcd']
|
||||
- node_groups: ['etcd']
|
||||
|
||||
kube_network_plugin: calico
|
||||
calico_datastore: etcd
|
||||
Reference in New Issue
Block a user