blob: 003bd4f821e18ec955b97e7760d3f00494a5c932 [file] [log] [blame]
= Mailcow on Kubernetes
Matthias Andreas Benkard
:toclevels: 2
:icons: font
:source-highlighter: prettify
== Description
This directory contains a distribution of[*Mailcow*]
that you can run in a[*Kata container*] as part of a *Kubernetes cluster*.
The main artifact provided is a Docker image, meant to run in a Kata container, which embeds its own[Docker daemon] and copies of[docker-compose] and a very slightly patched[mailcow-dockerized].
== Usage
=== Building the Docker image
The main Docker image that you can run in the cluster is defined in link:default.nix[].
To build it, you can either go through the regular procedure of[building Docker images with Nix]
or make use of the top-level link:../Makefile[Makefile]:
[source,shell script]
make mailcow.load
After building and loading the image, push it to the registry of your choice.
=== Deploying to Kubernetes
First, create a *configuration file* as explained in the[Mailcow installation howto] and deploy the configuration as a *Kubernetes secret*:
[source,shell script]
kubectl create secret generic mailcow-secrets \
You can then use the provided link:mailcow.yaml[] file to perform the *deployment*.
Be sure to change the *image name* to the image you built above.
You probably also want to adjust the *namespace* unless a namespace named `mulk` makes sense to you.
=== Updating Mailcow
Updating should usually be as easy as *synchronizing* the link:src/mailcow-dockerized/[] subrepo with *upstream* and then <<Building the Docker image,rebuilding the image>>.
To synchronize the subrepo, use[`git subrepo`]:
[source,shell script]
git subrepo pull mailcow/src/mailcow-dockerized