From 0e2cf765f9b916f73eb6e2bcc140926ca8242116 Mon Sep 17 00:00:00 2001
From: lorenz <stu203404@mail.uni-kiel.de>
Date: Sat, 27 Mar 2021 21:35:50 +0100
Subject: [PATCH] enhance helm

---
 .../helm/theodolite-operator/templates/role.yaml      |  3 +++
 .../helm/theodolite-operator/templates/service.yaml   |  8 +++++---
 .../templates/thedolite-operator.yaml                 | 11 +++++++++--
 execution/helm/theodolite-operator/values.yaml        |  4 ++--
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/execution/helm/theodolite-operator/templates/role.yaml b/execution/helm/theodolite-operator/templates/role.yaml
index 2ce70d282..ac0a0c7fe 100644
--- a/execution/helm/theodolite-operator/templates/role.yaml
+++ b/execution/helm/theodolite-operator/templates/role.yaml
@@ -13,6 +13,7 @@ rules:
     - list
     - get
     - create
+    - update
   - apiGroups:
     - ""
     resources:
@@ -21,6 +22,7 @@ rules:
     - servicemonitors
     - configmaps
     verbs:
+    - update
     - delete
     - list
     - get
@@ -37,6 +39,7 @@ rules:
     resources:
     - servicemonitors
     verbs:
+    - update
     - delete
     - list
     - create
diff --git a/execution/helm/theodolite-operator/templates/service.yaml b/execution/helm/theodolite-operator/templates/service.yaml
index 1391e9189..296169347 100644
--- a/execution/helm/theodolite-operator/templates/service.yaml
+++ b/execution/helm/theodolite-operator/templates/service.yaml
@@ -2,14 +2,16 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "theodolite-operator.fullname" . }}
+  name: {{ include "theodolite-operator.fullname" . }}-service
   labels:
-    {{- include "theodolite-operator.labels" . | nindent 4 }}
+    app: {{ include "theodolite-operator.fullname" . }}
 spec:
   type: {{ .Values.serviceAnalysis.type }}
   ports:
     - port: {{ .Values.serviceAnalysis.port }}
       protocol: TCP
+      name: analysis
+      targetPort: {{ .Values.serviceAnalysis.port }}
   selector:
-    {{- include "theodolite-operator.fullname" . | nindent 4 }}
+    app: {{ include "theodolite-operator.fullname" . }}
 {{- end }}
\ No newline at end of file
diff --git a/execution/helm/theodolite-operator/templates/thedolite-operator.yaml b/execution/helm/theodolite-operator/templates/thedolite-operator.yaml
index 1d0b68db6..6ffeefd82 100644
--- a/execution/helm/theodolite-operator/templates/thedolite-operator.yaml
+++ b/execution/helm/theodolite-operator/templates/thedolite-operator.yaml
@@ -6,12 +6,12 @@ metadata:
 spec:
   selector:
     matchLabels:
-      app: theodolite
+      app: {{ include "theodolite-operator.fullname" . }}
   replicas: 1
   template:
     metadata:
       labels:
-        app: theodolite
+        app: {{ include "theodolite-operator.fullname" . }}
     spec:
       terminationGracePeriodSeconds: 0
       serviceAccountName:  {{ include "theodolite-operator.serviceAccountName" . }}
@@ -23,4 +23,11 @@ spec:
               value: {{ .Values.operator.namespace}}
         - name: lag-analysis
           image: benediktwetzel/lag-analysis
+          env:
+            - name: PORT
+              value: "8080"
+          ports:
+          - containerPort: 8080
+            name: analysis 
+          
 {{- end }}
diff --git a/execution/helm/theodolite-operator/values.yaml b/execution/helm/theodolite-operator/values.yaml
index f259913ef..80dfc235c 100644
--- a/execution/helm/theodolite-operator/values.yaml
+++ b/execution/helm/theodolite-operator/values.yaml
@@ -15,5 +15,5 @@ rbac:
   create: true
 
 serviceAnalysis:
-  type: ClusterIP
-  port: 80
+  type: NodePort
+  port: 8080
-- 
GitLab