From 52095aedd12b1179805544e0c824487fa3bad799 Mon Sep 17 00:00:00 2001 From: Magnus Andersson Date: Fri, 12 Jan 2024 11:11:10 +0100 Subject: [PATCH] Change os from ubuntu to debian and add snap volume --- kube.tf | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/kube.tf b/kube.tf index 0e545ce..64441e6 100644 --- a/kube.tf +++ b/kube.tf @@ -9,12 +9,21 @@ resource "openstack_networking_port_v2" "kubeport" { admin_state_up = "true" } -resource "openstack_blockstorage_volume_v3" "kubevolume" { +resource "openstack_blockstorage_volume_v3" "kubevolumeboot" { count = var.kubesize # size of cluster name = "kube${count.index + 1}-matrix-test-sunet-se-vol" description = "OS volume for kubernetes node ${count.index + 1}" size = 30 - image_id = data.openstack_images_image_v2.ubuntu2204image.id + image_id = data.openstack_images_image_v2.debian12image.id + enable_online_resize = true # Allow us to resize volume while attached. +} + +resource "openstack_blockstorage_volume_v3" "kubevolumesnap" { + count = var.kubesize # size of cluster + name = "kube${count.index + 1}-matrix-test-sunet-se-vol" + description = "OS volume for kubernetes node ${count.index + 1}" + size = 50 + image_id = data.openstack_images_image_v2.debian12image.id enable_online_resize = true # Allow us to resize volume while attached. } @@ -30,10 +39,14 @@ resource "openstack_compute_instance_v2" "kube" { port = resource.openstack_networking_port_v2.kubeport[count.index].id } block_device { - uuid = resource.openstack_blockstorage_volume_v3.kubevolume[count.index].id + uuid = resource.openstack_blockstorage_volume_v3.kubevolumeboot[count.index].id source_type = "volume" destination_type = "volume" } + block_device { + uuid = resource.openstack_blockstorage_volume_v3.kubevolumesnap[count.index].id + source_type = "volume" + destination_type = "volume" }