add n8n and disable crowdsec temporarily [ci skip]
This commit is contained in:
parent
578db51fc8
commit
e386ddca96
3 changed files with 155 additions and 6 deletions
3
main.tf
3
main.tf
|
|
@ -99,6 +99,7 @@ variable "cloudflare_tunnel_token" {}
|
||||||
variable "owntracks_credentials" {}
|
variable "owntracks_credentials" {}
|
||||||
variable "dawarich_database_password" {}
|
variable "dawarich_database_password" {}
|
||||||
variable "tandoor_database_password" {}
|
variable "tandoor_database_password" {}
|
||||||
|
variable "n8n_postgresql_password" {}
|
||||||
|
|
||||||
# data "terraform_remote_state" "foo" {
|
# data "terraform_remote_state" "foo" {
|
||||||
# backend = "kubernetes"
|
# backend = "kubernetes"
|
||||||
|
|
@ -410,6 +411,8 @@ module "kubernetes_cluster" {
|
||||||
|
|
||||||
tandoor_database_password = var.tandoor_database_password
|
tandoor_database_password = var.tandoor_database_password
|
||||||
tandoor_email_password = var.mailserver_accounts["info@viktorbarzin.me"]
|
tandoor_email_password = var.mailserver_accounts["info@viktorbarzin.me"]
|
||||||
|
|
||||||
|
n8n_postgresql_password = var.n8n_postgresql_password
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ variable "owntracks_credentials" {}
|
||||||
variable "dawarich_database_password" {}
|
variable "dawarich_database_password" {}
|
||||||
variable "tandoor_database_password" {}
|
variable "tandoor_database_password" {}
|
||||||
variable "tandoor_email_password" {}
|
variable "tandoor_email_password" {}
|
||||||
|
variable "n8n_postgresql_password" {}
|
||||||
|
|
||||||
variable "defcon_level" {
|
variable "defcon_level" {
|
||||||
type = number
|
type = number
|
||||||
|
|
@ -407,12 +408,12 @@ module "nginx-ingress" {
|
||||||
crowdsec_captcha_site_key = var.ingress_crowdsec_captcha_site_key
|
crowdsec_captcha_site_key = var.ingress_crowdsec_captcha_site_key
|
||||||
}
|
}
|
||||||
|
|
||||||
module "crowdsec" {
|
# module "crowdsec" {
|
||||||
source = "./crowdsec"
|
# source = "./crowdsec"
|
||||||
tls_secret_name = var.tls_secret_name
|
# tls_secret_name = var.tls_secret_name
|
||||||
homepage_username = var.homepage_credentials["crowdsec"]["username"]
|
# homepage_username = var.homepage_credentials["crowdsec"]["username"]
|
||||||
homepage_password = var.homepage_credentials["crowdsec"]["password"]
|
# homepage_password = var.homepage_credentials["crowdsec"]["password"]
|
||||||
}
|
# }
|
||||||
|
|
||||||
# Seems like it needs S3 even if pg is local...
|
# Seems like it needs S3 even if pg is local...
|
||||||
# module "resume" {
|
# module "resume" {
|
||||||
|
|
@ -606,3 +607,9 @@ module "tandoor" {
|
||||||
tandoor_database_password = var.tandoor_database_password
|
tandoor_database_password = var.tandoor_database_password
|
||||||
tandoor_email_password = var.tandoor_email_password
|
tandoor_email_password = var.tandoor_email_password
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module "n8n" {
|
||||||
|
source = "./n8n"
|
||||||
|
tls_secret_name = var.tls_secret_name
|
||||||
|
postgresql_password = var.n8n_postgresql_password
|
||||||
|
}
|
||||||
|
|
|
||||||
139
modules/kubernetes/n8n/main.tf
Normal file
139
modules/kubernetes/n8n/main.tf
Normal file
|
|
@ -0,0 +1,139 @@
|
||||||
|
variable "tls_secret_name" {}
|
||||||
|
variable "postgresql_password" {}
|
||||||
|
|
||||||
|
module "tls_secret" {
|
||||||
|
source = "../setup_tls_secret"
|
||||||
|
namespace = "n8n"
|
||||||
|
tls_secret_name = var.tls_secret_name
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "kubernetes_namespace" "immich" {
|
||||||
|
metadata {
|
||||||
|
name = "n8n"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "kubernetes_deployment" "n8n" {
|
||||||
|
metadata {
|
||||||
|
name = "n8n"
|
||||||
|
namespace = "n8n"
|
||||||
|
labels = {
|
||||||
|
app = "n8n"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
replicas = 1
|
||||||
|
selector {
|
||||||
|
match_labels = {
|
||||||
|
app = "n8n"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
template {
|
||||||
|
metadata {
|
||||||
|
labels = {
|
||||||
|
app = "n8n"
|
||||||
|
"kubernetes.io/cluster-service" = "true"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spec {
|
||||||
|
container {
|
||||||
|
name = "n8n"
|
||||||
|
image = "docker.n8n.io/n8nio/n8n"
|
||||||
|
env {
|
||||||
|
name = "DB_TYPE"
|
||||||
|
value = "postgresdb"
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "DB_POSTGRESDB_DATABASE"
|
||||||
|
value = "n8n"
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "DB_POSTGRESDB_HOST"
|
||||||
|
value = "postgresql.dbaas"
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "DB_POSTGRESDB_PORT"
|
||||||
|
value = "5432"
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "DB_POSTGRESDB_USER"
|
||||||
|
value = "n8n"
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "DB_POSTGRESDB_PASSWORD"
|
||||||
|
value = var.postgresql_password
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "GENERIC_TIMEZONE"
|
||||||
|
value = "Europe/Sofia"
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "TZ"
|
||||||
|
value = "Europe/Sofia"
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "DOMAIN_NAME"
|
||||||
|
value = "viktorbarzin.me"
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "DOMAIN_NAME"
|
||||||
|
value = "n8n"
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "N8N_EDITOR_BASE_URL"
|
||||||
|
value = "https://n8n.viktorbarzin.me"
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
name = "WEBHOOK_URL"
|
||||||
|
value = "https://n8n.viktorbarzin.me"
|
||||||
|
}
|
||||||
|
volume_mount {
|
||||||
|
name = "data"
|
||||||
|
mount_path = "/home/node/.n8n"
|
||||||
|
}
|
||||||
|
port {
|
||||||
|
name = "http"
|
||||||
|
container_port = 5678
|
||||||
|
protocol = "TCP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
volume {
|
||||||
|
name = "data"
|
||||||
|
nfs {
|
||||||
|
path = "/mnt/main/n8n"
|
||||||
|
server = "10.0.10.15"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "kubernetes_service" "n8n" {
|
||||||
|
metadata {
|
||||||
|
name = "n8n"
|
||||||
|
namespace = "n8n"
|
||||||
|
labels = {
|
||||||
|
"app" = "n8n"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spec {
|
||||||
|
selector = {
|
||||||
|
app = "n8n"
|
||||||
|
}
|
||||||
|
port {
|
||||||
|
port = "80"
|
||||||
|
target_port = "5678"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module "ingress" {
|
||||||
|
source = "../ingress_factory"
|
||||||
|
namespace = "n8n"
|
||||||
|
name = "n8n"
|
||||||
|
tls_secret_name = var.tls_secret_name
|
||||||
|
extra_annotations = {
|
||||||
|
"nginx.ingress.kubernetes.io/proxy-body-size" : "20000m"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue