Mail out: podLabels per group, and a check of the egress address (K-C7) #25

Merged
jcoffey-dev merged 1 commits from feat/mta-egress into main 2026-11-19 13:41:14 +00:00
Owner

Closes #7.

Outbound mail has to leave from an address with a PTR record that's in SPF. The chart doesn't pick how: the mta group already takes nodeSelector, tolerations and affinity for a node pool with fixed addresses. This adds two things:

  • podLabels on each server group, so an egress gateway (Cilium, Calico) can select the mta pods. Labels the chart sets itself (app.kubernetes.io/, inbuxa.org/, helm.sh/) are refused by the schema.

  • server.egress.expectedAddresses and checkUrl. After each install and upgrade, a post-hook Job asks checkUrl which address it came from. The Job is placed like the mta pods: the same node selector, tolerations, affinity and pod labels, so a gateway that picks them picks it too. It records the answer on the mta Deployment as an event (kubectl get events):

    • Normal EgressAddress when the address is one of the expected ones;
    • Warning EgressMismatch when it isn't;
    • Warning EgressUnknown when the URL gives no address.

    The Job never fails, so it never holds up an install or upgrade. Its token may create events in the namespace and nothing else.

Off unless expectedAddresses is set. It doesn't need a new server, so nothing holds it for rc.32.

Lab: egress-test.sh (inbuxa/inbuxa-k8s-lab) runs all three cases on kind, with an HAProxy echoing the caller's address as the checkUrl. All pass, and so does the sign-in test. 68 chart tests pass, and check.sh passes (kube-linter included).

Closes #7. Outbound mail has to leave from an address with a PTR record that's in SPF. The chart doesn't pick how: the mta group already takes `nodeSelector`, `tolerations` and `affinity` for a node pool with fixed addresses. This adds two things: - **`podLabels` on each server group**, so an egress gateway (Cilium, Calico) can select the mta pods. Labels the chart sets itself (`app.kubernetes.io/`, `inbuxa.org/`, `helm.sh/`) are refused by the schema. - **`server.egress.expectedAddresses` and `checkUrl`.** After each install and upgrade, a post-hook Job asks `checkUrl` which address it came from. The Job is placed like the mta pods: the same node selector, tolerations, affinity and pod labels, so a gateway that picks them picks it too. It records the answer on the mta Deployment as an event (`kubectl get events`): - `Normal EgressAddress` when the address is one of the expected ones; - `Warning EgressMismatch` when it isn't; - `Warning EgressUnknown` when the URL gives no address. The Job never fails, so it never holds up an install or upgrade. Its token may create events in the namespace and nothing else. Off unless `expectedAddresses` is set. It doesn't need a new server, so nothing holds it for rc.32. Lab: `egress-test.sh` (inbuxa/inbuxa-k8s-lab) runs all three cases on kind, with an HAProxy echoing the caller's address as the checkUrl. All pass, and so does the sign-in test. 68 chart tests pass, and `check.sh` passes (kube-linter included).
jcoffey-dev added 1 commit 2026-11-19 06:17:24 +00:00
server.egress.expectedAddresses and checkUrl: after each install and
upgrade a Job placed like the mta pods (node selector, tolerations,
affinity, pod labels) asks which address it leaves from, and records the
answer on the mta Deployment as an event, a Warning when it isn't one of
the expected addresses or can't be learned. It never fails the install.
Its token may create events and nothing else. podLabels on each server
group, for an egress gateway that selects the mta pods.
jcoffey-dev merged commit b2a91a5a19 into main 2026-11-19 13:41:14 +00:00
jcoffey-dev deleted branch feat/mta-egress 2026-11-19 13:41:14 +00:00
Sign in to join this conversation.