separating game and admin service node pools with pods and what not
This commit is contained in:
parent
ac11487feb
commit
f2c4506245
@ -1,4 +1,5 @@
|
||||
resource kubernetes_namespace admin-servers {
|
||||
count = length(var.admin_services.configs) > 0 ? 1 : 0
|
||||
metadata {
|
||||
name = var.admin_services.namespace
|
||||
}
|
||||
@ -15,6 +16,9 @@ resource kubernetes_pod admin {
|
||||
}
|
||||
}
|
||||
spec {
|
||||
node_selector = {
|
||||
NodeType = var.admin_services.namespace
|
||||
}
|
||||
container {
|
||||
image = each.value.image
|
||||
name = coalesce(each.value.name, each.key)
|
||||
|
@ -6,15 +6,25 @@ resource vultr_kubernetes athens {
|
||||
# once the cluster is up, we should comment this out again
|
||||
# enable_firewall = true
|
||||
node_pools {
|
||||
# how many nodes do we want in this pool
|
||||
node_quantity = 1
|
||||
plan = var.cluster.metapool.plan
|
||||
label = var.cluster.label
|
||||
min_nodes = var.cluster.metapool.min
|
||||
max_nodes = var.cluster.metapool.max
|
||||
plan = var.cluster.pools["meta"].plan
|
||||
label = var.admin_services.namespace
|
||||
min_nodes = var.cluster.pools["meta"].min
|
||||
max_nodes = var.cluster.pools["meta"].max
|
||||
# tag = var.admin_services.namespace
|
||||
}
|
||||
}
|
||||
|
||||
resource vultr_kubernetes_node_pools games {
|
||||
cluster_id = vultr_kubernetes.athens.id
|
||||
node_quantity = var.cluster.pools["games"].min
|
||||
plan = var.cluster.pools["games"].plan
|
||||
label = var.game_servers.namespace
|
||||
min_nodes = var.cluster.pools["games"].min
|
||||
max_nodes = var.cluster.pools["games"].max
|
||||
tag = var.admin_services.namespace
|
||||
}
|
||||
|
||||
output k8s_config {
|
||||
value = vultr_kubernetes.athens.kube_config
|
||||
sensitive = true
|
||||
|
@ -1,4 +1,5 @@
|
||||
resource kubernetes_namespace game-servers {
|
||||
count = length(var.game_servers.configs) > 0 ? 1 : 0
|
||||
metadata {
|
||||
name = var.game_servers.namespace
|
||||
}
|
||||
|
@ -25,12 +25,12 @@ variable cluster {
|
||||
region = string
|
||||
label = string
|
||||
version = string
|
||||
metapool = object({
|
||||
pools = map(object({
|
||||
plan = string
|
||||
autoscale = bool
|
||||
min = number
|
||||
max = number
|
||||
})
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
@ -38,17 +38,16 @@ variable game_servers {
|
||||
type = object({
|
||||
namespace = string
|
||||
configs = map(object({
|
||||
name = optional(string)
|
||||
image = string
|
||||
cpu = string
|
||||
mem = string
|
||||
port = object({
|
||||
internal = number
|
||||
expose = number
|
||||
})
|
||||
proto = optional(string)
|
||||
name = optional(string)
|
||||
image = string
|
||||
cpu = string
|
||||
mem = string
|
||||
port = object({
|
||||
internal = number
|
||||
expose = number
|
||||
})
|
||||
)
|
||||
proto = optional(string)
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2,11 +2,19 @@ cluster = {
|
||||
region = "lax"
|
||||
label = "athens-cluster"
|
||||
version = "v1.31.2+1"
|
||||
metapool = {
|
||||
plan = "vc2-1c-2gb"
|
||||
autoscale = true
|
||||
min = 1
|
||||
max = 2
|
||||
pools = {
|
||||
meta = {
|
||||
plan = "vc2-1c-2gb"
|
||||
autoscale = true
|
||||
min = 1
|
||||
max = 2
|
||||
}
|
||||
games = {
|
||||
plan = "vc2-1c-2gb"
|
||||
autoscale = true
|
||||
min = 1
|
||||
max = 3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,16 +36,16 @@ game_servers = {
|
||||
admin_services = {
|
||||
namespace = "admin-services"
|
||||
configs = {
|
||||
health = {
|
||||
image = "nginx:latest"
|
||||
name = "health"
|
||||
cpu = "200m"
|
||||
mem = "64Mi"
|
||||
port = {
|
||||
notes = "Basic nginx sanity check service"
|
||||
expose = 30800
|
||||
internal = 80
|
||||
}
|
||||
}
|
||||
# health = {
|
||||
# image = "nginx:latest"
|
||||
# name = "health"
|
||||
# cpu = "200m"
|
||||
# mem = "64Mi"
|
||||
# port = {
|
||||
# notes = "Basic nginx sanity check service"
|
||||
# expose = 30800
|
||||
# internal = 80
|
||||
# }
|
||||
# }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user