-
Notifications
You must be signed in to change notification settings - Fork 34
Support additional nodegroups #704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sjpb
wants to merge
15
commits into
main
Choose a base branch
from
feat/additional-nodes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4224926
Support fixed IP addresses for control node
priteau d5972b3
Update environments/skeleton/{{cookiecutter.environment}}/tofu/variab…
sjpb 9c3bb96
tf style tweaks
sjpb d3acbe2
update production docs for control_ip_addresses
sjpb bfa66ab
fix control IP address logic
sjpb 9b5ed88
add validation for control_ip_addresses
sjpb ba4941d
Merge branch 'main' into control-ip-addresses
sjpb c97615f
remove fixed IPs from production docs - not standard process
sjpb 1afc5ea
support ip_addresses fo all nodes
sjpb e1b171d
make stackhpc tofu format consistent
sjpb 25af907
add support for additional_nodegroups
sjpb 54809f0
add missing additional nodegroup file
sjpb 87d9914
Merge branch 'main' into feat/additional-nodes
sjpb 998246d
rename additional tf file for consistency
sjpb de86177
support changing security groups for additional nodes
sjpb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
environments/skeleton/{{cookiecutter.environment}}/tofu/additional.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
module "additional" { | ||
source = "./node_group" | ||
|
||
for_each = var.additional_nodegroups | ||
|
||
# must be set for group: | ||
nodes = each.value.nodes | ||
flavor = each.value.flavor | ||
|
||
# always taken from top-level value: | ||
cluster_name = var.cluster_name | ||
cluster_domain_suffix = var.cluster_domain_suffix | ||
key_pair = var.key_pair | ||
environment_root = var.environment_root | ||
|
||
# can be set for group, defaults to top-level value: | ||
image_id = lookup(each.value, "image_id", var.cluster_image_id) | ||
vnic_types = lookup(each.value, "vnic_types", var.vnic_types) | ||
volume_backed_instances = lookup(each.value, "volume_backed_instances", var.volume_backed_instances) | ||
root_volume_size = lookup(each.value, "root_volume_size", var.root_volume_size) | ||
root_volume_type = lookup(each.value, "root_volume_type", var.root_volume_type) | ||
gateway_ip = lookup(each.value, "gateway_ip", var.gateway_ip) | ||
nodename_template = lookup(each.value, "nodename_template", var.cluster_nodename_template) | ||
|
||
# optionally set for group: | ||
networks = concat(var.cluster_networks, lookup(each.value, "extra_networks", [])) | ||
# here null means "use module var default" | ||
extra_volumes = lookup(each.value, "extra_volumes", null) | ||
fip_addresses = lookup(each.value, "fip_addresses", null) | ||
fip_network = lookup(each.value, "fip_network", null) | ||
match_ironic_node = lookup(each.value, "match_ironic_node", null) | ||
availability_zone = lookup(each.value, "availability_zone", null) | ||
ip_addresses = lookup(each.value, "ip_addresses", null) | ||
security_group_ids = lookup(each.value, "security_group_ids", [for o in data.openstack_networking_secgroup_v2.nonlogin: o.id]) | ||
|
||
# can't be set for additional nodes | ||
compute_init_enable = [] | ||
ignore_image_changes = false | ||
|
||
# computed | ||
# not using openstack_compute_instance_v2.control.access_ip_v4 to avoid | ||
# updates to node metadata on deletion/recreation of the control node: | ||
control_address = openstack_networking_port_v2.control[var.cluster_networks[0].network].all_fixed_ips[0] | ||
baremetal_nodes = data.external.baremetal_nodes.result | ||
|
||
# input dict validation: | ||
group_name = each.key | ||
group_keys = keys(each.value) | ||
allowed_keys = [ | ||
"nodes", | ||
"flavor", | ||
"image_id", | ||
"extra_networks", | ||
"vnic_types", | ||
"volume_backed_instances", | ||
"root_volume_size", | ||
"root_volume_type", | ||
"extra_volumes", | ||
"fip_addresses", | ||
"fip_network", | ||
"match_ironic_node", | ||
"availability_zone", | ||
"ip_addresses", | ||
"gateway_ip", | ||
"nodename_template", | ||
"security_group_ids", | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this is exactly as per
tofu/login.tf
, except it has non-login secgroups by default, and those can optionally be overriden.