kubeasz/roles/cluster-addon/tasks/cilium_connectivity_check.yml

33 lines
1.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

- block:
- name: 准备 cilium-check 配置目录
file: name={{ cluster_dir }}/yml/cilium-check state=directory
- name: 准备部署文件
template: src=cilium-check/{{ item }}.j2 dest={{ cluster_dir }}/yml/cilium-check/{{ item }}
with_items:
- "connectivity-check.yaml"
- "check-part1.yaml"
- "namespace.yaml"
- name: 创建测试namespace
shell: "{{ base_dir }}/bin/kubectl apply -f {{ cluster_dir }}/yml/cilium-check/namespace.yaml"
- name: 创建测试part1
shell: "{{ base_dir }}/bin/kubectl apply -n cilium-test -f {{ cluster_dir }}/yml/cilium-check/check-part1.yaml"
- name: 轮询等待echo pod运行视下载镜像速度而定
shell: "{{ base_dir }}/bin/kubectl get pod -n cilium-test |grep echo|grep Running|grep '1/1'|wc -l"
register: pod_status
until: pod_status.stdout == "3"
retries: 15
delay: 8
ignore_errors: true
- name: 创建完整测试connectivity-check
shell: "{{ base_dir }}/bin/kubectl apply -n cilium-test -f {{ cluster_dir }}/yml/cilium-check/connectivity-check.yaml"
- debug:
msg: "[重要]: 请查看命名空间cilium-test下所有pod如果均为Running状态且没有重启数增长说明cilium连接测试正常。 \
测试观察一段时间可以整体删除该命名空间所有资源(kubectl delete ns cilium-test)"
when: 'cilium_connectivity_check|bool'