Fix indexing of resources when looping
This commit is contained in:
parent
c6a5d0b608
commit
bb139e7239
4
kube.tf
4
kube.tf
|
@ -11,7 +11,7 @@ resource "openstack_networking_port_v2" "kubeport" {
|
|||
|
||||
resource "openstack_blockstorage_volume_v3" "kubevolume" {
|
||||
count = var.kubesize # size of cluster
|
||||
name = "kube${count.index}-matrix-test-sunet-se-vol"
|
||||
name = "kube${count.index + 1}-matrix-test-sunet-se-vol"
|
||||
description = "OS volume for kubernetes node ${count.index}"
|
||||
size = 30
|
||||
image_id = data.openstack_images_image_v2.ubuntu2204image.id
|
||||
|
@ -20,7 +20,7 @@ resource "openstack_blockstorage_volume_v3" "kubevolume" {
|
|||
|
||||
# Create instances of kubernetes nodes
|
||||
resource "openstack_compute_instance_v2" "kube" {
|
||||
name = "kube${count.index}.matrix-test.sunet.se"
|
||||
name = "kube${count.index + 1}.matrix-test.sunet.se"
|
||||
count = var.kubesize
|
||||
flavor_id = data.openstack_compute_flavor_v2.b2c4r16.id
|
||||
key_pair = data.openstack_compute_keypair_v2.manderssonpub.id
|
||||
|
|
Loading…
Reference in a new issue