1
0

kubeadm init

This commit is contained in:
michael 2022-10-31 03:01:23 +13:00
parent 7662f4a11f
commit 37da64cacf
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,2 @@
---
k8s_control_master_node: kube01.balsillie.net

View File

@ -19,4 +19,28 @@
regexp: '^(.*)SystemdCgroup = false$' regexp: '^(.*)SystemdCgroup = false$'
line: ' SystemdCgroup = true' line: ' SystemdCgroup = true'
backrefs: true backrefs: true
state: present state: present
- name: enable and start containerd service
ansible.builtin.service:
name: containerd
state: restarted
enabled: true
- name: kubeadm init
when: ansible_host == {{ k8s_control_master_node }}
ansible.builtin.shell:
cmd: |
kubeadm init \
--apiserver-advertise-address="" \
--apiserver-cert-extra-sans="" \
--node-name k8s-master \
--pod-network-cidr=192.168.0.0/16
creates: /etc/kubernetes/admin.conf
- name: join remaining nodes
when: ansible_host != {{ k8s_control_master_node }}
ansible.builtin.shell:
cmd: |
creates: