forked from nais/naisible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-playbook.yaml
64 lines (53 loc) · 1.7 KB
/
test-playbook.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
- hosts: masters
user: "{{ remote_user }}"
become: yes
vars:
HOST_COUNT: "{{ groups['all'] | length }}"
tasks:
- name: Ensure required processes is running
shell: /bin/pgrep {{ item }} | wc -l
with_items:
- dockerd
- kubelet
- etcd
register: process_count
failed_when: process_count.stdout != "1"
- name: Ensure docker interfaces is present
shell: ip link show docker0
- name: Ensure all kubernetes components are healthy
shell: /usr/bin/kubectl get componentstatuses
register: componentstatuses
failed_when: "'Unhealthy' in componentstatuses.stdout"
- name: Verify that all nodes are in Ready-state
shell: /usr/bin/kubectl get nodes | grep -iw 'Ready' | wc -l
register: ready_count
failed_when: ready_count.stdout != "{{ HOST_COUNT }}"
- name: Ensure addons are deployed and available
shell: "/usr/bin/kubectl -n kube-system get deploy {{ item }} -o json | grep '\"availableReplicas\": 1' | wc -l"
with_items:
- coredns
- kubernetes-dashboard
- tiller-deploy
- heapster
- monitoring-influxdb
register: matches_spec
failed_when: matches_spec.stdout != "1"
- hosts: workers
user: "{{ remote_user }}"
become: yes
tasks:
- name: Ensure required processes is running
shell: /bin/pgrep {{ item }} | wc -l
with_items:
- dockerd
- kubelet
- flanneld
- kube-proxy
register: process_count
failed_when: process_count.stdout != "1"
- name: Ensure required interfaces is present
shell: ip link show {{ item }}
with_items:
- docker0
- flannel.1