cli: configurable state disk type on OpenStack (#1686)

This commit is contained in:
Malte Poll 2023-04-27 09:08:43 +02:00 committed by GitHub
parent ec1d5e9fb5
commit c11a3f4460
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 60 additions and 35 deletions

View file

@ -169,6 +169,7 @@ module "instance_group_control_plane" {
tags = local.tags
uid = local.uid
disk_size = var.state_disk_size
state_disk_type = var.state_disk_type
availability_zone = var.availability_zone
network_id = openstack_networking_network_v2.vpc_network.id
init_secret_hash = local.initSecretHash
@ -189,6 +190,7 @@ module "instance_group_worker" {
uid = local.uid
security_groups = [openstack_compute_secgroup_v2.vpc_secgroup.id]
disk_size = var.state_disk_size
state_disk_type = var.state_disk_type
availability_zone = var.availability_zone
network_id = openstack_networking_network_v2.vpc_network.id
init_secret_hash = local.initSecretHash

View file

@ -44,6 +44,7 @@ resource "openstack_compute_instance_v2" "instance_group_member" {
source_type = "blank"
destination_type = "volume"
volume_size = var.disk_size
volume_type = var.state_disk_type
boot_index = 1
delete_on_termination = true
}

View file

@ -47,6 +47,11 @@ variable "disk_size" {
description = "Disk size for the nodes, in GiB."
}
variable "state_disk_type" {
type = string
description = "Disk/volume type to be used."
}
variable "availability_zone" {
type = string
description = "The availability zone to deploy the nodes in."

View file

@ -26,6 +26,11 @@ variable "state_disk_size" {
description = "The size of the state disk in GB."
}
variable "state_disk_type" {
type = string
description = "Disk/volume type to be used."
}
variable "availability_zone" {
type = string
description = "The availability zone to deploy the nodes in."

View file

@ -232,6 +232,8 @@ type OpenStackClusterVariables struct {
FlavorID string
// FloatingIPPoolID is the ID of the OpenStack floating IP pool to use for public IPs.
FloatingIPPoolID string
// StateDiskType is the OpenStack disk type to use for the state disk.
StateDiskType string
// ImageURL is the URL of the OpenStack image to use.
ImageURL string
// DirectDownload decides whether to download the image directly from the URL to OpenStack or to upload it from the local machine.
@ -258,6 +260,7 @@ func (v *OpenStackClusterVariables) String() string {
writeLinef(b, "floating_ip_pool_id = %q", v.FloatingIPPoolID)
writeLinef(b, "image_url = %q", v.ImageURL)
writeLinef(b, "direct_download = %t", v.DirectDownload)
writeLinef(b, "state_disk_type = %q", v.StateDiskType)
writeLinef(b, "openstack_user_domain_name = %q", v.OpenstackUserDomainName)
writeLinef(b, "openstack_username = %q", v.OpenstackUsername)
writeLinef(b, "openstack_password = %q", v.OpenstackPassword)