Skip to content

Commit

Permalink
changed mks nat to have a gateway by default; updated vm ports to fix…
Browse files Browse the repository at this point in the history
… vm creation error; updated vm outputs to not include temp outputs
  • Loading branch information
orlov-a committed Jan 24, 2024
1 parent 768e5f3 commit 7965072
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
1 change: 1 addition & 0 deletions modules/mks/k8s-cluster-standalone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module "nat" {
source = "../../nat"
subnet_cidr = var.nat_subnet_cidr
router_name = "${var.cluster_name}-router"
no_gateway = var.no_gateway
}

module "kubernetes_cluster" {
Expand Down
5 changes: 5 additions & 0 deletions modules/mks/k8s-cluster-standalone/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,8 @@ variable "gpu_ng_taints" {
}))
default = []
}

variable "no_gateway" {
type = string
default = false
}
4 changes: 1 addition & 3 deletions modules/vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ module "nat" {
module "network_1" {
source = "../network"

dns_nameservers = var.dns_nameservers
subnet_cidr = var.local_network_1_subnet_cidr
network_name = var.local_network_1_name
}

module "network_2" {
source = "../network"

dns_nameservers = var.dns_nameservers
subnet_cidr = var.local_network_2_subnet_cidr
network_name = var.local_network_2_name
}
Expand Down Expand Up @@ -84,7 +82,7 @@ resource "openstack_compute_instance_v2" "instance_1" {
}

network {
port = openstack_networking_port_v2.port_1.id
port = openstack_networking_port_v2.port_2.id
}

dynamic "block_device" {
Expand Down
24 changes: 6 additions & 18 deletions modules/vm/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
output "nat1_net_id" {
value = module.nat1.network_id
output "nat_net_id" {
value = module.nat.network_id
}

output "nat1_sub_id" {
value = module.nat1.subnet_id
output "nat_sub_id" {
value = module.nat.subnet_id
}

output "vm1_port_id" {
output "vm_port_id" {
value = openstack_networking_port_v2.port_1.id
}

output "nat2_net_id" {
value = module.nat2.network_id
}

output "nat2_sub_id" {
value = module.nat2.subnet_id
}

output "vm2_port_id" {
value = openstack_networking_port_v2.port_2.id
}
}

0 comments on commit 7965072

Please sign in to comment.