mirror of
https://codeberg.org/27/inception-of-things.git
synced 2025-10-14 02:54:45 +02:00
「🏗️」 wip: work in progress, not done yet.
This commit is contained in:
23
p1/roles/master/tasks/main.yml
Normal file
23
p1/roles/master/tasks/main.yml
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
|
||||
- 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"
|
Reference in New Issue
Block a user