Added basic setup for master and certification material
This commit is contained in:
34
k8s_master.yml
Normal file
34
k8s_master.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
- name: Get Calico Definition
|
||||
get_url:
|
||||
url: https://docs.projectcalico.org/manifests/calico.yaml
|
||||
dest: /tmp/calico.yml
|
||||
delegate_to: k8s-master
|
||||
run_once: true
|
||||
|
||||
- name: Copy kubeadm-crio.yaml to k8s-master
|
||||
ansible.builtin.copy:
|
||||
src: "files/{{ item }}"
|
||||
dest: "/root/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
loop:
|
||||
- "kubeadm-crio.yaml"
|
||||
- "kubeadm-config.yaml"
|
||||
delegate_to: k8s-master
|
||||
run_once: true
|
||||
|
||||
- name: Init Cluster
|
||||
shell: >
|
||||
kubeadm init --config=/root/kubeadm-config.yaml --upload-certs | tee kubeadm-init.out
|
||||
register: kubeadm_init
|
||||
delegate_to: k8s-master
|
||||
run_once: true
|
||||
|
||||
- debug:
|
||||
msg: "{{ kubeadm_init.stdout }}"
|
||||
run_once: true
|
||||
|
||||
- name: enable Calico
|
||||
shell: kubectl apply -f /tmp/calico.yaml
|
||||
|
||||
Reference in New Issue
Block a user