Skip to content

Commit

Permalink
ft: provide grpc backend for frontend build
Browse files Browse the repository at this point in the history
  • Loading branch information
shivanshs9 committed Nov 10, 2024
1 parent a7a2c99 commit b041ed0
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-push-gcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,7 @@ jobs:
push: true
labels: |
ci.run_id=${{ github.run_id }}
build-args:
- VITE_GRPC_BACKEND="${{ vars.VITE_GRPC_BACKEND }}"
tags: |
${{ inputs.registry }}/${{ secrets.GCLOUD_PROJECT }}/${{ inputs.repo }}:${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }}
2 changes: 2 additions & 0 deletions frontend.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ RUN yarn protoc \
--ts_opt ts_nocheck \
./protos/*.proto

ARG VITE_GRPC_BACKEND="http://0.0.0.0:8080"
ENV VITE_GRPC_BACKEND=${VITE_GRPC_BACKEND}
RUN yarn build

FROM flashspys/nginx-static:latest AS app
Expand Down
3 changes: 3 additions & 0 deletions iac/gitops/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ spec:
containers:
- name: frontend
image: frontend:latest
env:
- name: VITE_GRPC_BACKEND
value: "https://whisper-notes-backend.polynomial.finance"
ports:
- name: http
containerPort: 80
Expand Down
23 changes: 23 additions & 0 deletions iac/gitops/frontend/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: rt-frontend
spec:
hostnames:
- whisper-notes.polynomial.finance
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: public-istio-gateway
namespace: default
rules:
- backendRefs:
- group: ''
kind: Service
name: whisper-notes-frontend
port: 80
weight: 1
matches:
- path:
type: PathPrefix
value: /
1 change: 1 addition & 0 deletions iac/gitops/frontend/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- ingress.yaml

namePrefix: whisper-notes-
namespace: debug # CHANGEME: default
Expand Down
23 changes: 23 additions & 0 deletions iac/gitops/proxy/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: rt-api-proxy
spec:
hostnames:
- whisper-notes-backend.polynomial.finance
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: public-istio-gateway
namespace: default
rules:
- backendRefs:
- group: ''
kind: Service
name: whisper-notes-proxy
port: 8443
weight: 1
matches:
- path:
type: PathPrefix
value: /
1 change: 1 addition & 0 deletions iac/gitops/proxy/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- ingress.yaml

namePrefix: whisper-notes-
namespace: debug # CHANGEME: default
Expand Down

0 comments on commit b041ed0

Please sign in to comment.