orchestration-tests/k8s-test/services/main.tf

97 lines
1.8 KiB
Terraform
Raw Permalink Normal View History

2022-03-03 22:51:42 +00:00
resource "kubernetes_manifest" "traefik_dashboard" {
manifest = {
apiVersion = "traefik.containo.us/v1alpha1"
2022-04-13 21:01:14 +00:00
kind = "IngressRoute"
2022-03-03 22:51:42 +00:00
metadata = {
2022-04-13 21:01:14 +00:00
name = "public-traefik-dashboard"
2022-03-03 22:51:42 +00:00
namespace = "default"
}
spec = {
2022-04-13 21:01:14 +00:00
entryPoints = ["web"]
2022-03-03 22:51:42 +00:00
routes = [
{
match = "PathPrefix(`/dashboard`) || PathPrefix(`/api`)"
2022-04-13 21:01:14 +00:00
kind = "Rule"
2022-03-03 22:51:42 +00:00
services = [
{
name = "api@internal"
kind = "TraefikService"
},
]
},
]
}
}
}
module "whoami" {
source = "./simple_service"
2022-04-13 21:01:14 +00:00
name = "whoami"
image = "containous/whoami:latest"
2022-03-03 22:51:42 +00:00
expose_ports = [80]
}
module "whoami-ingress" {
source = "./traefik_ingress"
2022-03-04 16:25:42 +00:00
2022-04-13 21:01:14 +00:00
app_name = "whoami"
2022-03-03 22:51:42 +00:00
match_route = "PathPrefix(`/whoami`)"
}
module "whoami2" {
source = "./simple_service"
2022-04-13 21:01:14 +00:00
name = "whoami2"
image = "containous/whoami:latest"
2022-03-03 22:51:42 +00:00
expose_ports = [80]
}
module "whoami2-ingress" {
source = "./traefik_ingress"
2022-03-04 16:25:42 +00:00
2022-04-13 21:01:14 +00:00
app_name = "whoami2"
2022-03-03 22:51:42 +00:00
match_route = "PathPrefix(`/whoami2`)"
}
2022-03-04 16:25:42 +00:00
2022-03-12 18:06:06 +00:00
module "authentik" {
source = "./authentik"
2022-03-04 16:25:42 +00:00
}
2022-03-12 18:06:06 +00:00
# locals {
# blocky_config = file("${path.module}/blocky_config.yml")
# }
#
# resource "helm_release" "blocky" {
# name = "blocky"
# repository = "https://k8s-at-home.com/charts/"
# chart = "blocky"
#
#
# set {
# name = "env.TZ"
# value = "America/Los_Angeles"
# }
#
# set {
# name = "metrics.enabled"
# value = true
# }
#
# set {
# name = "config"
# value = "${local.blocky_config}"
# }
# }
# resource "helm_release" "prom_stack" {
# name = "kube-prom-stack"
# repository = "https://prometheus-community.github.io/helm-charts"
# chart = "kube-prometheus-stack"
#
# set {
# name = "alert_manager.enabled"
# value = false
# }
# }