Skip to content

Commit a0e9100

Browse files
authored
Merge pull request #44 from thunderbird/install-migration-proxy
Install migration proxy
2 parents dc0a30b + e86a23b commit a0e9100

14 files changed

Lines changed: 147 additions & 132 deletions

File tree

bases/nginx/service.yaml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,10 @@ metadata:
66
name: nginx
77
annotations:
88
argocd.argoproj.io/sync-wave: "2"
9-
# EKS-specific annotations are documented in "Use Service Annotations to configure Network Load Balancers":
10-
# https://docs.aws.amazon.com/eks/latest/userguide/auto-configure-nlb.html
11-
# A full list of annotations supported by the AWS Load Balancer controller can be found here:
12-
# https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/service/annotations/
13-
service.beta.kubernetes.io/aws-load-balancer-name: stalwart-nginx-public
14-
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
15-
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
16-
service.beta.kubernetes.io/aws-load-balancer-attributes: "load_balancing.cross_zone.enabled=true"
17-
18-
# Update the below values in overlays
19-
service.beta.kubernetes.io/aws-load-balancer-subnets: ""
20-
service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: "environment=not_set,project=not_set"
219
spec:
22-
type: LoadBalancer
10+
type: ClusterIP
2311
selector:
24-
# The public load balancer should always route traffic to our internal proxy, which will route
25-
# that traffic internally according to our rules.
2612
app: stalwart-nginx
27-
loadBalancerSourceRanges:
28-
- 0.0.0.0/0
2913
ports:
3014
- name: https
3115
port: 443

bases/stalwart-migration-proxy/aws/security-groups.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ spec:
7979
userIDGroupPairs:
8080
- description: Allow SMTPS service traffic from the proxy load balancer
8181
groupID: "" # Populate with Kustomize
82+
- fromPort: 587
83+
toPort: 587
84+
ipProtocol: tcp
85+
userIDGroupPairs:
86+
- description: Allow SMTP with STARTTLS service traffic from the proxy load balancer
87+
groupID: "" # Populate with Kustomize
8288
- fromPort: 993
8389
toPort: 993
8490
ipProtocol: tcp
@@ -133,6 +139,12 @@ spec:
133139
ipRanges:
134140
- cidrIP: "0.0.0.0/0"
135141
description: "Allow all STMPS ingress"
142+
- fromPort: 587
143+
toPort: 587
144+
ipProtocol: tcp
145+
ipRanges:
146+
- cidrIP: "0.0.0.0/0"
147+
description: "Allow all STMP with STARTTLS ingress"
136148
- fromPort: 993
137149
toPort: 993
138150
ipProtocol: tcp

bases/stalwart-migration-proxy/configmap.yaml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ data:
7474
host = ""
7575
tls_server_name = ""
7676
proxy_protocol = true
77+
forwarding = "proxy"
7778
7879
[destination.new]
7980
host = ""
8081
tls_server_name = ""
8182
proxy_protocol = true
83+
forwarding = "proxy"
8284
8385
# Explicitly list all supported ports in the old and new installations.
8486
# "forwarding = proxy" uses PROXY protocol v2 with Stalwart backends and is the correct setting
@@ -88,52 +90,46 @@ data:
8890
[destination.old.protocol.http]
8991
port = 443
9092
tls = "implicit"
91-
forwarding = true
93+
forwarding = "none"
94+
forwarded = true
9295
9396
[destination.old.protocol.smtp]
9497
port = 465
9598
tls = "implicit"
96-
forwarding = "proxy"
9799
98100
[destination.old.protocol.submission]
99101
port = 587
100102
tls = "starttls"
101-
forwarding = "proxy"
102103
103104
[destination.old.protocol.imap]
104105
port = 993
105106
tls = "implicit"
106-
forwarding = "proxy"
107107
108108
[destination.old.protocol.managesieve]
109109
port = 4190
110110
tls = "starttls"
111-
forwarding = "proxy"
112111
113112
[destination.new.protocol.http]
114113
port = 443
115114
tls = "implicit"
116-
forwarding = true
115+
forwarding = "none"
116+
forwarded = true
117117
118118
[destination.new.protocol.smtp]
119119
port = 465
120120
tls = "implicit"
121-
forwarding = "proxy"
122121
123122
[destination.new.protocol.submission]
124123
port = 587
125124
tls = "starttls"
126-
forwarding = "proxy"
127125
128126
[destination.new.protocol.imap]
129127
port = 993
130128
tls = "implicit"
131-
forwarding = "proxy"
132129
133130
[destination.new.protocol.managesieve]
134131
port = 4190
135132
tls = "starttls"
136-
forwarding = "proxy"
137133
138134
# Listeners describe services listening on ports which will route to the above destinations.
139135
# "proxy_protocol = 'off'" (the default value, explicit in our config) disables the use of
@@ -145,32 +141,27 @@ data:
145141
146142
[listener.https]
147143
protocol = "http"
148-
proxy_protocol = "off"
149144
forwarded = "off"
150145
bind = ["0.0.0.0:443"]
151146
tls = "implicit"
152147
153148
[listener.submissions]
154149
protocol = "submission"
155-
proxy_protocol = "off"
156150
bind = ["0.0.0.0:465"]
157151
tls = "implicit"
158152
159153
[listener.submission]
160154
protocol = "submission"
161-
proxy_protocol = "off"
162155
bind = ["0.0.0.0:587"]
163156
tls = "starttls"
164157
165158
[listener.imaps]
166159
protocol = "imap"
167-
proxy_protocol = "off"
168160
bind = ["0.0.0.0:993"]
169161
tls = "implicit"
170162
171163
[listener.managesieve]
172164
protocol = "managesieve"
173-
proxy_protocol = "off"
174165
bind = ["0.0.0.0:4190"]
175166
tls = "starttls"
176167

bases/stalwart-migration-proxy/service.yaml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
---
2-
# The stalwart-migration-proxy-redis service maps to the Serverless Redis cache's master endpoint
3-
apiVersion: v1
4-
kind: Service
5-
metadata:
6-
name: stalwart-migration-proxy-redis
7-
annotations:
8-
argocd.argoproj.io/sync-wave: "2"
9-
spec:
10-
type: ExternalName
11-
externalName: "" # Populate with Kustomize
12-
13-
---
14-
# Creates an internal access point for the Stalwart migration proxy
2+
# The stalwart-migration-proxy service creates a public load balancer exposing
3+
# our migration proxy to the world.
154
apiVersion: v1
165
kind: Service
176
metadata:
187
name: stalwart-migration-proxy
198
annotations:
209
argocd.argoproj.io/sync-wave: "2"
10+
# EKS-specific annotations are documented in "Use Service Annotations to configure Network Load Balancers":
11+
# https://docs.aws.amazon.com/eks/latest/userguide/auto-configure-nlb.html
12+
# A full list of annotations supported by the AWS Load Balancer controller can be found here:
13+
# https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/service/annotations/
14+
service.beta.kubernetes.io/aws-load-balancer-name: stalwart-migration-proxy-public
15+
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
16+
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
17+
service.beta.kubernetes.io/aws-load-balancer-attributes: "load_balancing.cross_zone.enabled=true"
18+
19+
# Update the below values in overlays. Use public subnets, appropriate tags, and the LB's SG.
20+
service.beta.kubernetes.io/aws-load-balancer-subnets: ""
21+
service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: "environment=not_set,project=not_set"
22+
service.beta.kubernetes.io/aws-load-balancer-security-groups: "" # stalwart-migration-proxy-lb
2123
spec:
22-
type: ClusterIP
24+
type: LoadBalancer
2325
selector:
26+
# The public load balancer should always route traffic to our internal proxy, which will route
27+
# that traffic internally according to our rules.
2428
app: stalwart-migration-proxy
29+
loadBalancerSourceRanges:
30+
- 0.0.0.0/0
2531
ports:
2632
- name: https
2733
port: 443
@@ -39,6 +45,18 @@ spec:
3945
port: 4190
4046
targetPort: sieve
4147

48+
---
49+
# The stalwart-migration-proxy-redis service maps to the Serverless Redis cache's master endpoint
50+
apiVersion: v1
51+
kind: Service
52+
metadata:
53+
name: stalwart-migration-proxy-redis
54+
annotations:
55+
argocd.argoproj.io/sync-wave: "2"
56+
spec:
57+
type: ExternalName
58+
externalName: "" # Populate with Kustomize
59+
4260
---
4361
# Exposes the Stalwart migration proxy admin API internally for Tailscale to grant human access
4462
apiVersion: v1

overlays/tb-dev/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ images:
1414
patches:
1515
- path: nginx/aws/security-groups.yaml
1616
- path: nginx/configmap.yaml
17-
- path: nginx/service.yaml
1817
- path: stalwart-mail/aws/elasticache.yaml
1918
- path: stalwart-mail/aws/s3.yaml
2019
- path: stalwart-mail/aws/security-groups.yaml

overlays/tb-dev/nginx/aws/security-groups.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,32 @@ spec:
2525
toPort: 443
2626
ipProtocol: tcp
2727
userIDGroupPairs:
28-
- description: Allow HTTPS service traffic from the public nginx load balancer
29-
groupID: "sg-00473b0f74de5fdaf" # stalwart-nginx-lb
28+
- description: Allow HTTPS service traffic from the Stalwart migration proxy pods
29+
groupID: sg-0590484da0d3c6702 # stalwart-migration-proxy
3030
- fromPort: 465
3131
toPort: 465
3232
ipProtocol: tcp
3333
userIDGroupPairs:
34-
- description: Allow SMTPS service traffic from the public nginx load balancer
35-
groupID: "sg-00473b0f74de5fdaf" # stalwart-nginx-lb
34+
- description: Allow SMTPS service traffic from the Stalwart migration proxy pods
35+
groupID: sg-0590484da0d3c6702 # stalwart-migration-proxy
36+
- fromPort: 587
37+
toPort: 587
38+
ipProtocol: tcp
39+
userIDGroupPairs:
40+
- description: Allow SMTP STARTTLS service traffic from the Stalwart migration proxy pods
41+
groupID: sg-0590484da0d3c6702 # stalwart-migration-proxy
3642
- fromPort: 993
3743
toPort: 993
3844
ipProtocol: tcp
3945
userIDGroupPairs:
40-
- description: Allow IMAPS service traffic from the public nginx load balancer
41-
groupID: "sg-00473b0f74de5fdaf" # stalwart-nginx-lb
46+
- description: Allow IMAPS service traffic from the Stalwart migration proxy pods
47+
groupID: sg-0590484da0d3c6702 # stalwart-migration-proxy
4248
- fromPort: 4190
4349
toPort: 4190
4450
ipProtocol: tcp
4551
userIDGroupPairs:
46-
- description: Allow ManageSieve service traffic from the public nginx load balancer
47-
groupID: "sg-00473b0f74de5fdaf" # stalwart-nginx-lb
52+
- description: Allow ManageSieve service traffic from the Stalwart migration proxy pods
53+
groupID: sg-0590484da0d3c6702 # stalwart-migration-proxy
4854

4955
---
5056
apiVersion: ec2.services.k8s.aws/v1alpha1

overlays/tb-dev/nginx/service.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)