diff --git a/core/database.tf b/core/database.tf index 8469323..cdcf4cd 100644 --- a/core/database.tf +++ b/core/database.tf @@ -96,7 +96,7 @@ resource "kubernetes_deployment_v1" "database-automatic" { name = "${each.key}-db-backup" host_path { - path = join("/", [var.storage_path.fast_access,"Backup", coalesce(each.value.namespace, each.value.connected_namespace, each.key), "${each.key}-db-backup"]) + path = join("/", [var.storage_path.fast_access, "Backup", coalesce(each.value.namespace, each.value.connected_namespace, each.key), "${each.key}-db-backup"]) } } } diff --git a/core/deployment.tf b/core/deployment.tf index ce3e0f7..ab4f851 100644 --- a/core/deployment.tf +++ b/core/deployment.tf @@ -198,7 +198,7 @@ resource "kubernetes_deployment_v1" "automatic" { name = "${each.key}-db-backup" host_path { - path = join("/", [var.storage_path.fast_access,"Backup", coalesce(each.value.namespace, each.value.connected_namespace, each.key), "${each.key}-db-backup"]) + path = join("/", [var.storage_path.fast_access, "Backup", coalesce(each.value.namespace, each.value.connected_namespace, each.key), "${each.key}-db-backup"]) } } } diff --git a/core/ingress.tf b/core/ingress.tf new file mode 100644 index 0000000..5cbfcf0 --- /dev/null +++ b/core/ingress.tf @@ -0,0 +1,37 @@ +#install traffei9k + +/*helm repo add traefik https://traefik.github.io/charts +helm repo update + +helm install traefik traefik/traefik \ +--namespace traefik \ +--create-namespace \ +--set ports.web.nodePort=80 \ +--set ports.websecure.nodePort=443 \ +--set service.type=NodePort +*/ + + + +resource "helm_release" "nginx_ingress" { + name = "traefik" + repository = "https://traefik.github.io/charts" + chart = "traefik" + version = "v41.7.1" + namespace = "traefik" + set = [ + { + name = "ports.web.nodePort" + value = "80" + }, + { + name = "ports.websecure.nodePort" + value = "443" + }, + { + name = "service.type" + value = "NodePort" + } + + ] +} \ No newline at end of file diff --git a/core/module.tf b/core/module.tf index 282ffbc..4032506 100644 --- a/core/module.tf +++ b/core/module.tf @@ -15,6 +15,11 @@ provider "kubernetes" { provider "docker" { host = "unix:///var/run/docker.sock" } +provider "helm" { + kubernetes = { + config_path = "~/.kube/config" + } +} variable "kubernetes" { type = map(object({ diff --git a/core/variables.auto.tfvars b/core/variables.auto.tfvars index de2cee0..9ceb929 100644 --- a/core/variables.auto.tfvars +++ b/core/variables.auto.tfvars @@ -11,7 +11,7 @@ kubernetes = { #requires to run the reverse proxy terraform with the kubernetes enabled mount_path = "/etc/nginx/conf.d/" host_path = "/data/kubernetes/reverse-proxy/reverse-proxy-sites" - config_map = sites-terraform + #config_map = sites-terraform } reverse-proxy-log = {