Ansible scripts to deploy a K8s cluster on a Proxmox node.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.0 KiB

---
- name: Init cluster
shell: kubeadm init --pod-network-cidr=10.10.0.0/16 --ignore-preflight-errors=all
- name: Get kube-router
get_url:
url: https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter-all-features.yaml
dest: /tmp/kubeadm-kuberouter-all-features.yaml
- name: Install python
yum:
name:
- python3
- python3-pip
state: present
- name: Install kubernetes python package
pip:
name:
- kubernetes==11.0
- openshift
- name: Apply Kube-router
k8s:
state: present
kubeconfig: /etc/kubernetes/admin.conf
src: /tmp/kubeadm-kuberouter-all-features.yaml
- name: Remove kube-proxy
k8s:
name: kube-proxy
kind: DaemonSet
namespace: kube-system
state: absent
- name: Get join token
command: kubeadm token create --print-join-command
register: found_join_token
retries: 30
delay: 5
until: found_join_token.rc == 0
become: true
- name: Save join token
set_fact:
k8s_join_token: "{{ found_join_token.stdout }}"