1
0
Fork 0
This commit is contained in:
Cedric Girard 2020-05-15 14:32:05 +02:00
parent a953776b39
commit cff9f6a262
Signed by: X-dark
GPG key ID: E7D0E125DB9519E4

View file

@ -13,11 +13,35 @@ resource "kubernetes_pod" "web" {
metadata { metadata {
name = "web" name = "web"
namespace = kubernetes_namespace.ns.id namespace = kubernetes_namespace.ns.id
labels = {
app = "webapp"
}
} }
spec { spec {
container { container {
image = "nginx:latest" image = "nginx:latest"
name = "web" name = "web"
port {
container_port = 80
} }
} }
} }
}
resource "kubernetes_service" "web" {
metadata {
name = "web-svc"
namespace = kubernetes_namespace.ns.id
}
spec {
selector = {
app = kubernetes_pod.web.metadata.0.labels.app
}
port {
port = 80
target_port = 80
node_port = 30080
}
type = "NodePort"
}
}