-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathk8s-master.yml
38 lines (30 loc) · 1.34 KB
/
k8s-master.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
---
- name: Install K8S master services
hosts: all
tasks:
- name: General | Load varibles
include_vars:
file: vars.yml
- name: K8S | Install Master | Initialize K8S with kubeadm
shell: kubeadm init --token={{ kubeadm_token }} --apiserver-advertise-address={{ k8s_master_ip }} --pod-network-cidr=10.10.0.0/16
become: true
become_method: sudo
- name: K8S | Install Master | Create .kube directory
file:
path: "{{ lookup('env','HOME') }}/.kube"
state: directory
- name: K8S | Install Master | Copy admin.conf file to /.kube/config
shell: "cp -i /etc/kubernetes/admin.conf {{ lookup('env','HOME') }}/.kube/config"
become: true
become_method: sudo
- name: K8S | Install Master | Change ownership on /.kube/config
file:
path: "{{ lookup('env','HOME') }}/.kube/config"
owner: vagrant
group: vagrant
become: true
become_method: sudo
- name: K8S | Install Master | Install pod network
shell: kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/rbac-kdd.yaml
- name: K8S | Install Master | Install pod network
shell: kubectl apply -f https://docs.projectcalico.org/v3.3/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml