From b9c077c46de93ce7939ea8e7e545db9afa16e9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Tue, 6 Feb 2024 17:13:24 +0100 Subject: [PATCH] Adapt chart to use the correct images Change-Id: Ibb29d9eaf8e35a08ac081f752aa73916ee1c734b --- charts/nebulous-gui/templates/deployment.yaml | 33 ++++++++++++++++--- charts/nebulous-gui/values.yaml | 11 +++++-- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/charts/nebulous-gui/templates/deployment.yaml b/charts/nebulous-gui/templates/deployment.yaml index 4cb1db1..d7fbaab 100644 --- a/charts/nebulous-gui/templates/deployment.yaml +++ b/charts/nebulous-gui/templates/deployment.yaml @@ -27,15 +27,32 @@ spec: serviceAccountName: {{ include "nebulous-gui.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} + initContainers: + - name: {{ .Chart.Name }}-builder securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + image: "{{ .Values.builderImage.repository }}:{{ .Values.builderImage.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.builderImage.pullPolicy }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + command: + - npx + - vite + - build + volumeMounts: + - name: static-files + mountPath: /app/dist + env: + {{- toYaml .Values.builderEnv | nindent 12 }} + containers: + - name: {{ .Chart.Name }}-server + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.serverImage.repository }}:{{ .Values.serverImage.tag }}" + imagePullPolicy: {{ .Values.serverImage.pullPolicy }} ports: - name: http - containerPort: 8080 + containerPort: 80 protocol: TCP livenessProbe: httpGet: @@ -47,6 +64,9 @@ spec: port: http resources: {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: static-files + mountPath: /usr/share/nginx/html {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -59,3 +79,6 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + volumes: + - name: static-files + emptyDir: {} diff --git a/charts/nebulous-gui/values.yaml b/charts/nebulous-gui/values.yaml index 029fbc5..d609305 100644 --- a/charts/nebulous-gui/values.yaml +++ b/charts/nebulous-gui/values.yaml @@ -4,12 +4,19 @@ replicaCount: 1 -image: - repository: "quay.io/nebulous/gui-java-spring-boot-demo" +serverImage: + repository: "docker.io/library/nginx" + pullPolicy: IfNotPresent + tag: "latest" + +builderImage: + repository: "quay.io/nebulous/gui-builder" pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" +builderEnv: [] + imagePullSecrets: [] nameOverride: "" fullnameOverride: ""