Skip to content

Commit

Permalink
Kubernetes master config #110
Browse files Browse the repository at this point in the history
Master configuration
  • Loading branch information
tanmaysawaji committed Apr 4, 2022
1 parent 86f9c7e commit 646c5bc
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions kube-cluster/control-plane.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
- hosts: control_plane
become: yes
tasks:
- name: initialize the cluster
shell: kubeadm init --pod-network-cidr=10.0.35.0/24 >> cluster_initialized.txt
args:
chdir: $HOME
creates: cluster_initialized.txt

- name: create .kube directory
become: yes
become_user: ubuntu
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/ubuntu/.kube/config
remote_src: yes
owner: ubuntu

- name: install Pod network
become: yes
become_user: ubuntu
shell: kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml >> pod_network_setup.txt
args:
chdir: $HOME
creates: pod_network_setup.txt

0 comments on commit 646c5bc

Please sign in to comment.