You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
1.4 KiB
85 lines
1.4 KiB
3 years ago
|
resource "kubernetes_deployment" "kuard" {
|
||
|
metadata {
|
||
|
name = "kuard"
|
||
|
}
|
||
|
|
||
|
spec {
|
||
|
selector {
|
||
|
match_labels = {
|
||
|
app = "kuard"
|
||
|
}
|
||
|
}
|
||
|
replicas = 1
|
||
|
template {
|
||
|
metadata {
|
||
|
labels = {
|
||
|
app = "kuard"
|
||
|
}
|
||
|
}
|
||
|
spec {
|
||
|
container {
|
||
3 years ago
|
image = "gcr.io/kuar-demo/kuard-amd64:1"
|
||
3 years ago
|
image_pull_policy = "Always"
|
||
3 years ago
|
name = "kuard"
|
||
3 years ago
|
port {
|
||
|
container_port = 8080
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "kubernetes_service" "kuard" {
|
||
|
metadata {
|
||
|
name = "kuard"
|
||
|
}
|
||
|
|
||
|
spec {
|
||
|
port {
|
||
3 years ago
|
port = 80
|
||
3 years ago
|
target_port = 8080
|
||
3 years ago
|
protocol = "TCP"
|
||
3 years ago
|
}
|
||
|
selector = {
|
||
|
app = "kuard"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "kubernetes_ingress_v1" "kuard" {
|
||
|
metadata {
|
||
|
name = "kuard"
|
||
|
annotations = {
|
||
3 years ago
|
"kubernetes.io/ingress.class" = "nginx"
|
||
|
"cert-manager.io/cluster-issuer" = "letsencrypt-prod"
|
||
3 years ago
|
}
|
||
|
}
|
||
|
|
||
|
spec {
|
||
|
tls {
|
||
|
hosts = [
|
||
|
"kuard.${var.domain}"
|
||
|
]
|
||
|
secret_name = "kuard-tls"
|
||
|
}
|
||
|
rule {
|
||
|
host = "kuard.${var.domain}"
|
||
|
http {
|
||
|
path {
|
||
3 years ago
|
path = "/"
|
||
3 years ago
|
path_type = "Prefix"
|
||
|
backend {
|
||
|
service {
|
||
|
name = "kuard"
|
||
|
port {
|
||
|
number = 80
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|