|
|
@ -18,8 +18,9 @@ |
|
|
|
- name: Create test namespace # noqa 301 305 |
|
|
|
shell: "{{ bin_dir }}/kubectl create namespace test" |
|
|
|
|
|
|
|
- name: Run 2 busybox pods in test ns # noqa 301 305 |
|
|
|
- name: Run 2 busybox pods in test ns # noqa 305 |
|
|
|
shell: "{{ bin_dir }}/kubectl run {{ item }} --image={{ test_image_repo }}:{{ test_image_tag }} --namespace test --command -- tail -f /dev/null" |
|
|
|
changed_when: false |
|
|
|
loop: |
|
|
|
- busybox1 |
|
|
|
- busybox2 |
|
|
@ -27,8 +28,9 @@ |
|
|
|
- import_role: |
|
|
|
name: cluster-dump |
|
|
|
|
|
|
|
- name: Check that all pods are running and ready # noqa 301 305 |
|
|
|
- name: Check that all pods are running and ready # noqa 305 |
|
|
|
shell: "{{ bin_dir }}/kubectl get pods --namespace test --no-headers -o yaml" |
|
|
|
changed_when: false |
|
|
|
register: run_pods_log |
|
|
|
until: |
|
|
|
# Check that all pods are running |
|
|
@ -40,8 +42,9 @@ |
|
|
|
failed_when: false |
|
|
|
no_log: true |
|
|
|
|
|
|
|
- name: Get pod names # noqa 301 305 |
|
|
|
- name: Get pod names # noqa 305 |
|
|
|
shell: "{{ bin_dir }}/kubectl get pods -n test -o json" |
|
|
|
changed_when: false |
|
|
|
register: pods |
|
|
|
no_log: true |
|
|
|
|
|
|
@ -49,20 +52,23 @@ |
|
|
|
msg: "{{ pods.stdout.split('\n') }}" |
|
|
|
failed_when: not run_pods_log is success |
|
|
|
|
|
|
|
- name: Get hostnet pods # noqa 301 |
|
|
|
- name: Get hostnet pods |
|
|
|
command: "{{ bin_dir }}/kubectl get pods -n test -o |
|
|
|
jsonpath='{range .items[?(.spec.hostNetwork)]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'" |
|
|
|
changed_when: false |
|
|
|
register: hostnet_pods |
|
|
|
no_log: true |
|
|
|
|
|
|
|
- name: Get running pods # noqa 301 |
|
|
|
- name: Get running pods |
|
|
|
command: "{{ bin_dir }}/kubectl get pods -n test -o |
|
|
|
jsonpath='{range .items[?(.status.phase==\"Running\")]}{.metadata.name} {.status.podIP} {.status.containerStatuses} {end}'" |
|
|
|
changed_when: False |
|
|
|
register: running_pods |
|
|
|
no_log: true |
|
|
|
|
|
|
|
- name: Check kubectl output # noqa 301 305 |
|
|
|
- name: Check kubectl output # noqa 305 |
|
|
|
shell: "{{ bin_dir }}/kubectl get pods --all-namespaces -owide" |
|
|
|
changed_when: False |
|
|
|
register: get_pods |
|
|
|
no_log: true |
|
|
|
|
|
|
|