From 83c7fb559581696d9b74fa10dd4be5cd5af55741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anatol=20Karalko=C5=AD?= Date: Sun, 3 Mar 2024 11:52:18 +0100 Subject: [PATCH] Start new brokencrystals-exp chart Without proxy container Fix Ingress port Update chart version --- Dockerfile | 6 +- charts/brokencrystals/Chart.yaml | 8 +-- .../brokencrystals/templates/deployment.yaml | 59 ++----------------- charts/brokencrystals/templates/ingress.yaml | 2 +- charts/brokencrystals/templates/service.yaml | 4 +- charts/brokencrystals/values.yaml | 2 +- 6 files changed, 18 insertions(+), 63 deletions(-) diff --git a/Dockerfile b/Dockerfile index c829f10a..3f9ef389 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,8 +51,12 @@ COPY --chown=node:node --from=development /usr/src/app/client/node_modules ./cli RUN apk add --no-cache --virtual .gyp python3 py3-pip make g++ +# Install project dependencies before running build commands +RUN npm ci + RUN npm run build -RUN npm run build --prefix=client +# Build the client (React) project +RUN cd client && npm ci && npm run build ENV NODE_ENV production diff --git a/charts/brokencrystals/Chart.yaml b/charts/brokencrystals/Chart.yaml index 153dc938..911273f4 100644 --- a/charts/brokencrystals/Chart.yaml +++ b/charts/brokencrystals/Chart.yaml @@ -1,10 +1,10 @@ apiVersion: v2 -name: brokencrystals +name: brokencrystals-exp description: | Benchmark application that uses modern technologies and implements a set of common security vulnerabilities type: application -version: 0.0.46 +version: 0.0.53 keywords: - - brokencrystals - - brkn + - brokencrystals-exp + - brkn-e diff --git a/charts/brokencrystals/templates/deployment.yaml b/charts/brokencrystals/templates/deployment.yaml index 26d9f56b..ed939603 100644 --- a/charts/brokencrystals/templates/deployment.yaml +++ b/charts/brokencrystals/templates/deployment.yaml @@ -155,6 +155,11 @@ spec: value: "https://raw.githubusercontent.com/NeuraLegion/brokencrystals/development/config/keys/jku.json" - name: X5U_URL value: "https://raw.githubusercontent.com/NeuraLegion/brokencrystals/development/config/keys/x509.crt" + volumeMounts: + - name: {{ include "brokencrystals.fullname" . }}-nginx-proxy + mountPath: /etc/nginx/conf.d/default.conf + subPath: default.conf + readOnly: true resources: requests: cpu: 900m @@ -168,60 +173,6 @@ spec: scheme: HTTP initialDelaySeconds: 120 periodSeconds: 30 - - - name: proxy - image: brightsec/brokencrystals-proxy-http:{{ .Values.images.client }} - env: - - name: URL - value: "https://{{ .Values.ingress.url }}" - - name: DATABASE_HOST - value: "postgres" - - name: DATABASE_SCHEMA - value: "bc" - - name: DATABASE_USER - value: "bc" - - name: DATABASE_PASSWORD - value: "bc" - - name: DATABASE_PORT - value: "5432" - - name: DATABASE_DEBUG - value: "true" - - name: AWS_BUCKET - value: "https://neuralegion-open-bucket.s3.amazonaws.com" - - name: GOOGLE_MAPS_API - value: "AIzaSyD2wIxpYCuNI0Zjt8kChs2hLTS5abVQfRQ" - - name: JWT_PRIVATE_KEY_LOCATION - value: "config/keys/jwtRS256.key" - - name: JWT_PUBLIC_KEY_LOCATION - value: "config/keys/jwtRS256.key.pub.pem" - - name: JWT_SECRET_KEY - value: "1234" - - name: JWK_PRIVATE_KEY_LOCATION - value: "config/keys/jwk.key.pem" - - name: JWK_PUBLIC_KEY_LOCATION - value: "config/keys/jwk.pub.key.pem" - - name: JWK_PUBLIC_JSON - value: "config/keys/jwk.pub.json" - - name: JKU_URL - value: "https://raw.githubusercontent.com/NeuraLegion/brokencrystals/development/config/keys/jku.json" - - name: X5U_URL - value: "https://raw.githubusercontent.com/NeuraLegion/brokencrystals/development/config/keys/x509.crt" - volumeMounts: - - name: {{ include "brokencrystals.fullname" . }}-nginx-proxy - mountPath: /etc/nginx/conf.d/default.conf - subPath: default.conf - readOnly: true - resources: - requests: - cpu: 500m - memory: 50Mi - livenessProbe: - httpGet: - path: / - port: 80 - scheme: HTTP - initialDelaySeconds: 120 - periodSeconds: 30 restartPolicy: Always volumes: diff --git a/charts/brokencrystals/templates/ingress.yaml b/charts/brokencrystals/templates/ingress.yaml index 21fd918b..71f70636 100644 --- a/charts/brokencrystals/templates/ingress.yaml +++ b/charts/brokencrystals/templates/ingress.yaml @@ -26,7 +26,7 @@ spec: service: name: {{ .Release.Name }} port: - number: 80 + number: 3000 --- apiVersion: networking.k8s.io/v1 diff --git a/charts/brokencrystals/templates/service.yaml b/charts/brokencrystals/templates/service.yaml index 31dbe8ec..0436620b 100644 --- a/charts/brokencrystals/templates/service.yaml +++ b/charts/brokencrystals/templates/service.yaml @@ -7,8 +7,8 @@ spec: app: {{ .Release.Name }} ports: - protocol: TCP - port: 80 - targetPort: 80 + port: 3000 + targetPort: 3000 --- apiVersion: v1 diff --git a/charts/brokencrystals/values.yaml b/charts/brokencrystals/values.yaml index cf35515a..3b879e65 100644 --- a/charts/brokencrystals/values.yaml +++ b/charts/brokencrystals/values.yaml @@ -3,5 +3,5 @@ ingress: cert: "" authlevel: "." images: - main: latest + main: experimental client: latest