Compare commits
2 commits
f691ae99e6
...
8025cb5cc8
Author | SHA1 | Date | |
---|---|---|---|
Magnus Andersson | 8025cb5cc8 | ||
Magnus Andersson | b90a4b9a36 |
46
IaC-test/mgmt.tf
Normal file
46
IaC-test/mgmt.tf
Normal file
|
@ -0,0 +1,46 @@
|
|||
|
||||
# Netowrk port
|
||||
resource "openstack_networking_port_v2" "mgmt1-port-dco" {
|
||||
name = "mgmt1-${replace(var.dns_suffix,".","-")}-${local.dcodc}-port"
|
||||
network_id = data.openstack_networking_network_v2.public-dco.id
|
||||
# A list of security group ID
|
||||
security_group_ids = [
|
||||
resource.openstack_networking_secgroup_v2.ssh-from-jump-hosts-dco.id
|
||||
]
|
||||
admin_state_up = "true"
|
||||
provider = openstack.dco
|
||||
}
|
||||
|
||||
# Boot volume
|
||||
# Boot volume for node
|
||||
resource "openstack_blockstorage_volume_v3" "mgmt1volumeboot-dco" {
|
||||
name = "mgmt1-${replace(var.dns_suffix,".","-")}-${local.dcodc}-vol"
|
||||
description = "OS volume for mgmt1.matrix.test.sunet.se"
|
||||
size = 50
|
||||
image_id = data.openstack_images_image_v2.debian12image-dco.id
|
||||
enable_online_resize = true # Allow us to resize volume while attached.
|
||||
provider = openstack.dco
|
||||
}
|
||||
|
||||
resource "openstack_compute_instance_v2" "mgmt1-node-dco" {
|
||||
name = "mgmt1.${var.dns_suffix}"
|
||||
flavor_name = "${var.lb_instance_type}"
|
||||
key_pair = "${var.keynameworkers}"
|
||||
provider = openstack.dco
|
||||
security_groups = [
|
||||
resource.openstack_networking_secgroup_v2.ssh-from-jump-hosts-dco.name
|
||||
]
|
||||
|
||||
block_device {
|
||||
uuid = resource.openstack_blockstorage_volume_v3.mgmt1volumeboot-dco.id
|
||||
source_type = "volume"
|
||||
destination_type = "volume"
|
||||
boot_index = 0
|
||||
}
|
||||
|
||||
network {
|
||||
port = resource.openstack_networking_port_v2.mgmt1-port-dco.id
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ variable "cloudsto4_name" {
|
|||
|
||||
variable "keyname" {
|
||||
type = string
|
||||
default = "manderssonpub"
|
||||
default = "manderssonpub3"
|
||||
}
|
||||
variable "keynameworkers" {
|
||||
type = string
|
||||
|
@ -64,6 +64,10 @@ variable "lb_instance_type" {
|
|||
default = "b2.c2r4"
|
||||
}
|
||||
|
||||
variable "mgmt_instance_type" {
|
||||
default = "b2.c2r4"
|
||||
}
|
||||
|
||||
variable "worker_name" {
|
||||
default = "k8sw"
|
||||
}
|
||||
|
|
|
@ -64,5 +64,7 @@
|
|||
- 89.47.190.86 k8sw1
|
||||
- 89.47.190.135 k8sw2
|
||||
- 89.47.191.12 k8sw3
|
||||
'^lb1\.matrix\.test\.sunet\.se$':
|
||||
'^lb[1-9]\.matrix\.test\.sunet\.se$':
|
||||
matrix::lb:
|
||||
'^mgmt[1-9]\.matrix\.test\.sunet\.se$':
|
||||
matrix::podmanhost:
|
||||
|
|
Loading…
Reference in a new issue