From a7394b524ab7e4c0e744ac7582eda2be0c54eb65 Mon Sep 17 00:00:00 2001 From: Magnus Andersson Date: Thu, 11 Jan 2024 15:34:07 +0100 Subject: [PATCH] Create port for kubernetes nodes. --- kube.tf | 11 +++++++++++ network.tf | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 kube.tf diff --git a/kube.tf b/kube.tf new file mode 100644 index 0000000..cd2d128 --- /dev/null +++ b/kube.tf @@ -0,0 +1,11 @@ + +resource "openstack_networking_port_v2" "kubeport" { + name = "kube${count.index + 1}-matrix-test-sunet-se-port" + # We create as many ports as there are instances created + count = ${kubesize} # size of cluster + network_id = data.openstack_networking_network_v2.public.id + # A list of security group ID + #security_group_ids = [resource.openstack_networking_secgroup_v2.sshaccess.id, data.openstack_networking_secgroup_v2.defaultsg.id, resource.openstack_networking_secgroup_v2.pgserver.id ] + admin_state_up = "true" +} + diff --git a/network.tf b/network.tf index 6ea4eff..9d7acb2 100644 --- a/network.tf +++ b/network.tf @@ -1,4 +1,4 @@ -data "openstack_networking_subnet_v2" "public_sub" { - name = "public-v4" # Name of subnet to be used +data "openstack_networking_network_v2" "public" { + name = "public" # Name of network to use. }