Add cert checker module: implement Kubernetes resources, certificate validation logic, and deployment restart functionality

This commit is contained in:
2025-10-02 16:53:28 +02:00
parent e6a3f3affd
commit a412c96c46
15 changed files with 644 additions and 10 deletions
+13
View File
@@ -88,6 +88,19 @@ locals {
postfix_stunnel_config = file("${path.module}/resources/postfix/stunnel.conf")
postfix_stunnel_config_checksum = sha256(local.postfix_stunnel_config)
deployments = {
"dovecot" = {
service_name = "imap"
service_port = 993
secret_name = "mail-tls"
},
"postfix" = {
service_name = "smtps"
service_port = 465
secret_name = "mail-tls"
}
}
}
data "external" "password_hasher" {
+11 -1
View File
@@ -47,7 +47,17 @@ resource "kubernetes_manifest" "mail_certificate" {
kind = "ClusterIssuer"
}
commonName = "imap.${var.primary_domain}"
dnsNames = flatten([for account in var.email_accounts : ["imap.${account.domain}", "smtp.${account.domain}"]])
dnsNames = flatten([for account in var.email_accounts : [
"imap.${account.domain}",
"smtp.${account.domain}"
]])
}
}
}
module "cert_checker" {
source = "../../utils/cert_checker"
namespace = kubernetes_namespace.mail.metadata[0].name
persistent_folder = local.mail_path
deployments = local.deployments
}