Skip to content

Commit 19f9288

Browse files
added code for smoke test and must gather modules
1 parent 18e5a99 commit 19f9288

File tree

5 files changed

+108
-0
lines changed

5 files changed

+108
-0
lines changed

playbooks/must-gather.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: Collect must-gather logs
3+
hosts: bastion
4+
roles:
5+
- must-gather
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
#defaults file for playbooks/rokes/must-gather
3+
must_gather_dest: /home/must_gather_logs
4+
must_gather_archive: /home/must-gather-logs.tar.gz
5+
#must_gather_local_path: ./must-gather-logs.tar.gz
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
- name: Run oc adm must-gather
3+
command: oc adm must-gather --dest-dir={{ must_gather_dest }}
4+
args:
5+
creates: "{{ must_gather_dest }}/cluster-scoped-resources"
6+
register: must_gather_output
7+
8+
- debug:
9+
var: must_gather_output.stdout_lines
10+
11+
- name: Compress must-gather logs
12+
command: tar -czf {{ must_gather_archive }} -C {{ must_gather_dest | dirname }} {{ must_gather_dest | basename }}
13+
args:
14+
creates: "{{ must_gather_archive }}"
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
- name: Create and debug pods with node affinity
3+
# hosts: bastion
4+
tasks:
5+
6+
- name: Create PPC pod with affinity (ppc64le)
7+
kubernetes.core.k8s:
8+
state: present
9+
definition:
10+
apiVersion: v1
11+
kind: Pod
12+
metadata:
13+
name: ppc-pod
14+
namespace: default
15+
spec:
16+
affinity:
17+
nodeAffinity:
18+
requiredDuringSchedulingIgnoredDuringExecution:
19+
nodeSelectorTerms:
20+
- matchExpressions:
21+
- key: kubernetes.io/arch
22+
operator: In
23+
values: [ppc64le]
24+
containers:
25+
- name: web
26+
image: registry.redhat.io/ubi8/pause
27+
28+
- name: Create x86 pod with affinity (amd64)
29+
kubernetes.core.k8s:
30+
state: present
31+
definition:
32+
apiVersion: v1
33+
kind: Pod
34+
metadata:
35+
name: x86-pod
36+
namespace: default
37+
spec:
38+
affinity:
39+
nodeAffinity:
40+
requiredDuringSchedulingIgnoredDuringExecution:
41+
nodeSelectorTerms:
42+
- matchExpressions:
43+
- key: kubernetes.io/arch
44+
operator: In
45+
values: [amd64]
46+
containers:
47+
- name: web
48+
image: registry.redhat.io/ubi8/pause
49+
50+
- name: Wait for both pods to be Running
51+
shell: oc get pods ppc-pod x86-pod -n default --no-headers
52+
register: pod_status
53+
until: "'Running' in pod_status.stdout"
54+
retries: 10
55+
delay: 10
56+
57+
- name: Show pod status
58+
command: oc get pods -o wide -n default
59+
register: pod_list
60+
changed_when: false
61+
62+
- debug:
63+
msg: "{{ pod_list.stdout_lines }}"
64+
65+
- name: Debug x86 pod (ls inside container)
66+
shell: |
67+
oc debug pod/x86-pod -n default -- ls
68+
register: debug_x86
69+
70+
- debug:
71+
msg: "{{ debug_x86.stdout_lines }}"
72+
73+
- name: Debug ppc pod (ls inside container)
74+
shell: |
75+
oc debug pod/ppc-pod -n default -- ls
76+
register: debug_ppc
77+
78+
- debug:
79+
msg: "{{ debug_ppc.stdout_lines }}"

playbooks/smoke-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: Deploy and verify arch-specific pods
3+
hosts: bastion
4+
roles:
5+
- smoke-test

0 commit comments

Comments
 (0)