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.

67 lines
1.5 KiB

---
- name: Disable SELinux
selinux:
state: disabled
#- name: Disable SELinux again
# shell: setenforce 0
- name: install firewalld
yum:
name: firewalld
state: latest
- name: Start Firewalld
ansible.builtin.systemd:
name: firewalld
state: started
enabled: yes
- name: Allow kube API server
firewalld:
port: 6443/tcp
permanent: yes
state: enabled
- name: enable etcd ports
firewalld:
port: 2379-2380/tcp
permanent: yes
state: enabled
- name: enable etcd ports
firewalld:
port: 10250-10255/tcp
permanent: yes
state: enabled
- name: Add the br_netfilter module
modprobe:
name: br_netfilter
state: present
- name: bridge
shell: "echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables"
- name: Docker Repo
get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docker-ce.repo
- name: Install docker
yum:
name:
- docker-ce-20.10.*
- docker-ce-cli
- containerd.io
state: present
- name: Docker daemon
systemd:
name: docker
enabled: yes
state: started
- name: Add K8s repo
yum_repository:
name: kubernetes
description: K8s Repo
baseurl: https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
gpgcakey: 'https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg'
- name: Install kubeadm
yum:
name: kubeadm
state: present
- name: Enable kubelet
systemd:
name: kubelet
enabled: yes
state: started