clincha-org / clincha

Configuration and monitoring of clinch-home infrastructure
https://clinch-home.com
1 stars 1 forks source link

Kubernetes firewalld rules in Ansible #88

Closed clincha closed 1 year ago

clincha commented 1 year ago

As a cluster administrator, I want to deploy a cluster on a system that has firewalld installed, so that I can keep my nodes as secure as possible

clincha commented 1 year ago

https://docs.ansible.com/ansible/latest/collections/ansible/posix/firewalld_module.html

Master node

$ sudo firewall-cmd --permanent --add-port=6443/tcp
$ sudo firewall-cmd --permanent --add-port=2379-2380/tcp
$ sudo firewall-cmd --permanent --add-port=10250/tcp
$ sudo firewall-cmd --permanent --add-port=10251/tcp
$ sudo firewall-cmd --permanent --add-port=10252/tcp

Worker node

$ sudo firewall-cmd --permanent --add-port=10250/tcp
$ sudo firewall-cmd --permanent --add-port=30000-32767/tcp
clincha commented 1 year ago

I already wrote the Ansible code for this but it was in the wrong order so the cluster would try to initialise before the rules were in place.