Skip to content

Commit

Permalink
feat: Add the live deployment overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
42atomys committed Apr 30, 2022
1 parent 71a0ad2 commit 7c0ffeb
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 5 deletions.
16 changes: 12 additions & 4 deletions deploy/app/api/overlays/live/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ kind: Kustomization
namePrefix: prod-
resources:
- ../../base
namespace: staging
namespace: production
images:
- name: app
newName: ghcr.io/42atomys/stud42
newTag: latest

patchesStrategicMerge:
- ./use-next-primary-postgres.yaml
- ./use-next-routing.yaml
- ./use-live-primary-postgres.yaml
- ./use-live-routing.yaml

replacements:
- source:
Expand All @@ -24,4 +24,12 @@ replacements:
name: api-http
fieldPaths:
- spec.http.*.name
- spec.http.*.route.*.destination.host
- spec.http.*.route.*.destination.host
- source:
kind: Deployment
fieldPath: metadata.labels.[app.kubernetes.io/version]
targets:
- select:
kind: Deployment
fieldPaths:
- spec.template.spec.containers.[name=service].env.[name=APP_VERSION].value
36 changes: 36 additions & 0 deletions deploy/app/interface/overlays/live/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namePrefix: prod-
resources:
- ../../base
namespace: production
images:
- name: app
newName: ghcr.io/42atomys/stud42
newTag: latest

patchesStrategicMerge:
- ./use-live-routing.yaml

replacements:
- source:
kind: Service
name: interface-http
fieldPath: metadata.name
targets:
- select:
kind: VirtualService
name: interface-http
fieldPaths:
- spec.http.*.name
- spec.http.*.route.*.destination.host
- source:
kind: Deployment
name: interface
fieldPath: metadata.labels.[app.kubernetes.io/version]
targets:
- select:
kind: Deployment
name: interface
fieldPaths:
- spec.template.spec.containers.[name=interface].env.[name=APP_VERSION].value
26 changes: 26 additions & 0 deletions deploy/app/interface/overlays/live/use-live-routing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: interface-http
spec:
hosts:
- s42.app
gateways:
- s42-app

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: interface
spec:
selector: {}
template:
spec:
containers:
- name: interface
env:
- name: NEXT_PUBLIC_GRAPHQL_API
value: https://s42.app/graphql
- name: NEXTAUTH_URL
value: https://s42.app
13 changes: 12 additions & 1 deletion deploy/app/jwtks-service/overlays/live/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ images:
newName: ghcr.io/42atomys/stud42
newTag: latest

patchesStrategicMerge:
- ./use-live-routing.yaml

replacements:
- source:
kind: Service
Expand All @@ -30,4 +33,12 @@ replacements:
name: jwtks-service-http
fieldPaths:
- spec.http.*.name
- spec.http.*.route.*.destination.host
- spec.http.*.route.*.destination.host
- source:
kind: Deployment
fieldPath: metadata.labels.[app.kubernetes.io/version]
targets:
- select:
kind: Deployment
fieldPaths:
- spec.template.spec.containers.[name=service].env.[name=APP_VERSION].value
9 changes: 9 additions & 0 deletions deploy/app/jwtks-service/overlays/live/use-live-routing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: jwtks-service-http
spec:
hosts:
- s42.app
gateways:
- s42-app

0 comments on commit 7c0ffeb

Please sign in to comment.