From e4f571d5fda51ac86ef9454583023e11d374c6f7 Mon Sep 17 00:00:00 2001
From: Leah Tacke genannt Unterberg <leah.tgu@pads.rwth-aachen.de>
Date: Thu, 10 Apr 2025 16:59:17 +0200
Subject: [PATCH] tinkered with helm chart

---
 .../templates/deployment.yaml                 |  2 +-
 .../templates/postgresql-auth-secret.yaml     | 11 +++----
 helm/superset-mitm-service/values.yaml        | 30 +++++++++----------
 3 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/helm/superset-mitm-service/templates/deployment.yaml b/helm/superset-mitm-service/templates/deployment.yaml
index 017f50f..0a964a4 100644
--- a/helm/superset-mitm-service/templates/deployment.yaml
+++ b/helm/superset-mitm-service/templates/deployment.yaml
@@ -49,7 +49,7 @@ spec:
                 name: {{ tpl .Values.envFromSecret . | quote }}
           env:
             - name: API_PORT
-              value: {{ .Values.service.port }}
+              value: {{ .Values.service.port | quote }}
             - name: CORS_ORIGIN
               value: {{ tpl .Values.connections.origin . | quote}}
             {{- range $key, $value := .Values.apiConfig }}
diff --git a/helm/superset-mitm-service/templates/postgresql-auth-secret.yaml b/helm/superset-mitm-service/templates/postgresql-auth-secret.yaml
index 9698220..354f22d 100644
--- a/helm/superset-mitm-service/templates/postgresql-auth-secret.yaml
+++ b/helm/superset-mitm-service/templates/postgresql-auth-secret.yaml
@@ -19,15 +19,12 @@
 apiVersion: v1
 kind: Secret
 metadata:
-  name: postgresql-auth-env
+  name: {{ include "superset-mitm-service.fullname" . }}-postgresql-auth-env
   labels:
       {{- include "superset-mitm-service.labels" . | nindent 4 }}
   namespace: {{ .Release.Namespace }}
 type: Opaque
 stringData:
-  MITM_DATABASE_DIALECT: {{.Values.mitmDB.mitm_database_dialect  | quote }}
-  MITM_DATABASE_HOST: {{ tpl .Values.mitmDB.mitm_database_host .  | quote }}
-  MITM_DATABASE_PORT: {{.Values.mitmDB.mitm_database_port  | quote }}
-  MITM_DATABASE_USER: {{.Values.mitmDB.mitm_database_user  | quote }}
-  MITM_DATABASE_PASSWORD: {{.Values.mitmDB.mitm_database_password  | quote }}
-  MITM_DATABASE_DB: {{.Values.mitmDB.mitm_database_db  | quote }}
+  POSTGRES_USER: {{.Values.mitmDB.mitm_database_user  | quote }}
+  POSTGRES_PASSWORD: {{.Values.mitmDB.mitm_database_password  | quote }}
+  POSTGRES_DATABASE: {{.Values.mitmDB.mitm_database_db  | quote }}
diff --git a/helm/superset-mitm-service/values.yaml b/helm/superset-mitm-service/values.yaml
index a5100a9..fe2731f 100644
--- a/helm/superset-mitm-service/values.yaml
+++ b/helm/superset-mitm-service/values.yaml
@@ -9,7 +9,7 @@ replicaCount: 1
 image:
   repository: registry.git-ce.rwth-aachen.de/machine-data/superset-mitm-service
   # This sets the pull policy for images.
-  pullPolicy: always
+  pullPolicy: Always
   # Overrides the image tag whose default is the chart appVersion.
   tag: "latest"
 
@@ -48,7 +48,7 @@ securityContext: { }
   # capabilities:
   #   drop:
   #   - ALL
-  # readOnlyRootFilesystem: true
+# readOnlyRootFilesystem: true
 # runAsNonRoot: true
 # runAsUser: 1000
 
@@ -67,14 +67,14 @@ resources: { }
   # limits:
   #   cpu: 100m
   #   memory: 128Mi
-  # requests:
+# requests:
 #   cpu: 100m
 #   memory: 128Mi
 
 startupProbe:
   httpGet:
     path: /health
-    port: http
+    port: 8180
   initialDelaySeconds: 5
   timeoutSeconds: 1
   failureThreshold: 60
@@ -83,7 +83,7 @@ startupProbe:
 livenessProbe:
   httpGet:
     path: /health
-    port: http
+    port: 8180
   initialDelaySeconds: 5
   timeoutSeconds: 1
   failureThreshold: 3
@@ -92,7 +92,7 @@ livenessProbe:
 readinessProbe:
   httpGet:
     path: /health
-    port: http
+    port: 8180
   initialDelaySeconds: 5
   timeoutSeconds: 1
   failureThreshold: 3
@@ -132,7 +132,7 @@ mitmDB:
   mitm_database_dialect: "postgresql"
   mitm_database_user: "mitm-pg-user"
   mitm_database_password: "superweirdpasswordpleasedonotcrack"
-  mitm_database_host: "{{ .Release.Name }}-postgresql"
+  mitm_database_host: "{{ .Release.Name }}-mitm-postgresql"
   mitm_database_port: "5432"
   mitm_database_db: "mitm-db"
 
@@ -148,13 +148,13 @@ global:
     allowInsecureImages: true
 
 mitm-postgresql:
-  image:
-    registry: docker.io
-    repository: timescale/timescaledb
-    tag: latest-pg16
+  # image:
+  #   registry: docker.io
+  #   repository: timescale/timescaledb
+  #   tag: latest-pg16
 
   auth:
-    existingSecret: "postgresql-auth-env"
+    existingSecret: '{{ template "superset-mitm-service.fullname" . }}-postgresql-auth-env'
 
   primary:
     ##
@@ -176,6 +176,6 @@ mitm-postgresql:
       ports:
         postgresql: 5432
 
-  initScripts:
-    timescaledb: |
-      CREATE EXTENSION IF NOT EXISTS timescaledb;
\ No newline at end of file
+  # initScripts:
+  #   timescaledb: |
+  #     CREATE EXTENSION IF NOT EXISTS timescaledb;
\ No newline at end of file
-- 
GitLab