blob: 003bd4f821e18ec955b97e7760d3f00494a5c932 [file] [log] [blame]
Matthias Andreas Benkard6f77fad2021-01-02 13:14:07 +01001= Mailcow on Kubernetes
2Matthias Andreas Benkard
3:experimental:
4:data-uri:
5:sectnums:
6:toc:
7:stem:
8:toclevels: 2
9:icons: font
10:source-highlighter: prettify
11
12== Description
13
14This directory contains a distribution of https://mailcow.github.io/mailcow-dockerized-docs/[*Mailcow*]
15that you can run in a https://matthias.benkard.de/posts/814[*Kata container*] as part of a *Kubernetes cluster*.
16
17The main artifact provided is a Docker image, meant to run in a Kata container, which embeds its own
18https://www.docker.com[Docker daemon] and copies of https://docs.docker.com/compose/[docker-compose] and a very slightly patched
19https://github.com/mailcow/mailcow-dockerized/[mailcow-dockerized].
20
21== Usage
22
23=== Building the Docker image
24
25The main Docker image that you can run in the cluster is defined in link:default.nix[].
26To build it, you can either go through the regular procedure of
27https://nixos.org/guides/building-and-running-docker-images.html[building Docker images with Nix]
28or make use of the top-level link:../Makefile[Makefile]:
29
30[source,shell script]
31----
32make mailcow.load
33----
34
35After building and loading the image, push it to the registry of your choice.
36
37=== Deploying to Kubernetes
38
39First, create a *configuration file* as explained in the https://mailcow.github.io/mailcow-dockerized-docs/i_u_m_install/[Mailcow installation howto] and deploy the configuration as a *Kubernetes secret*:
40
41[source,shell script]
42----
43kubectl create secret generic mailcow-secrets \
44 --from-file=mailcow.conf=src/mailcow-dockerized/mailcow.conf
45----
46
47You can then use the provided link:mailcow.yaml[] file to perform the *deployment*.
48Be sure to change the *image name* to the image you built above.
49You probably also want to adjust the *namespace* unless a namespace named `mulk` makes sense to you.
50
51=== Updating Mailcow
52
Matthias Andreas Benkard92bb80e2021-01-02 15:56:52 +010053Updating should usually be as easy as *synchronizing* the link:src/mailcow-dockerized/[] subrepo with *upstream* and then <<Building the Docker image,rebuilding the image>>.
Matthias Andreas Benkard6f77fad2021-01-02 13:14:07 +010054
Matthias Andreas Benkard92bb80e2021-01-02 15:56:52 +010055To synchronize the subrepo, use https://github.com/ingydotnet/git-subrepo[`git subrepo`]:
Matthias Andreas Benkard6f77fad2021-01-02 13:14:07 +010056
57[source,shell script]
58----
Matthias Andreas Benkard92bb80e2021-01-02 15:56:52 +010059git subrepo pull mailcow/src/mailcow-dockerized
Matthias Andreas Benkard6f77fad2021-01-02 13:14:07 +010060----