-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontrol-plane.yaml
41 lines (36 loc) · 1.25 KB
/
control-plane.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
---
- hosts: control_plane
become: yes
tasks:
- name: initialize the cluster
shell: kubeadm init --pod-network-cidr=192.168.0.0/16 >> cluster_initialized.txt
args:
chdir: $HOME
creates: cluster_initialized.txt
- name: create .kube directory
become: yes
file:
path: $HOME/.kube
state: directory
mode: 0755
- name: copy admin.conf to user's kube config
copy:
src: /etc/kubernetes/admin.conf
dest: $HOME/.kube/config
remote_src: yes
- name: download calico operator yaml
get_url:
url: https://raw.githubusercontent.com/projectcalico/calico/v3.28.2/manifests/tigera-operator.yaml
dest: $HOME/tigera-operator.yaml
mode: "0766"
force: true
- name: install calico operator
shell: kubectl create --validate=false -f $HOME/tigra-operator.yaml > pod_network_setup_operator.txt
args:
chdir: $HOME
creates: pod_network_setup_operator.txt
- name: install calico crds
shell: kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.2/manifests/custom-resources.yaml > pod_network_setup_crds.txt
args:
chdir: $HOME
creates: pod_network_setup_crds.txt