-
Notifications
You must be signed in to change notification settings - Fork 42
/
demo-cluster.yml
42 lines (35 loc) · 1.24 KB
/
demo-cluster.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
#!/usr/bin/env ansible-playbook
---
- name: Start up a kind cluster
hosts: localhost
vars:
cluster_name: demo
# This needs to be the cluster name with -control-plane added
container_name: demo-control-plane
cluster_config: demo.yml
kubernetes_version: v1.19.16
tasks:
- import_tasks: ./ansible_tasks/setup_kind_custom_config.yaml
- name: Setup Cluster
hosts: demo-control-plane
connection: docker
vars:
ansible_python_interpreter: /usr/bin/python3
tasks:
- import_tasks: ./ansible_tasks/setup_kubeconfig.yml
- import_tasks: ./ansible_tasks/make_default_service_account_cluster_admin.yaml
- name: Get the kubeconfig file for the client
fetch:
src: /etc/kubernetes/admin.conf
dest: /tmp/demo-kubernetes-admin.conf
flat: yes
- name: cluster-admin Unauthenticated
command: kubectl create clusterrolebinding unauth-cluster-admin --clusterrole=cluster-admin --group=system:unauthenticated
- name: Copy Kubernetes Dasboard manifest
copy:
src: ./manifests/kubernetes-dashboard-demo.yaml
dest: /
mode: 0700
- name: Apply Kuberntes Dashboard Manifest
command: kubectl create -f ./kubernetes-dashboard-demo.yaml
- import_tasks: ./ansible_tasks/print_cluster_ip.yml