-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathcluster-infra.yml
49 lines (33 loc) · 1.3 KB
/
cluster-infra.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
#
# Example invocation:
# ansible-playbook cluster-infra.yml -e "cluster_name=foo"
#
---
- hosts: localhost
gather_facts: false
tasks:
- name: Install Dashboard
command: kubectl --kubeconfig cfg/{{ cluster_name }}/admin.conf apply -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml
register: dashboard_raw
- set_fact:
dashboard_output: "{{ dashboard_raw.stdout_lines }}"
- debug:
var: dashboard_output
when: dashboard_output is defined
- name: RBAC for Dashboard
command: kubectl --kubeconfig cfg/{{ cluster_name }}/admin.conf create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts
register: rbac_raw
ignore_errors: true
- set_fact:
rbac_output: "{{ rbac_raw.stdout_lines }}"
- debug:
var: rbac_output
when: rbac_output is defined
- name: Install WeaveScope
command: kubectl --kubeconfig cfg/{{ cluster_name }}/admin.conf apply -f https://cloud.weave.works/launch/k8s/weavescope.yaml
register: weavescope_raw
- set_fact:
weavescope_output: "{{ weavescope_raw.stdout_lines }}"
- debug:
var: weavescope_output
when: weavescope_output is defined