From 318f88d35cadcde6ec75907f04e86c10c9c4112d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Wed, 20 Nov 2024 09:43:30 +0100 Subject: [PATCH] resource-manager: improve approach to env To help with configuration. --- charts/nebulous-resource-manager/Chart.yaml | 2 +- .../templates/deployment.yaml | 12 +++---- charts/nebulous-resource-manager/values.yaml | 32 ++++++++----------- 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/charts/nebulous-resource-manager/Chart.yaml b/charts/nebulous-resource-manager/Chart.yaml index 4f9026e..da1d715 100644 --- a/charts/nebulous-resource-manager/Chart.yaml +++ b/charts/nebulous-resource-manager/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.1.1 +version: 0.2.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/charts/nebulous-resource-manager/templates/deployment.yaml b/charts/nebulous-resource-manager/templates/deployment.yaml index 2e15628..a84f2b8 100644 --- a/charts/nebulous-resource-manager/templates/deployment.yaml +++ b/charts/nebulous-resource-manager/templates/deployment.yaml @@ -34,9 +34,9 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: - {{- range .Values.env }} - - name: {{ .name }} - value: {{ .value | quote }} + {{- range $key, $val := .Values.env }} + - name: {{ $key }} + value: {{ $val | quote }} {{- end }} ports: - name: http @@ -58,9 +58,9 @@ spec: image: "docker.io/library/mongo:4.4.29" imagePullPolicy: {{ .Values.image.pullPolicy }} env: - {{- range .Values.env }} - - name: {{ .name }} - value: {{ .value | quote }} + {{- range $key, $val := .Values.mongodb.env }} + - name: {{ $key }} + value: {{ $val | quote }} {{- end }} ports: - name: mongo-port diff --git a/charts/nebulous-resource-manager/values.yaml b/charts/nebulous-resource-manager/values.yaml index 3ded876..2849966 100644 --- a/charts/nebulous-resource-manager/values.yaml +++ b/charts/nebulous-resource-manager/values.yaml @@ -81,22 +81,18 @@ tolerations: [] affinity: {} +mongodb: + env: + MONGO_INITDB_ROOT_USERNAME: "root" + MONGO_INITDB_ROOT_PASSWORD: "example" + env: - # ===== MongoDB configuration ===== - - name: MONGO_INITDB_ROOT_USERNAME - value: 'root' - - name: MONGO_INITDB_ROOT_PASSWORD - value: 'example' - # ===== Resource Manager configuration ===== - - name: SPRING_DATA_MONGODB_URI - value: 'mongodb://root:example@localhost:27017/admin' - - name: DISCOVERY_BROKER_USERNAME - value: 'aaa' - - name: DISCOVERY_BROKER_PASSWORD - value: '111' - - name: DISCOVERY_BROKERURL - value: 'tcp://nebulous-monitoring:61616?daemon=true&trace=false&useInactivityMonitor=false&connectionTimeout=0&keepAlive=true' - - name: DISCOVERY_API_KEY_AUTHENTICATION_ENABLED - value: 'true' - - name: DISCOVERY_API_KEY_VALUE - value: '1234567890' + SPRING_DATA_MONGODB_URI: "mongodb://root:example@localhost:27017/admin" + DISCOVERY_BROKER_USERNAME: "aaa" + DISCOVERY_BROKER_PASSWORD: "111" + DISCOVERY_BROKERURL: "tcp://nebulous-monitoring:61616?daemon=true&trace=false&useInactivityMonitor=false&connectionTimeout=0&keepAlive=true" + DISCOVERY_API_KEY_AUTHENTICATION_ENABLED: "true" + DISCOVERY_API_KEY_VALUE: "1234567890" + RM_ADMIN_PASSWD: "admin" + RM_USER_PASSWD: "user" + NEBULOUS_SERVER_IP_ADDRESS: "127.0.0.1"