Add cert checker module: implement Kubernetes resources, certificate validation logic, and deployment restart functionality
This commit is contained in:
@@ -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" {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user