idk loadbalancer works now with cname i guess

This commit is contained in:
shockrah 2024-06-24 23:04:41 -07:00
parent 2df78721e4
commit 3bb611548d

View File

@ -18,46 +18,21 @@ resource kubernetes_pod shockrah {
} }
} }
# Expose the pod above with a simple service
resource kubernetes_service shockrah { resource kubernetes_service shockrah {
metadata { metadata {
name = var.shockrahxyz.name name = var.shockrahxyz.name
namespace = kubernetes_namespace.websites.metadata.0.name namespace = kubernetes_namespace.websites.metadata.0.name
labels = {
app = var.shockrahxyz.name
}
} }
spec { spec {
selector = { selector = {
app = kubernetes_pod.shockrah.metadata.0.labels.app app = kubernetes_pod.shockrah.metadata.0.name
} }
port { port {
port = var.shockrahxyz.port port = 80
target_port = 80
} }
type = "ExternalName" type = "LoadBalancer"
external_name = var.shockrahxyz.dns
} }
} }
resource kubernetes_ingress_v1 shockrah {
metadata {
name = "shockrah"
}
spec {
rule {
http {
path {
path = "/"
backend {
service {
name = var.shockrahxyz.name
port {
number = var.shockrahxyz.port
}
}
}
}
}
}
}
}