mailhog

by codecentric

Helm chartv5.8.0App v1.0.1Verified publisher

An e-mail testing tool for developers

About this chart

Mailhog

Mailhog is an e-mail testing tool for developers.

TL;DR;

$ helm repo add codecentric https://codecentric.github.io/helm-charts
$ helm install mailhog codecentric/mailhog

Introduction

This chart creates a Mailhog deployment on a Kubernetes cluster using the Helm package manager.

Installing the Chart

To install the chart with the release name mailhog:

$ helm install mailhog codecentric/mailhog

or via GitHub Container Registry:

$ helm install mailhog oci://ghcr.io/codecentric/helm-charts/mailhog --version <version>

The command deploys Mailhog on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the mailhog deployment:

$ helm uninstall mailhog

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Mailhog chart and their default values.

ParameterDescriptionDefault
extraContainersAdditional containers to be added to the application pod[]
image.repositoryDocker image repositorymailhog/mailhog
image.tagDocker image tag whose default is the chart version""
image.pullPolicyDocker image pull policyIfNotPresent
imagePullSecretsDocker image pull secrets[]
auth.enabledSpecifies whether basic authentication is enabled, see Auth.mdfalse
auth.existingSecretIf auth is enabled, uses an existing secret with this name; otherwise a secret is created""
auth.fileNameThe name of the auth fileauth.txt
auth.fileContentsThe contents of the auth file""
affinityNode affinity for pod assignment{}
containerPort.http.nameConfigure the Http name of the Mailhog containerhttp
containerPort.http.portConfigure the Http port of the Mailhog container8025
containerPort.smtp.nameConfigure the Smtp name of the Mailhog containertcp-smtp
containerPort.smtp.portConfigure the Smtp port of the Mailhog container1025
nodeSelectorNode labels for pod assignment{}
podReplicasThe number of pod replicas1
podAnnotationsExtra annotations to add to pod{}
podLabelsExtra labels to add to pod{}
resourcesPod resource requests and limits{}
tolerationsNode taints to tolerate[]
priorityClassNameName of the existing priority class to be used by Mailhog pod, priority class needs to be created beforehand""
livenessProbeThe Liveness Probe to add to pod{ "initialDelaySeconds": 10, "tcpPort": { "port": "1025" }, "timeoutSeconds": 1 }
readinessProbeThe Readiness Probe to add to pod{"tcpPort": { "port": "1025" }
serviceAccount.createSpecifies whether a ServiceAccount should be createdtrue
serviceAccount.nameThe name of the service account to use. If not set and create is true, a name is generated using the fullname template""
serviceAccount.imagePullSecretsImage pull secrets that are attached to the ServiceAccount[]
automountServiceAccountTokenIndicates whether the service account token should be automatically mountedfalse
service.annotationsAnnotations for the service{}
service.clusterIPInternal cluster service IP""
service.externalIPsService external IP addresses[]
service.extraPortsAdditional ports to the service[]
service.loadBalancerIPIP address to assign to load balancer (if supported)""
service.loadBalancerSourceRangesList of IP CIDRs allowed access to load balancer (if supported)[]
service.typeType of service to createClusterIP
service.namedTargetPortUse named target port for servicetrue
service.port.httpHTTP port of service""
service.port.smtpSMTP port of service""
service.nodePort.httpIf service.type is NodePort and this is non-empty, sets the http node port of the service""
service.nodePort.smtpIf service.type is NodePort and this is non-empty, sets the smtp node port of the service""
securityContextPod security context{ runAsUser: 1000, fsGroup: 1000, runAsNonRoot: true }
ingress.enabledIf true, an ingress is createdfalse
ingress.ingressClassNameIf set the created Ingress resource will have this class name. kubernetes.io/ingress.class is deprecatednil
ingress.annotationsAnnotations for the ingress{}
ingress.labelsLabels for the ingress{}
ingress.hostsA list of ingress hosts{ host: mailhog.example.com, paths: [{ path: "/", pathType: Prefix }] }
ingress.tlsA list of IngressTLS items[]
extraEnvAdditional environment variables, see CONFIG.md{}

Upgrading

From chart < 5.0.0

Ingress path definitions are extended to describe path and pathType. Previously only the path was configured. Please adapt your configuration as shown below:

Old:

ingress:
  # ...
  hosts:
    - host: mailhog.example.com
      # Paths for the host
      paths:
        - /

New:

ingress:
  # ...
  hosts:
    - host: mailhog.example.com
      # Paths for the host
      paths:
        - path: /
          pathType: Prefix

This allows to configure specific pathType configurations, e.g. pathType: ImplementationSpecific for GKE Ingress on Google Cloud Platform.

Deploy mailhog with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mailhog on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmailhog is pinned at v5.8.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply