[meta] move kuard out of main terraform file

pull/37/head
Alpha Chen 3 years ago
parent 964c858507
commit 6e3894dc2d

@ -0,0 +1,84 @@
resource "kubernetes_deployment" "kuard" {
metadata {
name = "kuard"
}
spec {
selector {
match_labels = {
app = "kuard"
}
}
replicas = 1
template {
metadata {
labels = {
app = "kuard"
}
}
spec {
container {
image = "gcr.io/kuar-demo/kuard-amd64:1"
image_pull_policy = "Always"
name = "kuard"
port {
container_port = 8080
}
}
}
}
}
}
resource "kubernetes_service" "kuard" {
metadata {
name = "kuard"
}
spec {
port {
port = 80
target_port = 8080
protocol = "TCP"
}
selector = {
app = "kuard"
}
}
}
resource "kubernetes_ingress_v1" "kuard" {
metadata {
name = "kuard"
annotations = {
"kubernetes.io/ingress.class" = "nginx"
"cert-manager.io/issuer" = "letsencrypt-prod"
}
}
spec {
tls {
hosts = [
"kuard.${var.domain}"
]
secret_name = "kuard-tls"
}
rule {
host = "kuard.${var.domain}"
http {
path {
path = "/"
path_type = "Prefix"
backend {
service {
name = "kuard"
port {
number = 80
}
}
}
}
}
}
}
}

@ -104,88 +104,3 @@ resource "helm_release" "ingress_nginx" {
chart = "ingress-nginx"
version = "4.0.13"
}
resource "kubernetes_deployment" "kuard" {
metadata {
name = "kuard"
}
spec {
selector {
match_labels = {
app = "kuard"
}
}
replicas = 1
template {
metadata {
labels = {
app = "kuard"
}
}
spec {
container {
image = "gcr.io/kuar-demo/kuard-amd64:1"
image_pull_policy = "Always"
name = "kuard"
port {
container_port = 8080
}
}
}
}
}
}
resource "kubernetes_service" "kuard" {
metadata {
name = "kuard"
}
spec {
port {
port = 80
target_port = 8080
protocol = "TCP"
}
selector = {
app = "kuard"
}
}
}
resource "kubernetes_ingress_v1" "kuard" {
metadata {
name = "kuard"
annotations = {
"kubernetes.io/ingress.class" = "nginx"
"cert-manager.io/issuer" = "letsencrypt-prod"
}
}
spec {
tls {
hosts = [
"kuard.${var.domain}"
]
secret_name = "kuard-tls"
}
rule {
host = "kuard.${var.domain}"
http {
path {
path = "/"
path_type = "Prefix"
backend {
service {
name = "kuard"
port {
number = 80
}
}
}
}
}
}
}
}

Loading…
Cancel
Save