Extend worker node count and create rook volume on workers.
This commit is contained in:
parent
71919802c8
commit
da2d2004dd
|
@ -56,15 +56,10 @@ resource "openstack_compute_instance_v2" "controller-nodes" {
|
|||
# Worker node resources
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Controller node resources
|
||||
#
|
||||
|
||||
resource "openstack_networking_port_v2" "kubewport" {
|
||||
name = "${var.worker_name}${count.index+1}-${replace(var.dns_suffix,".","-")}-port"
|
||||
# We create as many ports as there are instances created
|
||||
count = var.controller_instance_count
|
||||
count = var.worker_instance_count
|
||||
network_id = data.openstack_networking_network_v2.public.id
|
||||
# A list of security group ID
|
||||
security_group_ids = [
|
||||
|
@ -76,7 +71,7 @@ resource "openstack_networking_port_v2" "kubewport" {
|
|||
}
|
||||
|
||||
resource "openstack_blockstorage_volume_v3" "kubewvolumeboot" {
|
||||
count = var.controller_instance_count # size of cluster
|
||||
count = var.worker_instance_count # size of cluster
|
||||
name = "${var.worker_name}${count.index+1}-${replace(var.dns_suffix,".","-")}-vol"
|
||||
description = "OS volume for kubernetes worker node ${count.index + 1}"
|
||||
size = 100
|
||||
|
@ -84,6 +79,14 @@ resource "openstack_blockstorage_volume_v3" "kubewvolumeboot" {
|
|||
enable_online_resize = true # Allow us to resize volume while attached.
|
||||
}
|
||||
|
||||
resource "openstack_blockstorage_volume_v3" "kubewvolumerook" {
|
||||
count = var.worker_instance_count # size of cluster
|
||||
name = "${var.worker_name}${count.index+1}-${replace(var.dns_suffix,".","-")}-rook-vol"
|
||||
description = "Rook storage volume for kubernetes worker node ${count.index + 1}"
|
||||
size = 100
|
||||
enable_online_resize = true # Allow us to resize volume while attached.
|
||||
}
|
||||
|
||||
|
||||
resource "openstack_compute_instance_v2" "worker-nodes" {
|
||||
count = var.worker_instance_count
|
||||
|
@ -102,6 +105,13 @@ resource "openstack_compute_instance_v2" "worker-nodes" {
|
|||
destination_type = "volume"
|
||||
boot_index = 0
|
||||
}
|
||||
block_device {
|
||||
uuid = resource.openstack_blockstorage_volume_v3.kubewvolumerook[count.index].id
|
||||
source_type = "volume"
|
||||
destination_type = "volume"
|
||||
boot_index = 1
|
||||
}
|
||||
|
||||
scheduler_hints {
|
||||
group = openstack_compute_servergroup_v2.workers.id
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ variable "keyname" {
|
|||
}
|
||||
|
||||
variable "worker_instance_count" {
|
||||
default = "3"
|
||||
default = "4"
|
||||
}
|
||||
variable "controller_instance_count" {
|
||||
default = "3"
|
||||
|
|
Loading…
Reference in a new issue