Skip to content

Commit efe0896

Browse files
authored
Merge pull request docker-mailserver#179 from docker-mailserver/docs/ports-revision-k3s
docs: README - Update ports section
2 parents dd4327b + 85257ce commit efe0896

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

charts/docker-mailserver/README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ The chart will then automatically copy the certificate and private key to the `/
205205

206206
## Ports
207207

208-
If you are running on a bare-metal Kubernetes cluster, you will have to expose ports to the internet to receive and send emails. In addition, you need to make sure that `docker-mailserver`` receives the correct client IP address so that spam filtering works.
208+
If you are running on a bare-metal Kubernetes cluster, you will have to expose ports to the internet to receive and send emails. In addition, you need to make sure that `docker-mailserver` receives the correct client IP address so that spam filtering works.
209209

210-
This can get a bit complicated, as explained in the `docker-mailserver` [documentation](https://docker-mailserver.github.io/docker-mailserver/latest/config/advanced/kubernetes/#exposing-your-mail-server-to-the-outside-world).
210+
This can get a bit complicated, as explained in the `docker-mailserver` [documentation][dms-docs::k8s::network-config].
211211

212-
One approach to preserving the client IP address is to use the PROXY protocol, which is explained in the [documentation](https://docker-mailserver.github.io/docker-mailserver/latest/config/advanced/kubernetes/#proxy-port-to-service-via-proxy-protocol).
212+
One approach to preserving the client IP address is to [use the PROXY protocol][dms-docs::k8s::proxy-protocol].
213213

214-
The Helm chart supports the use of the proxy protocol via the `proxyProtocol` key. By default `proxyProtocol.enable` is true, and `trustedNetworks` is set to the private IP network ranges, as are typically used inside a cluster. Additionally, you will need to enable the proxyProtocol for your loadbalancer. If you are using a cloud service they will most likely have documentation on how to do this for their loadbalancer. If you are using k3s then this is currently impossible with the default components.
214+
The Helm chart supports the use of the proxy protocol via the `proxyProtocol` key. By default `proxyProtocol.enable` is true, and `trustedNetworks` is set to the private IP network ranges, as are typically used inside a cluster.
215215

216216
```yaml
217217
proxyProtocol:
@@ -220,7 +220,11 @@ proxyProtocol:
220220
trustedNetworks: "10.0.0.0/8 192.168.0.0/16 172.16.0.0/12"
221221
```
222222

223-
For security, you should narrow this to the actual range of IP addresses used by your ingress controller pods, and be certain to exclude any IP ranges gatewayed from IPv6 to v4 or vice versa.
223+
Additionally, you will need to enable `proxyProtocol` for your loadbalancer.
224+
- If you are using a cloud service they will most likely have documentation on how to do this for their loadbalancer.
225+
- If you are using k3s then this is [currently impossible][k3s-klipperlb-pp] with the default components.
226+
227+
For security, you should narrow `trustedNetworks` to the actual range of IP addresses used by your ingress controller pods, and be certain to exclude any IP ranges gatewayed from IPv6 to v4 or vice versa.
224228
Also note that any compromised container in the cluster could use the PROXY protocol to evade some security measures, so set a `NetworkPolicy` that only allows the appropriate pods to connect to the DMS pod.
225229

226230
Enabling the PROXY protocol will create an additional port for each protocol (by adding 10,000 to the standard port value) that is configured to understand the PROXY protocol. Thus:
@@ -237,6 +241,10 @@ Enabling the PROXY protocol will create an additional port for each protocol (by
237241

238242
If you do not enable the PROXY protocol and your mail server is not exposed using a load-balancer service with an external traffic policy in "Local" mode, then all incoming mail traffic will look like it comes from a local Kubernetes cluster IP.
239243

244+
[dms-docs::k8s::network-config]: https://docker-mailserver.github.io/docker-mailserver/latest/config/advanced/kubernetes/#exposing-your-mail-server-to-the-outside-world
245+
[dms-docs::k8s::proxy-protocol]: https://docker-mailserver.github.io/docker-mailserver/latest/config/advanced/kubernetes/#proxy-port-to-service-via-proxy-protocol
246+
[k3s-klipperlb-pp]: https://github.com/docker-mailserver/docker-mailserver-helm/issues/176#issuecomment-3097915161
247+
240248
## Persistence
241249

242250
Docker-mailserver assumes there are [four](https://docker-mailserver.github.io/docker-mailserver/latest/config/advanced/optional-config/#volumes) mounted volumes:

0 commit comments

Comments
 (0)