java-tutorials/terraform/best-practices/k8s-modules/modules/SvcFeedback/main.tf

69 lines
944 B
Terraform
Raw Normal View History

2020-03-29 10:49:46 -04:00
/*
* SvcFeedback deployment resources
*/
resource "kubernetes_deployment" "SvcFeedback" {
metadata {
name = "svcfeedback"
labels = {
app = "SvcFeedback"
}
}
spec {
replicas = 1
selector {
match_labels = {
app = "SvcFeedback"
}
}
template {
metadata {
labels = {
app = "SvcFeedback"
}
}
spec {
image_pull_secrets {
name = "docker-config"
}
container {
image = "inanimate/echo-server"
name = "svcfeedback-httpd"
env {
name = "PORT"
value = "80"
}
}
}
}
}
}
resource "kubernetes_service" "SvcFeedback" {
metadata {
name = "svcfeedback"
}
spec {
selector = {
app = "SvcFeedback"
}
session_affinity = "ClientIP"
port {
port = 80
}
//type = "LoadBalancer"
}
}