-
Notifications
You must be signed in to change notification settings - Fork 6
/
configure_master_node_antrea.yml
37 lines (30 loc) · 1.29 KB
/
configure_master_node_antrea.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
---
- hosts: kubernetes-master-nodes
vars_files:
- env_variables
tasks:
- name: Pulling images required for setting up a Kubernetes cluster
shell: kubeadm config images pull
- name: Initializing Kubernetes cluster
shell: kubeadm init --apiserver-advertise-address {{ad_addr}} --pod-network-cidr={{cidr_v}} --ignore-preflight-errors=All
register: output
- name: Storing Logs and Generated token for future purpose.
local_action: copy content={{ output.stdout }} dest={{ token_file }}
- name: Generate join command
command: kubeadm token create --print-join-command
register: join_command
- name: Copy join command to local file
local_action: copy content="{{ join_command.stdout_lines[0] }}" dest="./join-command"
- name: Copying required files
shell: |
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
- name: Installing Helm
shell: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
export PATH=$PATH:/usr/local/bin
./get_helm.sh
- name: Install Network Add-on
command: kubectl apply -f https://raw.githubusercontent.com/antrea-io/antrea/main/build/yamls/antrea.yml