From f575671d70f7faeb4cc7aaa1cc79a6640349d20f Mon Sep 17 00:00:00 2001 From: "YIHSUEN\\Yi Hsuen" Date: Fri, 27 Oct 2023 11:33:59 +0800 Subject: [PATCH] Revert back to HTTP with loadbalancer services --- deployment/gke-prod-manifests/frontend-ingress.yaml | 13 ------------- deployment/gke-prod-manifests/frontend-service.yaml | 1 + .../gke-prod-manifests/gateway-deployment.yaml | 6 +----- .../gke-prod-manifests/gateway-http-ingress.yaml | 13 ------------- deployment/gke-prod-manifests/gateway-service.yaml | 1 + .../gateway-wscollaboration-ingress.yaml | 13 ------------- .../gke-prod-manifests/gateway-wsmatch-ingress.yaml | 13 ------------- deployment/gke-prod-manifests/gke-managed-cert.yaml | 10 ---------- .../prod-dockerfiles/Dockerfile.frontend-prod | 6 +++--- 9 files changed, 6 insertions(+), 70 deletions(-) delete mode 100644 deployment/gke-prod-manifests/frontend-ingress.yaml delete mode 100644 deployment/gke-prod-manifests/gateway-http-ingress.yaml delete mode 100644 deployment/gke-prod-manifests/gateway-wscollaboration-ingress.yaml delete mode 100644 deployment/gke-prod-manifests/gateway-wsmatch-ingress.yaml delete mode 100644 deployment/gke-prod-manifests/gke-managed-cert.yaml diff --git a/deployment/gke-prod-manifests/frontend-ingress.yaml b/deployment/gke-prod-manifests/frontend-ingress.yaml deleted file mode 100644 index c99b9e91..00000000 --- a/deployment/gke-prod-manifests/frontend-ingress.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: frontend-ingress - annotations: - networking.gke.io/managed-certificates: gke-managed-cert - kubernetes.io/ingress.class: "gce" -spec: - defaultBackend: - service: - name: frontend - port: - number: 3000 diff --git a/deployment/gke-prod-manifests/frontend-service.yaml b/deployment/gke-prod-manifests/frontend-service.yaml index a72a5a12..9f0ca682 100644 --- a/deployment/gke-prod-manifests/frontend-service.yaml +++ b/deployment/gke-prod-manifests/frontend-service.yaml @@ -12,5 +12,6 @@ spec: targetPort: 3000 selector: io.kompose.service: frontend + type: LoadBalancer status: loadBalancer: {} diff --git a/deployment/gke-prod-manifests/gateway-deployment.yaml b/deployment/gke-prod-manifests/gateway-deployment.yaml index b5781d5f..88eafba9 100644 --- a/deployment/gke-prod-manifests/gateway-deployment.yaml +++ b/deployment/gke-prod-manifests/gateway-deployment.yaml @@ -31,7 +31,7 @@ spec: - name: WS_COLLABORATION_PROXY_PORT value: "4003" - name: FRONTEND_ADDRESS - value: "https://www.codeparty.org" + value: "http://www.codeparty.org" image: asia-southeast1-docker.pkg.dev/peerprep-group11-prod/codeparty-prod-images/gateway:latest name: gateway ports: @@ -44,10 +44,6 @@ spec: - containerPort: 4003 hostPort: 4003 protocol: TCP - # Needed for health check - - containerPort: 8080 - hostPort: 8080 - protocol: TCP resources: # You must specify requests for CPU to autoscale # based on CPU utilization diff --git a/deployment/gke-prod-manifests/gateway-http-ingress.yaml b/deployment/gke-prod-manifests/gateway-http-ingress.yaml deleted file mode 100644 index cb6434ae..00000000 --- a/deployment/gke-prod-manifests/gateway-http-ingress.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: gateway-http-ingress - annotations: - networking.gke.io/managed-certificates: gke-managed-cert - kubernetes.io/ingress.class: "gce" -spec: - defaultBackend: - service: - name: gateway - port: - number: 4000 diff --git a/deployment/gke-prod-manifests/gateway-service.yaml b/deployment/gke-prod-manifests/gateway-service.yaml index 0d9ffc66..83d56fc7 100644 --- a/deployment/gke-prod-manifests/gateway-service.yaml +++ b/deployment/gke-prod-manifests/gateway-service.yaml @@ -24,5 +24,6 @@ spec: targetPort: 8080 selector: io.kompose.service: gateway + type: LoadBalancer status: loadBalancer: {} diff --git a/deployment/gke-prod-manifests/gateway-wscollaboration-ingress.yaml b/deployment/gke-prod-manifests/gateway-wscollaboration-ingress.yaml deleted file mode 100644 index b3900773..00000000 --- a/deployment/gke-prod-manifests/gateway-wscollaboration-ingress.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: gateway-wscollaboration-ingress - annotations: - networking.gke.io/managed-certificates: gke-managed-cert - kubernetes.io/ingress.class: "gce" -spec: - defaultBackend: - service: - name: gateway - port: - number: 4003 diff --git a/deployment/gke-prod-manifests/gateway-wsmatch-ingress.yaml b/deployment/gke-prod-manifests/gateway-wsmatch-ingress.yaml deleted file mode 100644 index 5aea8575..00000000 --- a/deployment/gke-prod-manifests/gateway-wsmatch-ingress.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: gateway-wsmatch-ingress - annotations: - networking.gke.io/managed-certificates: gke-managed-cert - kubernetes.io/ingress.class: "gce" -spec: - defaultBackend: - service: - name: gateway - port: - number: 4002 diff --git a/deployment/gke-prod-manifests/gke-managed-cert.yaml b/deployment/gke-prod-manifests/gke-managed-cert.yaml deleted file mode 100644 index 4feaab2e..00000000 --- a/deployment/gke-prod-manifests/gke-managed-cert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: networking.gke.io/v1 -kind: ManagedCertificate -metadata: - name: gke-managed-cert -spec: - domains: - - www.codeparty.org - - api.codeparty.org - - wsmatch.codeparty.org - - wscollab.codeparty.org diff --git a/deployment/prod-dockerfiles/Dockerfile.frontend-prod b/deployment/prod-dockerfiles/Dockerfile.frontend-prod index d8e4826b..3f81fb84 100644 --- a/deployment/prod-dockerfiles/Dockerfile.frontend-prod +++ b/deployment/prod-dockerfiles/Dockerfile.frontend-prod @@ -23,9 +23,9 @@ RUN yarn prisma generate ARG NEXT_PUBLIC_FRONTEND_FIREBASE_CONFIG_ARG ENV NEXT_PUBLIC_FRONTEND_FIREBASE_CONFIG=$NEXT_PUBLIC_FRONTEND_FIREBASE_CONFIG_ARG -ENV NEXT_PUBLIC_HTTP_PROXY_GATEWAY_ADDRESS="https://api.codeparty.org/" -ENV NEXT_PUBLIC_WS_MATCH_PROXY_GATEWAY_ADDRESS="https://wsmatch.codeparty.org" -ENV NEXT_PUBLIC_WS_COLLABORATION_PROXY_GATEWAY_ADDRESS="https://wscollab.codeparty.org" +ENV NEXT_PUBLIC_HTTP_PROXY_GATEWAY_ADDRESS="http://api.codeparty.org:4000/" +ENV NEXT_PUBLIC_WS_MATCH_PROXY_GATEWAY_ADDRESS="http://api.codeparty.org:4002" +ENV NEXT_PUBLIC_WS_COLLABORATION_PROXY_GATEWAY_ADDRESS="http://api.codeparty.org:4003" RUN yarn build