-
Notifications
You must be signed in to change notification settings - Fork 5
/
14-cleanup.yml
75 lines (64 loc) · 2 KB
/
14-cleanup.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
---
- name: Ensure all GCE resources are deleted
hosts: localhost
connection: local
gather_facts: no
tasks:
- name: Ensure all controllers are deleted
gce:
instance_names: controller-0,controller-1,controller-2
zone: us-west1-a
state: absent
- name: Ensure all workers are deleted
gce:
instance_names: worker-0,worker-1,worker-2
zone: us-west1-a
state: absent
- name: Ensure pki instance is deleted
gce:
instance_names: pki
zone: us-west1-a
state: absent
- name: Ensure LB is deleted
gce_lb:
name: kubernetes-the-hard-way
external_ip: kubernetes-the-hard-way
protocol: tcp
port_range: 6443
region: us-west1
members: ['us-west1-a/controller-0', 'us-west1-a/controller-1', 'us-west1-a/controller-2']
state: deleted
- name: Ensure static IP address is deleted
gce_eip:
name: kubernetes-the-hard-way
region: us-west1
state: absent
ignore_errors: true
- name: Ensure firewall rules are deleted
gce_net:
name: kubernetes-the-hard-way
fwname: "{{ item }}"
state: absent
with_items:
- kubernetes-the-hard-way-allow-external
- kubernetes-the-hard-way-allow-internal
- kubernetes-the-hard-way-allow-nginx-service
- name: Ensure custom routes are deleted
command: |
gcloud -q compute routes delete \
kubernetes-route-worker-0 \
kubernetes-route-worker-1 \
kubernetes-route-worker-2
ignore_errors: true
- name: Ensure kubernetes-the-hard-way network is absent
gce_net:
name: kubernetes-the-hard-way
mode: custom
subnet_region: us-west1
subnet_name: "kubernetes"
ipv4_range: '10.240.0.0/24'
state: absent
- name: Ensure custom network is deleted
command: |
gcloud -q compute networks delete kubernetes-the-hard-way
ignore_errors: true