Skip to content
26 changes: 26 additions & 0 deletions deploy/manifests/balancer/base/gateway-listeners.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: gateway.networking.k8s.io/v1
kind: ListenerSet
metadata:
name: balancer-listeners
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
parentRef:
name: main-gateway
namespace: envoy-gateway-system
group: gateway.networking.k8s.io
kind: Gateway
listeners:
- name: http
protocol: HTTP
port: 80
hostname: HOSTNAME_PLACEHOLDER
- name: https
protocol: HTTPS
port: 443
hostname: HOSTNAME_PLACEHOLDER
tls:
mode: Terminate
certificateRefs:
- name: balancer-tls
kind: Secret
39 changes: 39 additions & 0 deletions deploy/manifests/balancer/base/httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: balancer-redirect
spec:
parentRefs:
- name: balancer-listeners
kind: ListenerSet
group: gateway.networking.k8s.io
sectionName: http
hostnames:
- HOSTNAME_PLACEHOLDER
rules:
- filters:
- type: RequestRedirect
requestRedirect:
scheme: https
statusCode: 301
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: balancer
spec:
parentRefs:
- name: balancer-listeners
kind: ListenerSet
group: gateway.networking.k8s.io
sectionName: https
hostnames:
- HOSTNAME_PLACEHOLDER
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: balancer
port: 80
23 changes: 0 additions & 23 deletions deploy/manifests/balancer/base/ingress.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion deploy/manifests/balancer/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ resources:
- namespace.yaml
- deployment.yaml
- service.yaml
- ingress.yaml
- gateway-listeners.yaml
- httproute.yaml
2 changes: 1 addition & 1 deletion deploy/manifests/balancer/base/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
spec:
ports:
- name: http
port: 8000
port: 80
targetPort: 8000
selector:
app: balancer
26 changes: 0 additions & 26 deletions deploy/manifests/balancer/overlays/dev/kustomization.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions deploy/manifests/balancer/overlays/production/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: balancer

resources:
- ../../base

images:
- name: ghcr.io/codeforphilly/balancer-main/app
newTag: latest

patches:
- target:
kind: ListenerSet
name: balancer-listeners
patch: |-
- op: replace
path: /spec/listeners/0/hostname
value: balancerproject.org
- op: replace
path: /spec/listeners/1/hostname
value: balancerproject.org
- target:
kind: HTTPRoute
name: balancer
patch: |-
- op: add
path: /spec/hostnames
value: ["balancerproject.org"]
- target:
kind: HTTPRoute
name: balancer-redirect
patch: |-
- op: add
path: /spec/hostnames
value: ["balancerproject.org"]
37 changes: 37 additions & 0 deletions deploy/manifests/balancer/overlays/sandbox/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: balancer

resources:
- ../../base

images:
- name: ghcr.io/codeforphilly/balancer-main/app
newTag: latest

patches:
- target:
kind: ListenerSet
name: balancer-listeners
patch: |-
- op: replace
path: /spec/listeners/0/hostname
value: sandbox.balancerproject.org
- op: replace
path: /spec/listeners/1/hostname
value: sandbox.balancerproject.org
- target:
kind: HTTPRoute
name: balancer
patch: |-
- op: add
path: /spec/hostnames
value: ["sandbox.balancerproject.org"]
- target:
kind: HTTPRoute
name: balancer-redirect
patch: |-
- op: add
path: /spec/hostnames
value: ["sandbox.balancerproject.org"]
Loading