From b64f9ad5e4d1678ec1a808739d0f0fdcd1275d9c Mon Sep 17 00:00:00 2001 From: Emilien Devos <121870973+edevosc2c@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:52:21 +0100 Subject: [PATCH] fixing identation + add keepConfigFromKubernetes --- mviewer/Chart.yaml | 2 +- mviewer/ci/all-optional-values.yaml | 31 ++++++++++--------- .../templates/elasticsearch-deployment.yaml | 14 ++++----- mviewer/templates/mviewer-deployment.yaml | 4 +-- .../templates/mviewerstudio-deployment.yaml | 14 ++++----- mviewer/values.yaml | 2 ++ 6 files changed, 35 insertions(+), 32 deletions(-) diff --git a/mviewer/Chart.yaml b/mviewer/Chart.yaml index 1fa18dc..9dd53cb 100644 --- a/mviewer/Chart.yaml +++ b/mviewer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.5.0 +version: 0.6.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/mviewer/ci/all-optional-values.yaml b/mviewer/ci/all-optional-values.yaml index 5c19efc..b5b36f5 100644 --- a/mviewer/ci/all-optional-values.yaml +++ b/mviewer/ci/all-optional-values.yaml @@ -29,14 +29,14 @@ mviewer: podAnnotations: myapp: mviewer lifecycle: - lifecycle: - postStart: - exec: - command: ["/bin/sh", "-c", "echo"] + postStart: + exec: + command: ["/bin/sh", "-c", "echo"] extraVolumes: [] extraVolumeMounts: [] extraEnv: - FOO: "BAR" + - name: FOO + value: BAR persistence: mviewer_conf: annotations: @@ -75,12 +75,12 @@ elasticsearch: podAnnotations: myapp: mviewer extraEnv: - FOO: "BAR" + - name: FOO + value: BAR lifecycle: - lifecycle: - postStart: - exec: - command: ["/bin/sh", "-c", "echo"] + postStart: + exec: + command: ["/bin/sh", "-c", "echo"] ingress: enabled: true @@ -112,12 +112,13 @@ mviewerstudio: - linux podAnnotations: myapp: mviewer + keepConfigFromKubernetes: true extraEnv: - FOO: "BAR" + - name: FOO + value: BAR lifecycle: - lifecycle: - postStart: - exec: - command: ["/bin/sh", "-c", "echo"] + postStart: + exec: + command: ["/bin/sh", "-c", "echo"] extraVolumes: [] extraVolumeMounts: [] diff --git a/mviewer/templates/elasticsearch-deployment.yaml b/mviewer/templates/elasticsearch-deployment.yaml index 98a1564..9e0c11c 100644 --- a/mviewer/templates/elasticsearch-deployment.yaml +++ b/mviewer/templates/elasticsearch-deployment.yaml @@ -61,13 +61,13 @@ spec: containerPort: 9200 protocol: TCP env: - - name: ES_JAVA_OPTS - value: "-Dlog4j2.formatMsgNoLookups=true -Dlog4j2.disable.jmx=true" - - name: discovery.type - value: "single-node" - {{- with $webapp.extraEnv }} - {{- toYaml . | nindent 10 }} - {{- end }} + - name: ES_JAVA_OPTS + value: "-Dlog4j2.formatMsgNoLookups=true -Dlog4j2.disable.jmx=true" + - name: discovery.type + value: "single-node" + {{- with $webapp.extraEnv }} + {{- toYaml . | nindent 8 }} + {{- end }} volumeMounts: - name: elasticsearch-data mountPath: /usr/share/elasticsearch/data diff --git a/mviewer/templates/mviewer-deployment.yaml b/mviewer/templates/mviewer-deployment.yaml index a25b018..24c015d 100644 --- a/mviewer/templates/mviewer-deployment.yaml +++ b/mviewer/templates/mviewer-deployment.yaml @@ -46,7 +46,7 @@ spec: imagePullPolicy: {{ $webapp.image.imagePullPolicy }} {{- with $webapp.extraEnv }} env: - {{- toYaml . | nindent 10 }} + {{- toYaml . | nindent 8 }} {{- end }} resources: {{- toYaml $webapp.resources | nindent 10 }} @@ -73,7 +73,7 @@ spec: mountPath: /usr/share/nginx/html/apps readOnly: true {{- if $webapp.extraVolumeMounts }} - {{- $webapp.extraVolumeMounts | toYaml | nindent 10 }} + {{- $webapp.extraVolumeMounts | toYaml | nindent 8 }} {{- end }} volumes: - name: mviewer-conf diff --git a/mviewer/templates/mviewerstudio-deployment.yaml b/mviewer/templates/mviewerstudio-deployment.yaml index 88c7f06..5ffcd15 100644 --- a/mviewer/templates/mviewerstudio-deployment.yaml +++ b/mviewer/templates/mviewerstudio-deployment.yaml @@ -43,14 +43,14 @@ spec: initContainers: - name: copy-starter-configmap image: busybox:latest - {{- if $webapp.resetConfig }} - command: ["sh", "-c", "cp /cm/config.json /mnt/mviewerstudio_conf/;"] + {{- if $webapp.keepConfigFromKubernetes }} + command: ["sh", "-c", "cp /cm/config.json /mnt/mviewerstudio/static/apps/;"] {{- else }} - command: ["sh", "-c", "if ! [ -f /mnt/mviewerstudio_conf/config.json ]; then cp /cm/config.json /mnt/mviewerstudio_conf/; fi ;"] + command: ["sh", "-c", "if ! [ -f /mnt/mviewerstudio/static/apps/config.json ]; then cp /cm/config.json /mnt/mviewerstudio/static/apps/; fi ;"] {{- end }} volumeMounts: - - name: mviewerstudio-conf - mountPath: /mnt/mviewerstudio_conf + - name: mviewerstudio-static-apps + mountPath: /mnt/mviewerstudio/static/apps - name: mviewerstudio-conf-json mountPath: /cm containers: @@ -75,7 +75,7 @@ spec: - name: DEFAULT_ORG value: no_org {{- with $webapp.extraEnv }} - {{- toYaml . | nindent 10 }} + {{- toYaml . | nindent 8 }} {{- end }} resources: {{- toYaml $webapp.resources | nindent 10 }} @@ -91,7 +91,7 @@ spec: - name: mviewerstudio-static-apps mountPath: /home/apprunner/mviewerstudio_backend/static/apps {{- if $webapp.extraVolumeMounts }} - {{- $webapp.extraVolumeMounts | toYaml | nindent 10 }} + {{- $webapp.extraVolumeMounts | toYaml | nindent 8 }} {{- end }} volumes: - name: mviewer-conf diff --git a/mviewer/values.yaml b/mviewer/values.yaml index acc6558..40a0257 100644 --- a/mviewer/values.yaml +++ b/mviewer/values.yaml @@ -147,6 +147,8 @@ mviewerstudio: # storageClass: "-" accessModes: - ReadWriteOnce + # This will overwrite the config.json from the helm value "configMap" everytime the pod is launched + keepConfigFromKubernetes: false configMap: configJson: | {