Add security group to allow access between kubernetes nodes

This commit is contained in:
Magnus Andersson 2024-01-15 09:33:52 +01:00
commit bf97422126
Signed by: mandersson
GPG key ID: 19CB2C58E1F19B16
2 changed files with 41 additions and 0 deletions

7
main.yaml Normal file
View file

@ -0,0 +1,7 @@
---
- name: Matrix Kubernetes IaC Deployment
hosts: localhost
tasks:
- name: Setup securitygroups.
ansible.builtin.include_tasks:
- file: securitygrouptasks.yaml

34
securitygrouptasks.yaml Normal file
View file

@ -0,0 +1,34 @@
---
- name: Create kubenode securitygroup
openstack.cloud.security_group:
state: present
name: kubenode
description: Kubenode security group to allow required traffic between nodes
- name: Create kubenode IPv4 ingress rule
openstack.cloud.security_group_rule:
security_group: kubenode
remote_group: kubenode
ether_type: IPv4
direction: ingress
- name: Create kubenode IPv4 egress rule
openstack.cloud.security_group_rule:
security_group: kubenode
remote_group: kubenode
ether_type: IPv4
direction: egress
- name: Create kubenode IPv6 ingress rule
openstack.cloud.security_group_rule:
security_group: kubenode
remote_group: kubenode
ether_type: IPv6
direction: ingress
- name: Create kubenode IPv6 egress rule
openstack.cloud.security_group_rule:
security_group: kubenode
remote_group: kubenode
ether_type: IPv6
direction: egress