Skip to content

Commit

Permalink
chore(deploy): prod lb and oia
Browse files Browse the repository at this point in the history
  • Loading branch information
incubator4 committed Jan 1, 2024
1 parent 080fa29 commit b2e9726
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 25 deletions.
2 changes: 2 additions & 0 deletions deploy/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ kind: Kustomization
resources:
- ../base
- hpa.yaml
- svc
- oia

patches:
- patch: |-
Expand Down
6 changes: 6 additions & 0 deletions deploy/prod/oia/ingressroute/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- oia.yaml
- oia-no-rewrite.yaml
25 changes: 25 additions & 0 deletions deploy/prod/oia/ingressroute/oia-no-rewrite.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: xlog-oia-no-rewrite
namespace: crossbell
spec:
entryPoints:
- web
- websecure
routes:
- kind: Rule
match: Host(`oia.xlog.app`) && PathPrefix(`/_next`)
middlewares:
- name: xlog-oia-replace-host
services:
- name: xlog-internal
port: 3000
- kind: Rule
match: Host(`oia.xlog.app`) && PathPrefix(`/.well-known`)
middlewares:
- name: xlog-oia-add-prefix
- name: xlog-oia-replace-host
services:
- name: xlog-internal
port: 80
18 changes: 18 additions & 0 deletions deploy/prod/oia/ingressroute/oia.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: xlog-oia
namespace: crossbell
spec:
entryPoints:
- web
- websecure
routes:
- kind: Rule
match: Host(`oia.xlog.app`) && !PathPrefix(`/_next`) && !PathPrefix(`/.well-known`)
middlewares:
- name: xlog-oia-replace-host
- name: xlog-replace-path-oia
services:
- name: xlog-internal
port: 80
6 changes: 6 additions & 0 deletions deploy/prod/oia/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ingressroute
- middleware
8 changes: 8 additions & 0 deletions deploy/prod/oia/middleware/add-prefix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: xlog-oia-add-prefix
namespace: crossbell
spec:
addPrefix:
prefix: /oia
7 changes: 7 additions & 0 deletions deploy/prod/oia/middleware/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- add-prefix.yaml
- oia-replace-host.yaml
- replace-path-oia.yaml
10 changes: 10 additions & 0 deletions deploy/prod/oia/middleware/oia-replace-host.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: xlog-oia-replace-host
namespace: crossbell
spec:
headers:
customRequestHeaders:
Host: "xlog.app"
X-Forwarded-Host: "xlog.app"
8 changes: 8 additions & 0 deletions deploy/prod/oia/middleware/replace-path-oia.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: xlog-replace-path-oia
namespace: crossbell
spec:
replacePath:
path: /oia
25 changes: 0 additions & 25 deletions deploy/prod/svc.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions deploy/prod/svc/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- lb-cname-01.yaml
- lb-main-01.yaml
- lb-wildcard-01.yaml

commonAnnotations:
cloud.google.com/l4-rbs: "enabled"
networking.gke.io/internal-load-balancer-subnet: "prod-loadbalancer"
networking.gke.io/internal-load-balancer-allow-global-access: "true"
18 changes: 18 additions & 0 deletions deploy/prod/svc/lb-cname-01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: xlog-lb-cname-01
namespace: crossbell
spec:
type: LoadBalancer
selector:
app: xlog-caddy
ports:
- name: http
protocol: TCP
port: 80
targetPort: 80
- name: https
protocol: TCP
port: 443
targetPort: 443
18 changes: 18 additions & 0 deletions deploy/prod/svc/lb-main-01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: xlog-lb-main-01
namespace: crossbell
spec:
type: LoadBalancer
selector:
app: xlog-caddy
ports:
- name: http
protocol: TCP
port: 80
targetPort: 80
- name: https
protocol: TCP
port: 443
targetPort: 443
18 changes: 18 additions & 0 deletions deploy/prod/svc/lb-wildcard-01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: xlog-lb-wildcard-01
namespace: crossbell
spec:
type: LoadBalancer
selector:
app: xlog-caddy
ports:
- name: http
protocol: TCP
port: 80
targetPort: 80
- name: https
protocol: TCP
port: 443
targetPort: 443

0 comments on commit b2e9726

Please sign in to comment.