add actualbudget [ci skip]

This commit is contained in:
Viktor Barzin 2024-12-01 13:04:27 +00:00
parent eb94e378c6
commit c06ca9b253
No known key found for this signature in database
GPG key ID: 4056458DBDBF8863
3 changed files with 133 additions and 0 deletions

View file

@ -0,0 +1,128 @@
variable "tls_secret_name" {}
module "tls_secret" {
source = "../setup_tls_secret"
namespace = "actualbudget"
tls_secret_name = var.tls_secret_name
}
resource "kubernetes_namespace" "actualbudget" {
metadata {
name = "actualbudget"
labels = {
"istio-injection" : "disabled"
}
}
}
resource "kubernetes_deployment" "actualbudget" {
metadata {
name = "actualbudget"
namespace = "actualbudget"
labels = {
app = "actualbudget"
}
annotations = {
"reloader.stakater.com/search" = "true"
}
}
spec {
replicas = 1
selector {
match_labels = {
app = "actualbudget"
}
}
template {
metadata {
annotations = {
"diun.enable" = "true"
}
labels = {
app = "actualbudget"
}
}
spec {
container {
image = "actualbudget/actual-server:latest"
name = "actualbudget"
port {
container_port = 5006
}
volume_mount {
name = "data"
mount_path = "/data"
}
}
volume {
name = "data"
nfs {
path = "/mnt/main/actualbudget"
server = "10.0.10.15"
}
}
}
}
}
}
resource "kubernetes_service" "actualbudget" {
metadata {
name = "actualbudget"
namespace = "actualbudget"
labels = {
app = "actualbudget"
}
}
spec {
selector = {
app = "actualbudget"
}
port {
name = "http"
port = 80
target_port = 5006
}
}
}
resource "kubernetes_ingress_v1" "actualbudget" {
metadata {
name = "actualbudget-ingress"
namespace = "actualbudget"
annotations = {
"kubernetes.io/ingress.class" = "nginx"
"nginx.ingress.kubernetes.io/client-max-body-size" : "0"
"nginx.ingress.kubernetes.io/proxy-body-size" : "0",
# "nginx.ingress.kubernetes.io/auth-url" : "https://oauth2.viktorbarzin.me/oauth2/auth"
# "nginx.ingress.kubernetes.io/auth-signin" : "https://oauth2.viktorbarzin.me/oauth2/start?rd=/redirect/$http_host$escaped_request_uri"
}
}
spec {
tls {
hosts = ["budget.viktorbarzin.me"]
secret_name = var.tls_secret_name
}
rule {
host = "budget.viktorbarzin.me"
http {
path {
path = "/"
backend {
service {
name = "actualbudget"
port {
number = 80
}
}
}
}
}
}
}
}

View file

@ -532,3 +532,8 @@ module "linkwarden" {
authentik_client_id = var.linkwarden_authentik_client_id
authentik_client_secret = var.linkwarden_authentik_client_secret
}
module "actualbudget" {
source = "./actualbudget"
tls_secret_name = var.tls_secret_name
}

Binary file not shown.