add authentik [ci skip]

This commit is contained in:
Viktor Barzin 2024-11-12 20:20:10 +00:00
parent 16cd13abc3
commit cb3ec53d41
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
6 changed files with 96 additions and 0 deletions

View file

@ -0,0 +1,64 @@
variable "tls_secret_name" {}
variable "secret_key" {}
variable "postgres_password" {}
module "tls_secret" {
source = "../setup_tls_secret"
namespace = "authentik"
tls_secret_name = var.tls_secret_name
}
resource "kubernetes_namespace" "authentik" {
metadata {
name = "authentik"
}
}
resource "helm_release" "authentik" {
namespace = "authentik"
create_namespace = true
name = "goauthentik"
repository = "https://charts.goauthentik.io/"
chart = "authentik"
version = "2024.10.1"
atomic = true
timeout = 6000
values = [templatefile("${path.module}/values.yaml", { postgres_password = var.postgres_password, secret_key = var.secret_key })]
}
resource "kubernetes_ingress_v1" "authentik" {
metadata {
name = "authentik"
namespace = "authentik"
annotations = {
"kubernetes.io/ingress.class" = "nginx"
}
}
spec {
tls {
hosts = ["authentik.viktorbarzin.me"]
secret_name = var.tls_secret_name
}
rule {
host = "authentik.viktorbarzin.me"
http {
path {
path = "/"
backend {
service {
name = "goauthentik-server"
port {
number = 80
}
}
}
}
}
}
}
}