Fixup recover control plane playbook + add debian12/cilium test (#10411)
* Add debian12 cilium testing * Fixup recover control plane playbookpull/10414/head
parent
aeca9304f4
commit
9696936b59
|
@ -33,7 +33,7 @@ variables:
|
||||||
MITOGEN_ENABLE: "false"
|
MITOGEN_ENABLE: "false"
|
||||||
ANSIBLE_LOG_LEVEL: "-vv"
|
ANSIBLE_LOG_LEVEL: "-vv"
|
||||||
RECOVER_CONTROL_PLANE_TEST: "false"
|
RECOVER_CONTROL_PLANE_TEST: "false"
|
||||||
RECOVER_CONTROL_PLANE_TEST_GROUPS: "etcd[2:],kube_control_plane[1:]"
|
RECOVER_CONTROL_PLANE_TEST_GROUPS: "etcd[2:]:kube_control_plane[1:]"
|
||||||
TERRAFORM_VERSION: 1.3.7
|
TERRAFORM_VERSION: 1.3.7
|
||||||
PIPELINE_IMAGE: "$CI_REGISTRY_IMAGE/pipeline:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
|
PIPELINE_IMAGE: "$CI_REGISTRY_IMAGE/pipeline:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}"
|
||||||
|
|
||||||
|
|
|
@ -122,6 +122,11 @@ packet_debian12-docker:
|
||||||
extends: .packet_pr
|
extends: .packet_pr
|
||||||
when: on_success
|
when: on_success
|
||||||
|
|
||||||
|
packet_debian12-cilium:
|
||||||
|
stage: deploy-part2
|
||||||
|
extends: .packet_periodic
|
||||||
|
when: on_success
|
||||||
|
|
||||||
packet_centos7-calico-ha-once-localhost:
|
packet_centos7-calico-ha-once-localhost:
|
||||||
stage: deploy-part2
|
stage: deploy-part2
|
||||||
extends: .packet_pr
|
extends: .packet_pr
|
||||||
|
@ -311,7 +316,7 @@ packet_ubuntu20-calico-ha-recover:
|
||||||
when: on_success
|
when: on_success
|
||||||
variables:
|
variables:
|
||||||
RECOVER_CONTROL_PLANE_TEST: "true"
|
RECOVER_CONTROL_PLANE_TEST: "true"
|
||||||
RECOVER_CONTROL_PLANE_TEST_GROUPS: "etcd[2:],kube_control_plane[1:]"
|
RECOVER_CONTROL_PLANE_TEST_GROUPS: "etcd[2:]:kube_control_plane[1:]"
|
||||||
|
|
||||||
packet_ubuntu20-calico-ha-recover-noquorum:
|
packet_ubuntu20-calico-ha-recover-noquorum:
|
||||||
stage: deploy-part3
|
stage: deploy-part3
|
||||||
|
@ -319,4 +324,4 @@ packet_ubuntu20-calico-ha-recover-noquorum:
|
||||||
when: on_success
|
when: on_success
|
||||||
variables:
|
variables:
|
||||||
RECOVER_CONTROL_PLANE_TEST: "true"
|
RECOVER_CONTROL_PLANE_TEST: "true"
|
||||||
RECOVER_CONTROL_PLANE_TEST_GROUPS: "etcd[1:],kube_control_plane[1:]"
|
RECOVER_CONTROL_PLANE_TEST_GROUPS: "etcd[1:]:kube_control_plane[1:]"
|
||||||
|
|
|
@ -11,7 +11,7 @@ amazon | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
|
||||||
centos7 | :white_check_mark: | :x: | :x: | :white_check_mark: | :x: | :white_check_mark: | :x: | :white_check_mark: |
|
centos7 | :white_check_mark: | :x: | :x: | :white_check_mark: | :x: | :white_check_mark: | :x: | :white_check_mark: |
|
||||||
debian10 | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :white_check_mark: | :x: |
|
debian10 | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :white_check_mark: | :x: |
|
||||||
debian11 | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
|
debian11 | :white_check_mark: | :x: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
|
||||||
debian12 | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
|
debian12 | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: |
|
||||||
fedora37 | :white_check_mark: | :x: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: |
|
fedora37 | :white_check_mark: | :x: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: |
|
||||||
fedora38 | :x: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: | :x: |
|
fedora38 | :x: | :x: | :x: | :x: | :white_check_mark: | :x: | :x: | :x: |
|
||||||
opensuse | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
|
opensuse | :x: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
|
||||||
|
|
|
@ -12,19 +12,19 @@
|
||||||
ETCDCTL_KEY: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem"
|
ETCDCTL_KEY: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem"
|
||||||
ETCDCTL_CACERT: "{{ etcd_cert_dir }}/ca.pem"
|
ETCDCTL_CACERT: "{{ etcd_cert_dir }}/ca.pem"
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['broken_etcd']
|
- groups['broken_etcd']
|
||||||
|
|
||||||
- name: Set healthy fact
|
- name: Set healthy fact
|
||||||
set_fact:
|
set_fact:
|
||||||
healthy: "{{ etcd_endpoint_health.stderr is match('Error: unhealthy cluster') }}"
|
healthy: "{{ etcd_endpoint_health.stderr is match('Error: unhealthy cluster') }}"
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['broken_etcd']
|
- groups['broken_etcd']
|
||||||
|
|
||||||
- name: Set has_quorum fact
|
- name: Set has_quorum fact
|
||||||
set_fact:
|
set_fact:
|
||||||
has_quorum: "{{ etcd_endpoint_health.stdout_lines | select('match', '.*is healthy.*') | list | length >= etcd_endpoint_health.stderr_lines | select('match', '.*is unhealthy.*') | list | length }}"
|
has_quorum: "{{ etcd_endpoint_health.stdout_lines | select('match', '.*is healthy.*') | list | length >= etcd_endpoint_health.stderr_lines | select('match', '.*is unhealthy.*') | list | length }}"
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['broken_etcd']
|
- groups['broken_etcd']
|
||||||
|
|
||||||
- name: Recover lost etcd quorum
|
- name: Recover lost etcd quorum
|
||||||
include_tasks: recover_lost_quorum.yml
|
include_tasks: recover_lost_quorum.yml
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
with_items: "{{ groups['broken_etcd'] }}"
|
with_items: "{{ groups['broken_etcd'] }}"
|
||||||
ignore_errors: true # noqa ignore-errors
|
ignore_errors: true # noqa ignore-errors
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['broken_etcd']
|
- groups['broken_etcd']
|
||||||
- has_quorum
|
- has_quorum
|
||||||
|
|
||||||
- name: Delete old certificates
|
- name: Delete old certificates
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
loop: "{{ delete_old_cerificates.results }}"
|
loop: "{{ delete_old_cerificates.results }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['broken_etcd']
|
- groups['broken_etcd']
|
||||||
- "item.rc != 0 and not 'No such file or directory' in item.stderr"
|
- "item.rc != 0 and not 'No such file or directory' in item.stderr"
|
||||||
|
|
||||||
- name: Get etcd cluster members
|
- name: Get etcd cluster members
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
ETCDCTL_KEY: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem"
|
ETCDCTL_KEY: "{{ etcd_cert_dir }}/admin-{{ inventory_hostname }}-key.pem"
|
||||||
ETCDCTL_CACERT: "{{ etcd_cert_dir }}/ca.pem"
|
ETCDCTL_CACERT: "{{ etcd_cert_dir }}/ca.pem"
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['broken_etcd']
|
- groups['broken_etcd']
|
||||||
- not healthy
|
- not healthy
|
||||||
- has_quorum
|
- has_quorum
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
- "{{ groups['broken_etcd'] }}"
|
- "{{ groups['broken_etcd'] }}"
|
||||||
- "{{ member_list.stdout_lines }}"
|
- "{{ member_list.stdout_lines }}"
|
||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['broken_etcd']
|
- groups['broken_etcd']
|
||||||
- not healthy
|
- not healthy
|
||||||
- has_quorum
|
- has_quorum
|
||||||
- hostvars[item[0]]['etcd_member_name'] == item[1].replace(' ', '').split(',')[2]
|
- hostvars[item[0]]['etcd_member_name'] == item[1].replace(' ', '').split(',')[2]
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
# Instance settings
|
||||||
|
cloud_image: debian-12
|
||||||
|
mode: default
|
||||||
|
|
||||||
|
# Kubespray settings
|
||||||
|
kube_network_plugin: cilium
|
|
@ -83,7 +83,7 @@ fi
|
||||||
# Test control plane recovery
|
# Test control plane recovery
|
||||||
if [ "${RECOVER_CONTROL_PLANE_TEST}" != "false" ]; then
|
if [ "${RECOVER_CONTROL_PLANE_TEST}" != "false" ]; then
|
||||||
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_SETTING} -e @${CI_TEST_REGISTRY_MIRROR} -e @${CI_TEST_VARS} -e local_release_dir=${PWD}/downloads --limit "${RECOVER_CONTROL_PLANE_TEST_GROUPS}:!fake_hosts" -e reset_confirmation=yes reset.yml
|
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_SETTING} -e @${CI_TEST_REGISTRY_MIRROR} -e @${CI_TEST_VARS} -e local_release_dir=${PWD}/downloads --limit "${RECOVER_CONTROL_PLANE_TEST_GROUPS}:!fake_hosts" -e reset_confirmation=yes reset.yml
|
||||||
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_SETTING} -e @${CI_TEST_REGISTRY_MIRROR} -e @${CI_TEST_VARS} -e local_release_dir=${PWD}/downloads -e etcd_retries=10 --limit etcd,kube_control_plane:!fake_hosts recover-control-plane.yml
|
ansible-playbook ${ANSIBLE_LOG_LEVEL} -e @${CI_TEST_SETTING} -e @${CI_TEST_REGISTRY_MIRROR} -e @${CI_TEST_VARS} -e local_release_dir=${PWD}/downloads -e etcd_retries=10 --limit "etcd:kube_control_plane:!fake_hosts" recover-control-plane.yml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test collection build and install by installing our collection, emptying our repository, adding
|
# Test collection build and install by installing our collection, emptying our repository, adding
|
||||||
|
|
Loading…
Reference in New Issue