-
Notifications
You must be signed in to change notification settings - Fork 233
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
Add server groups to OpenStack example #3354
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,11 @@ See the License for the specific language governing permissions and | |
limitations under the License. | ||
*/ | ||
|
||
resource "openstack_compute_servergroup_v2" "control_plane" { | ||
name = "${var.cluster_name}-control_plane" | ||
policies = [var.control_plane_group_policy] | ||
} | ||
|
||
resource "openstack_networking_port_v2" "control_plane" { | ||
count = var.control_plane_vm_count | ||
name = "${var.cluster_name}-control_plane-${count.index}" | ||
|
@@ -37,6 +42,10 @@ resource "openstack_compute_instance_v2" "control_plane" { | |
security_groups = [openstack_networking_secgroup_v2.securitygroup.name] | ||
config_drive = var.config_drive | ||
|
||
scheduler_hints { | ||
group = openstack_compute_servergroup_v2.control_plane.id | ||
} | ||
Comment on lines
+45
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we provide an easy way to disable this? For example, if we can control this with a variable. |
||
|
||
network { | ||
port = element(openstack_networking_port_v2.control_plane[*].id, count.index) | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -88,6 +88,12 @@ variable "control_plane_flavor" { | |||||
type = string | ||||||
} | ||||||
|
||||||
variable "control_plane_group_policy" { | ||||||
description = "OpenStack instance group policy for the control plane nodes. Cannot be changed without recreating VMs!" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We'll document the other part in the changelog. |
||||||
default = "soft-anti-affinity" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we somewhere document supported values and why we recommend |
||||||
type = string | ||||||
} | ||||||
|
||||||
# Worker Node Variables | ||||||
variable "worker_os" { | ||||||
description = "OS to run on worker machines" | ||||||
|
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.
Are policies supported by default on all OpenStack installations or does it require policies to be explicitly enabled and created?