Exposing sample 'game' port correctly now
This commit is contained in:
parent
5d03f6b218
commit
f9c73b1e4a
@ -15,5 +15,5 @@ resource vultr_firewall_rule game-server-inbound {
|
||||
ip_type = "v4"
|
||||
subnet = "0.0.0.0"
|
||||
subnet_size = 0
|
||||
port = each.value.port
|
||||
port = each.value.port.expose
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ resource kubernetes_pod game {
|
||||
}
|
||||
}
|
||||
port {
|
||||
container_port = each.value.port
|
||||
container_port = each.value.port.internal
|
||||
protocol = coalesce(each.value.proto, "TCP")
|
||||
}
|
||||
}
|
||||
@ -37,15 +37,17 @@ resource kubernetes_service game {
|
||||
metadata {
|
||||
name = each.key
|
||||
namespace = var.game_servers.namespace
|
||||
labels = {
|
||||
app = each.key
|
||||
}
|
||||
}
|
||||
spec {
|
||||
selector = {
|
||||
app = each.key
|
||||
}
|
||||
port {
|
||||
target_port = each.value.port
|
||||
port = each.value.port
|
||||
node_port = each.value.port
|
||||
target_port = each.value.port.internal
|
||||
port = each.value.port.expose
|
||||
}
|
||||
type = "NodePort"
|
||||
}
|
||||
|
@ -42,7 +42,10 @@ variable game_servers {
|
||||
image = string
|
||||
cpu = string
|
||||
mem = string
|
||||
port = number
|
||||
port = object({
|
||||
internal = number
|
||||
expose = number
|
||||
})
|
||||
proto = optional(string)
|
||||
})
|
||||
)
|
||||
|
@ -17,7 +17,10 @@ game_servers = {
|
||||
image = "nginx:latest"
|
||||
cpu = "200m"
|
||||
mem = "64Mi"
|
||||
port = 30808
|
||||
port = {
|
||||
expose = 30808
|
||||
internal = 80
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user