mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-03 09:49:00 -03:30
Remove netcheker as we now use hydrophone for network tests (#13058)
This commit is contained in:
@@ -13,88 +13,6 @@
|
||||
- import_role: # noqa name[missing]
|
||||
name: cluster-dump
|
||||
|
||||
- name: Wait for netchecker server
|
||||
command: "{{ bin_dir }}/kubectl get pods --field-selector=status.phase==Running -o jsonpath-as-json={.items[*].metadata.name} --namespace {{ netcheck_namespace }}"
|
||||
register: pods_json
|
||||
until:
|
||||
- pods_json.stdout | from_json | select('match', 'netchecker-server.*') | length == 1
|
||||
- (pods_json.stdout | from_json | select('match', 'netchecker-agent.*') | length)
|
||||
>= (groups['k8s_cluster'] | intersect(ansible_play_hosts) | length * 2)
|
||||
retries: 3
|
||||
delay: 10
|
||||
when: inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: Get netchecker pods
|
||||
command: "{{ bin_dir }}/kubectl -n {{ netcheck_namespace }} describe pod -l app={{ item }}"
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
with_items:
|
||||
- netchecker-agent
|
||||
- netchecker-agent-hostnet
|
||||
when: not pods_json is success
|
||||
|
||||
- name: Perform netchecker tests
|
||||
run_once: true
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
block:
|
||||
- name: Get netchecker agents
|
||||
uri:
|
||||
url: "http://{{ (ansible_default_ipv6.address if not (ipv4_stack | default(true)) else ansible_default_ipv4.address) | ansible.utils.ipwrap }}:{{ netchecker_port }}/api/v1/agents/"
|
||||
return_content: true
|
||||
headers:
|
||||
Accept: application/json
|
||||
register: agents
|
||||
retries: 18
|
||||
delay: "{{ agent_report_interval }}"
|
||||
until:
|
||||
- agents is success
|
||||
- (agents.content | from_json | length) == (groups['k8s_cluster'] | length * 2)
|
||||
|
||||
- name: Check netchecker status
|
||||
uri:
|
||||
url: "http://{{ (ansible_default_ipv6.address if not (ipv4_stack | default(true)) else ansible_default_ipv4.address) | ansible.utils.ipwrap }}:{{ netchecker_port }}/api/v1/connectivity_check"
|
||||
return_content: true
|
||||
headers:
|
||||
Accept: application/json
|
||||
register: connectivity_check
|
||||
retries: 3
|
||||
delay: "{{ agent_report_interval }}"
|
||||
until:
|
||||
- connectivity_check is success
|
||||
- connectivity_check.content | from_json
|
||||
|
||||
rescue:
|
||||
- name: Get kube-proxy logs
|
||||
command: "{{ bin_dir }}/kubectl -n kube-system logs -l k8s-app=kube-proxy"
|
||||
|
||||
- name: Get logs from other apps
|
||||
command: "{{ bin_dir }}/kubectl -n kube-system logs -l k8s-app={{ item }} --all-containers"
|
||||
with_items:
|
||||
- kube-router
|
||||
- flannel
|
||||
- canal-node
|
||||
- calico-node
|
||||
- cilium
|
||||
|
||||
- name: Netchecker tests failed
|
||||
fail:
|
||||
msg: "netchecker tests failed"
|
||||
|
||||
- name: Check connectivity with all netchecker agents
|
||||
vars:
|
||||
connectivity_check_result: "{{ connectivity_check.content | from_json }}"
|
||||
agents_check_result: "{{ agents.content | from_json }}"
|
||||
assert:
|
||||
that:
|
||||
- agents_check_result is defined
|
||||
- connectivity_check_result is defined
|
||||
- agents_check_result.keys() | length > 0
|
||||
- not connectivity_check_result.Absent
|
||||
- not connectivity_check_result.Outdated
|
||||
msg: "Connectivity check to netchecker agents failed"
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
run_once: true
|
||||
|
||||
- name: Create macvlan network conf
|
||||
command:
|
||||
cmd: "{{ bin_dir }}/kubectl create -f -"
|
||||
|
||||
@@ -36,10 +36,6 @@
|
||||
when:
|
||||
- ('macvlan' not in testcase)
|
||||
- ('hardening' not in testcase)
|
||||
vars:
|
||||
agent_report_interval: 10
|
||||
netcheck_namespace: default
|
||||
netchecker_port: 31081
|
||||
- name: Testcases for kubernetes conformance
|
||||
import_tasks: 100_check-k8s-conformance.yml
|
||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||
|
||||
Reference in New Issue
Block a user