-
Notifications
You must be signed in to change notification settings - Fork 4
/
playbook_microk8s.yml
41 lines (35 loc) · 1.11 KB
/
playbook_microk8s.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
# can deploy on single host by overriding HA variable, must use json syntax:
# ansible-playbook playbook_microk8s.yml --extra-vars '{"microk8s_enable_HA": false}
#
# show all vars:
# ansible -m debug microk8s-1 -a "var=hostvars[inventory_hostname]"
---
# roles run against cluster
- hosts: microk8s_HA
gather_facts: yes
become: yes
vars:
microk8s_enable_HA: true
roles:
# prerequisites and then main microk8s role
- microk8s-prereq
- ansible_role_microk8s
# GUI utility for kubernetes
- k9s
# additional roles for post-configuration, run just against single node
- hosts: microk8s
gather_facts: no
become: yes
roles:
- wait-for-microk8s
# fetch kubeconfig locally for convenience
- microk8s-get-kubeconfig-local
# tiny-tools daemonset for troubleshooting
- tiny-tools-all-nodes
# configure additional IP to be used by MetalLB endpoints
- additional-netplan-ip
# create custom CA and cert for TLS
# certs also slurped locally to /tmp
- cert-with-ca
# load tls secrets into namespaces
- { role: reapply-k8s-tls-secrets, tls_secret_overwrite: true }