Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion data/data/openstack/bootstrap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,33 @@ data "openstack_compute_flavor_v2" "bootstrap_flavor" {
name = var.flavor_name
}

resource "openstack_blockstorage_volume_v3" "bootstrap_volume" {
name = "${var.cluster_id}-bootstrap"
count = var.root_volume_size == null ? 0 : 1

size = var.root_volume_size
volume_type = var.root_volume_type
image_id = var.base_image_id
}

resource "openstack_compute_instance_v2" "bootstrap" {
name = "${var.cluster_id}-bootstrap"
flavor_id = data.openstack_compute_flavor_v2.bootstrap_flavor.id
image_id = var.base_image_id
image_id = var.root_volume_size == null ? var.base_image_id : null

user_data = var.bootstrap_shim_ignition

dynamic block_device {
for_each = var.root_volume_size == null ? [] : [openstack_blockstorage_volume_v3.bootstrap_volume[0].id]
content {
uuid = block_device.value
source_type = "volume"
boot_index = 0
destination_type = "volume"
delete_on_termination = true
}
}

network {
port = openstack_networking_port_v2.bootstrap_port.id
}
Expand Down
10 changes: 10 additions & 0 deletions data/data/openstack/bootstrap/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,13 @@ variable "cluster_domain" {
variable "master_port_ids" {
type = list(string)
}

variable "root_volume_size" {
type = number
description = "The size of the volume in gigabytes for the root block device."
}

variable "root_volume_type" {
type = string
description = "The type of volume for the root block device."
}
2 changes: 2 additions & 0 deletions data/data/openstack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ module "bootstrap" {
master_sg_id = module.topology.master_sg_id
bootstrap_shim_ignition = var.openstack_bootstrap_shim_ignition
master_port_ids = module.topology.master_port_ids
root_volume_size = var.openstack_master_root_volume_size
root_volume_type = var.openstack_master_root_volume_type
}

module "masters" {
Expand Down
2 changes: 2 additions & 0 deletions docs/user/openstack/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Beyond the [platform-agnostic `install-config.yaml` properties](../customization
* `size` (required integer): Size of the root volume in GB.
* `type` (required string): The volume pool to create the volume from.

**NOTE:** The bootstrap node follows the `type` and `rootVolume` parameters from the `controlPlane` machine pool.

## Examples

Some example `install-config.yaml` are shown below.
Expand Down