configurable setup but not working for setup with minecraft rn
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 3s
Secops Linting and Safety Checks / checkov-scan-s3 (push) Failing after 14s

This commit is contained in:
shockrah 2024-12-10 20:02:46 -08:00
parent f9c73b1e4a
commit ad0f3e6089
3 changed files with 8 additions and 68 deletions

View File

@ -28,6 +28,10 @@ resource kubernetes_pod game {
container_port = each.value.port.internal container_port = each.value.port.internal
protocol = coalesce(each.value.proto, "TCP") protocol = coalesce(each.value.proto, "TCP")
} }
env {
name = "EULA"
value = "TRUE"
}
} }
} }
} }

View File

@ -1,64 +0,0 @@
# Here we create a super simple pod that we can reach via IP
# Using nginx as the service to expose
locals {
sanity = {
namespace = "sanity"
service = "web-health"
port = 30808
}
}
resource kubernetes_namespace sanity {
metadata {
name = local.sanity.namespace
}
}
resource kubernetes_pod nginx {
metadata {
name = local.sanity.service
labels = {
app = local.sanity.service
}
}
spec {
container {
image = "nginx:latest"
name = "nginx"
resources {
limits = {
cpu = "200m"
memory = "64Mi"
}
}
liveness_probe {
http_get {
path = "/"
port = 80
}
initial_delay_seconds = 30
period_seconds = 30
}
}
}
}
resource kubernetes_service nginx {
metadata {
name = local.sanity.service
}
spec {
selector = {
app = local.sanity.service
}
port {
port = 8080
target_port = 80
node_port = local.sanity.port
}
type = "NodePort"
}
}

View File

@ -13,10 +13,10 @@ cluster = {
game_servers = { game_servers = {
namespace = "games" namespace = "games"
configs = { configs = {
nginx = { minecraft = {
image = "nginx:latest" image = "itzg/minecraft-server"
cpu = "200m" cpu = "1000m"
mem = "64Mi" mem = "2048Mi"
port = { port = {
expose = 30808 expose = 30808
internal = 80 internal = 80