Change os from ubuntu to debian and add snap volume

This commit is contained in:
Magnus Andersson 2024-01-12 11:11:10 +01:00
parent 7868e3e751
commit 52095aedd1
Signed by: mandersson
GPG key ID: 19CB2C58E1F19B16

19
kube.tf
View file

@ -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"
}