mirror of
https://codeberg.org/27/inception-of-things.git
synced 2025-10-14 02:54:45 +02:00
24 lines
902 B
YAML
24 lines
902 B
YAML
---
|
|
|
|
- name: Initialize the Kubernetes cluster using kubeadm
|
|
command: kubeadm init --apiserver-advertise-address="{{ node_ip }}" --apiserver-cert-extra-sans="{{ node_ip }}" --node-name="{{ node_name }}" --pod-network-cidr={{ pod_network }}
|
|
|
|
- name: Setup kubeconfig for vagrant user
|
|
command: "{{ item }}"
|
|
with_items:
|
|
- mkdir -p /home/vagrant/.kube
|
|
- cp -i /etc/kubernetes/admin.conf /home/vagrant/.kube/config
|
|
- chown vagrant:vagrant /home/vagrant/.kube/config
|
|
|
|
- name: Install flannel pod network
|
|
become: false
|
|
command: kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
|
|
|
|
- name: Generate join command
|
|
command: kubeadm token create --print-join-command
|
|
register: join_command
|
|
|
|
- name: Copy join command to local file
|
|
become: false
|
|
local_action: copy content="{{ join_command.stdout_lines[0] }}" dest="./join-command"
|