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
1 changed files with 24 additions and 0 deletions

View File

@ -13,11 +13,35 @@ resource "kubernetes_pod" "web" {
metadata {
name = "web"
namespace = kubernetes_namespace.ns.id
labels = {
app = "webapp"
}
}
spec {
container {
image = "nginx:latest"
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"
}
}