Skip to content

Commit 1b93133

Browse files
authored
fix: add HTTP redirect route to ListenerSet for apex domain
fix: add HTTP redirect route to ListenerSet for apex domain
2 parents c9f7770 + 455d822 commit 1b93133

5 files changed

Lines changed: 39 additions & 2 deletions

File tree

deploy/manifests/balancer/base/gateway-listeners.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: ListenerSet
33
metadata:
44
name: balancer-listeners
55
annotations:
6-
cert-manager.io/cluster-issuer: letsencrypt-prod
6+
cert-manager.io/cluster-issuer: letsencrypt-prod-gateway
77
hostname: HOSTNAME_PLACEHOLDER
88
spec:
99
parentRef:

deploy/manifests/balancer/base/httproute.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
apiVersion: gateway.networking.k8s.io/v1
32
kind: HTTPRoute
43
metadata:
@@ -21,3 +20,24 @@ spec:
2120
backendRefs:
2221
- name: balancer
2322
port: 80
23+
---
24+
apiVersion: gateway.networking.k8s.io/v1
25+
kind: HTTPRoute
26+
metadata:
27+
name: balancer-http-redirect
28+
annotations:
29+
hostname: HOSTNAME_PLACEHOLDER
30+
spec:
31+
parentRefs:
32+
- name: balancer-listeners
33+
kind: ListenerSet
34+
group: gateway.networking.k8s.io
35+
sectionName: http
36+
hostnames:
37+
- HOSTNAME_PLACEHOLDER
38+
rules:
39+
- filters:
40+
- type: RequestRedirect
41+
requestRedirect:
42+
scheme: https
43+
statusCode: 301

deploy/manifests/balancer/base/kustomization.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ configMapGenerator:
2222
- name: balancer-config
2323
envs:
2424
- balancer.env
25+
26+
generatorOptions:
27+
disableNameSuffixHash: true

deploy/manifests/balancer/overlays/production/kustomization.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ patches:
3838
- target:
3939
kind: HTTPRoute
4040
name: balancer
41+
patch: |
42+
- op: replace
43+
path: /spec/hostnames/0
44+
value: balancerproject.org
45+
- target:
46+
kind: HTTPRoute
47+
name: balancer-http-redirect
4148
patch: |
4249
- op: replace
4350
path: /spec/hostnames/0

deploy/manifests/balancer/overlays/sandbox/kustomization.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ patches:
4343
- op: replace
4444
path: /spec/hostnames/0
4545
value: sandbox.balancerproject.org
46+
- target:
47+
kind: HTTPRoute
48+
name: balancer-http-redirect
49+
patch: |
50+
- op: replace
51+
path: /spec/hostnames/0
52+
value: sandbox.balancerproject.org
4653
- target:
4754
kind: Deployment
4855
name: balancer

0 commit comments

Comments
 (0)