parent
06ae6cfe8a
commit
69201662df
|
@ -20,7 +20,6 @@
|
||||||
command: "{{ bin_dir }}/kubectl get nodes"
|
command: "{{ bin_dir }}/kubectl get nodes"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: get_nodes
|
register: get_nodes
|
||||||
no_log: true
|
|
||||||
|
|
||||||
- debug: # noqa name[missing]
|
- debug: # noqa name[missing]
|
||||||
msg: "{{ get_nodes.stdout.split('\n') }}"
|
msg: "{{ get_nodes.stdout.split('\n') }}"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
command: "{{ bin_dir }}/kubectl get pods --all-namespaces -owide"
|
command: "{{ bin_dir }}/kubectl get pods --all-namespaces -owide"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: get_pods
|
register: get_pods
|
||||||
no_log: true
|
|
||||||
|
|
||||||
- debug: # noqa name[missing]
|
- debug: # noqa name[missing]
|
||||||
msg: "{{ get_pods.stdout.split('\n') }}"
|
msg: "{{ get_pods.stdout.split('\n') }}"
|
||||||
|
@ -37,13 +36,11 @@
|
||||||
retries: 30
|
retries: 30
|
||||||
delay: 10
|
delay: 10
|
||||||
failed_when: false
|
failed_when: false
|
||||||
no_log: true
|
|
||||||
|
|
||||||
- name: Check kubectl output
|
- name: Check kubectl output
|
||||||
command: "{{ bin_dir }}/kubectl get pods --all-namespaces -owide"
|
command: "{{ bin_dir }}/kubectl get pods --all-namespaces -owide"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: get_pods
|
register: get_pods
|
||||||
no_log: true
|
|
||||||
|
|
||||||
- debug: # noqa name[missing]
|
- debug: # noqa name[missing]
|
||||||
msg: "{{ get_pods.stdout.split('\n') }}"
|
msg: "{{ get_pods.stdout.split('\n') }}"
|
||||||
|
|
|
@ -117,13 +117,11 @@
|
||||||
retries: 18
|
retries: 18
|
||||||
delay: 10
|
delay: 10
|
||||||
failed_when: false
|
failed_when: false
|
||||||
no_log: true
|
|
||||||
|
|
||||||
- name: Get pod names
|
- name: Get pod names
|
||||||
command: "{{ bin_dir }}/kubectl get pods -n test -o json"
|
command: "{{ bin_dir }}/kubectl get pods -n test -o json"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: pods
|
register: pods
|
||||||
no_log: true
|
|
||||||
|
|
||||||
- debug: # noqa name[missing]
|
- debug: # noqa name[missing]
|
||||||
msg: "{{ pods.stdout.split('\n') }}"
|
msg: "{{ pods.stdout.split('\n') }}"
|
||||||
|
@ -135,20 +133,17 @@
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: hostnet_pods
|
register: hostnet_pods
|
||||||
ignore_errors: true # noqa ignore-errors
|
ignore_errors: true # noqa ignore-errors
|
||||||
no_log: true
|
|
||||||
|
|
||||||
- name: Get running pods
|
- name: Get running pods
|
||||||
command: "{{ bin_dir }}/kubectl get pods -n test -o
|
command: "{{ bin_dir }}/kubectl get pods -n test -o
|
||||||
jsonpath='{range .items[?(.status.phase==\"Running\")]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'"
|
jsonpath='{range .items[?(.status.phase==\"Running\")]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: running_pods
|
register: running_pods
|
||||||
no_log: true
|
|
||||||
|
|
||||||
- name: Check kubectl output
|
- name: Check kubectl output
|
||||||
command: "{{ bin_dir }}/kubectl get pods --all-namespaces -owide"
|
command: "{{ bin_dir }}/kubectl get pods --all-namespaces -owide"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: get_pods
|
register: get_pods
|
||||||
no_log: true
|
|
||||||
|
|
||||||
- debug: # noqa name[missing]
|
- debug: # noqa name[missing]
|
||||||
msg: "{{ get_pods.stdout.split('\n') }}"
|
msg: "{{ get_pods.stdout.split('\n') }}"
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
command: "{{ bin_dir }}/kubectl -n {{ netcheck_namespace }} describe pod -l app={{ item }}"
|
command: "{{ bin_dir }}/kubectl -n {{ netcheck_namespace }} describe pod -l app={{ item }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
delegate_to: "{{ groups['kube_control_plane'][0] }}"
|
||||||
no_log: false
|
|
||||||
with_items:
|
with_items:
|
||||||
- netchecker-agent
|
- netchecker-agent
|
||||||
- netchecker-agent-hostnet
|
- netchecker-agent-hostnet
|
||||||
|
@ -72,7 +71,6 @@
|
||||||
agents.content[0] == '{' and
|
agents.content[0] == '{' and
|
||||||
agents.content | from_json | length >= groups['k8s_cluster'] | intersect(ansible_play_hosts) | length * 2
|
agents.content | from_json | length >= groups['k8s_cluster'] | intersect(ansible_play_hosts) | length * 2
|
||||||
failed_when: false
|
failed_when: false
|
||||||
no_log: false
|
|
||||||
|
|
||||||
- name: Check netchecker status
|
- name: Check netchecker status
|
||||||
uri:
|
uri:
|
||||||
|
@ -86,7 +84,6 @@
|
||||||
delay: "{{ agent_report_interval }}"
|
delay: "{{ agent_report_interval }}"
|
||||||
until: connectivity_check.content | length > 0 and
|
until: connectivity_check.content | length > 0 and
|
||||||
connectivity_check.content[0] == '{'
|
connectivity_check.content[0] == '{'
|
||||||
no_log: false
|
|
||||||
failed_when: false
|
failed_when: false
|
||||||
when:
|
when:
|
||||||
- agents.content != '{}'
|
- agents.content != '{}'
|
||||||
|
@ -97,7 +94,6 @@
|
||||||
|
|
||||||
- name: Get kube-proxy logs
|
- name: Get kube-proxy logs
|
||||||
command: "{{ bin_dir }}/kubectl -n kube-system logs -l k8s-app=kube-proxy"
|
command: "{{ bin_dir }}/kubectl -n kube-system logs -l k8s-app=kube-proxy"
|
||||||
no_log: false
|
|
||||||
when:
|
when:
|
||||||
- inventory_hostname == groups['kube_control_plane'][0]
|
- inventory_hostname == groups['kube_control_plane'][0]
|
||||||
- not connectivity_check is success
|
- not connectivity_check is success
|
||||||
|
@ -107,7 +103,6 @@
|
||||||
when:
|
when:
|
||||||
- inventory_hostname == groups['kube_control_plane'][0]
|
- inventory_hostname == groups['kube_control_plane'][0]
|
||||||
- not connectivity_check is success
|
- not connectivity_check is success
|
||||||
no_log: false
|
|
||||||
with_items:
|
with_items:
|
||||||
- kube-router
|
- kube-router
|
||||||
- flannel
|
- flannel
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Generate dump folder
|
- name: Generate dump folder
|
||||||
command: "{{ bin_dir }}/kubectl cluster-info dump --all-namespaces --output-directory /tmp/cluster-dump"
|
command: "{{ bin_dir }}/kubectl cluster-info dump --all-namespaces --output-directory /tmp/cluster-dump"
|
||||||
no_log: true
|
|
||||||
when: inventory_hostname in groups['kube_control_plane']
|
when: inventory_hostname in groups['kube_control_plane']
|
||||||
|
|
||||||
- name: Compress directory cluster-dump
|
- name: Compress directory cluster-dump
|
||||||
|
|
Loading…
Reference in New Issue