feat(mail): enhance mail configuration with getmail and dovecot settings

- Added getmail configuration generation using template files.
- Introduced postfix and dovecot configuration checksums for deployment.
- Created new dovecot configuration file and sieve script for email handling.
- Updated main.tf to utilize local variables for configuration management.
- Removed redundant external password hasher from main.tf.

feat(nginx): improve nginx configuration management

- Centralized nginx configuration into a local variable with checksum.
- Created separate config maps for default website configurations.
- Updated deployment to utilize new configuration structure.

feat(sftpgo): add SFTPGo application deployment

- Introduced SFTPGo with Kubernetes resources including namespace, config maps, and secrets.
- Configured SFTPGo with SMTP settings and AWS credentials.
- Implemented health checks and volume mounts for persistent storage.

refactor(seafile): remove Seafile module

- Deleted Seafile module and associated resources as part of cleanup.
This commit is contained in:
2025-05-05 00:47:36 +02:00
parent 6adbd50c6d
commit e6e85b00f7
60 changed files with 1107 additions and 604 deletions
+3
View File
@@ -2,5 +2,8 @@ locals {
persistent_folder = var.persistent_folder
websites_path = "${local.persistent_folder}/web"
websites = var.websites
nginx_config = file("${path.module}/resources/nginx.conf")
nginx_config_checksum = sha256(local.nginx_config)
}
+29 -5
View File
@@ -48,8 +48,19 @@ resource "kubernetes_config_map" "nginx_config" {
}
data = {
"nginx.conf" = file("${path.module}/resources/nginx/nginx.conf")
"default.conf" = file("${path.module}/resources/nginx/conf.d/default.conf")
"nginx.conf" = local.nginx_config
}
}
resource "kubernetes_config_map" "nginx_default_config" {
for_each = local.websites
metadata {
name = format("website-%s-default", replace(each.key, ".", "-"))
namespace = kubernetes_namespace.website.metadata[0].name
}
data = {
"default.conf" = each.value.config
}
}
@@ -111,6 +122,10 @@ resource "kubernetes_deployment" "website" {
labels = {
app = format("website-%s", replace(each.key, ".", "-"))
}
annotations = {
"checksum/nginx" = local.nginx_config_checksum
"checksum/default" = sha256(each.value.config)
}
}
spec {
service_account_name = kubernetes_service_account.website_service_account.metadata[0].name
@@ -161,13 +176,13 @@ resource "kubernetes_deployment" "website" {
name = "http"
}
volume_mount {
name = "nginx-config"
name = "nginx"
mount_path = "/etc/nginx/nginx.conf"
sub_path = "nginx.conf"
read_only = true
}
volume_mount {
name = "nginx-config"
name = "default"
mount_path = "/etc/nginx/conf.d/default.conf"
sub_path = "default.conf"
read_only = true
@@ -179,11 +194,17 @@ resource "kubernetes_deployment" "website" {
}
}
volume {
name = "nginx-config"
name = "nginx"
config_map {
name = kubernetes_config_map.nginx_config.metadata[0].name
}
}
volume {
name = "default"
config_map {
name = kubernetes_config_map.nginx_default_config[each.key].metadata[0].name
}
}
volume {
name = "website"
host_path {
@@ -193,5 +214,8 @@ resource "kubernetes_deployment" "website" {
}
}
}
lifecycle {
ignore_changes = [spec[0].template[0].metadata[0].annotations["kubectl.kubernetes.io/restartedAt"]]
}
}
@@ -8,7 +8,6 @@ events {
worker_connections 1024;
}
http {
proxy_temp_path /tmp/proxy_temp;
client_body_temp_path /tmp/client_temp;
@@ -29,6 +28,5 @@ http {
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
}
@@ -14,5 +14,6 @@ variable "websites" {
type = map(object({
domain_name = string
fqdn = list(string)
config = optional(string, "")
}))
}