This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch 1207-improve-helm-charts
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/1207-improve-helm-charts by 
this push:
     new c6f79e2eb Update helm configuration (#1207)
c6f79e2eb is described below

commit c6f79e2eb5ac90df1049346ef128e040d78dfbfb
Author: Dominik Riemer <[email protected]>
AuthorDate: Sat Feb 11 18:55:27 2023 +0100

    Update helm configuration (#1207)
---
 .../k8s/templates/core/backend-deployment.yaml     |  2 +-
 installer/k8s/templates/core/backend-service.yaml  |  6 ++--
 installer/k8s/templates/core/ui-configmap.yaml     | 33 ++++++++--------------
 installer/k8s/templates/core/ui-ingress.yaml       | 11 +++++++-
 installer/k8s/templates/core/ui-service.yaml       |  6 ++--
 .../k8s/templates/external/nats/nats-service.yaml  |  2 ++
 installer/k8s/values.yaml                          | 12 +++++++-
 7 files changed, 41 insertions(+), 31 deletions(-)

diff --git a/installer/k8s/templates/core/backend-deployment.yaml 
b/installer/k8s/templates/core/backend-deployment.yaml
index bd0d081d1..52c146fb2 100644
--- a/installer/k8s/templates/core/backend-deployment.yaml
+++ b/installer/k8s/templates/core/backend-deployment.yaml
@@ -43,7 +43,7 @@ spec:
             - name: SP_PRIORITIZED_PROTOCOL
               value: {{ .Values.preferredBroker }}
           ports:
-            - containerPort: 8030
+            - containerPort: {{ .Values.streampipes.core.port }}
           volumeMounts:
             - mountPath: "/root/.streampipes"
               name: {{ .Values.streampipes.core.persistence.pvName }}
diff --git a/installer/k8s/templates/core/backend-service.yaml 
b/installer/k8s/templates/core/backend-service.yaml
index 64c3fa511..aa213c77a 100644
--- a/installer/k8s/templates/core/backend-service.yaml
+++ b/installer/k8s/templates/core/backend-service.yaml
@@ -16,12 +16,12 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ .Values.streampipes.core.svcName }}
+  name: {{ .Values.streampipes.core.service.name }}
 spec:
   selector:
     app: {{ .Values.streampipes.core.appName }}
   ports:
     - name: main
       protocol: TCP
-      port: 8030
-      targetPort: 8030
+      port: {{ .Values.streampipes.core.service.port }}
+      targetPort: {{ .Values.streampipes.core.port }}
diff --git a/installer/k8s/templates/core/ui-configmap.yaml 
b/installer/k8s/templates/core/ui-configmap.yaml
index 6085b088b..2364bdb8f 100644
--- a/installer/k8s/templates/core/ui-configmap.yaml
+++ b/installer/k8s/templates/core/ui-configmap.yaml
@@ -22,6 +22,7 @@ data:
     server {
       listen {{ .Values.streampipes.ui.port }} default_server;
       resolver 127.0.0.11;
+      
       root /usr/share/nginx/html;
     
       # Enable gzip compression
@@ -32,30 +33,18 @@ data:
       gzip_vary on;
       gzip_comp_level 6;
       gzip_buffers 16 8k;
-      gzip_http_version 1.1;
+      gzip_http_version 1.1;    
     
       location /streampipes-backend {
-        set $upstream {{ .Values.streampipes.core.svcName }}:8030;
-        
-        proxy_set_header X-Real-IP $remote_addr;
-        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-        proxy_set_header X-NginX-Proxy true;
-        proxy_pass http://$upstream;
-        proxy_ssl_session_reuse off;
-        proxy_set_header Host $http_host;
-        proxy_redirect off;
+      set $upstream {{ .Values.streampipes.core.svcName }}:8030;
+  
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+      proxy_set_header X-NginX-Proxy true;
+      proxy_pass http://$upstream;
+      proxy_ssl_session_reuse off;
+      proxy_set_header Host $http_host;
+      proxy_redirect off;
       }
-    
-      location /streampipes-connect/ {
-        set $upstream {{ .Values.streampipes.core.svcName }}:8030;
-        
-        proxy_set_header X-Real-IP $remote_addr;
-        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-        proxy_set_header X-NginX-Proxy true;
-        proxy_pass http://$upstream;
-        proxy_ssl_session_reuse off;
-        proxy_set_header Host $http_host;
-      }
-    
     }
 
diff --git a/installer/k8s/templates/core/ui-ingress.yaml 
b/installer/k8s/templates/core/ui-ingress.yaml
index 77dd8a5ee..6f9259f88 100644
--- a/installer/k8s/templates/core/ui-ingress.yaml
+++ b/installer/k8s/templates/core/ui-ingress.yaml
@@ -18,6 +18,7 @@ kind: Ingress
 metadata:
   name: streampipes
 spec:
+  #ingressClass: {{ .Values.streampipes.ui.ingressClass }}
   rules:
   - http:
       paths:
@@ -27,4 +28,12 @@ spec:
           service: 
             name: {{ .Values.streampipes.ui.appName }}
             port: 
-              number: {{ .Values.streampipes.ui.port }}
+              number: {{ .Values.streampipes.ui.service.port }}
+      - path: /streampipes-backend(/|$)(.*)
+        pathType: Prefix
+        backend:
+          service:
+            name: {{ .Values.streampipes.core.appName }}
+            port:
+              number: {{ .Values.streampipes.core.service.port }}
+
diff --git a/installer/k8s/templates/core/ui-service.yaml 
b/installer/k8s/templates/core/ui-service.yaml
index c380df066..6308ffe8b 100644
--- a/installer/k8s/templates/core/ui-service.yaml
+++ b/installer/k8s/templates/core/ui-service.yaml
@@ -16,13 +16,13 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ .Values.streampipes.ui.appName }}
+  name: {{ .Values.streampipes.ui.service.name }}
 spec:
   selector:
     app: {{ .Values.streampipes.ui.appName }}
-  type: NodePort
+  type: {{ .Values.streampipes.ui.service.type }}
   ports:
     - name: main
       protocol: TCP
-      port: {{ .Values.streampipes.ui.port }}
+      port: {{ .Values.streampipes.ui.service.port }}
       targetPort: {{ .Values.streampipes.ui.port }}
diff --git a/installer/k8s/templates/external/nats/nats-service.yaml 
b/installer/k8s/templates/external/nats/nats-service.yaml
index a243534dd..cfc9d3f8b 100644
--- a/installer/k8s/templates/external/nats/nats-service.yaml
+++ b/installer/k8s/templates/external/nats/nats-service.yaml
@@ -23,6 +23,8 @@ metadata:
 spec:
   selector:
     app: nats
+  type: {{ .Values.external.nats.service.type }}
+  externalTrafficPolicy: {{ 
.Values.external.nats.service.externalTrafficPolicy }}
   ports:
     - name: main
       protocol: TCP
diff --git a/installer/k8s/values.yaml b/installer/k8s/values.yaml
index 8663e18b0..81fa886e3 100644
--- a/installer/k8s/values.yaml
+++ b/installer/k8s/values.yaml
@@ -25,13 +25,20 @@ streampipes:
   registry: "apachestreampipes"
   core:
     appName: "backend"
-    svcName: "backend"
+    port: 8030
     persistence:
       storageClassName: ""
       claimName: "backend-pvc"
       pvName: "backend-pv"
+    service:
+      name: "backend"
+      port: 8030
   ui:
     appName: "ui"
+    service:
+      type: "LoadBalancer"
+      nodePort: 8088
+      port: 8088
     port: 8088
 
 external:
@@ -69,6 +76,9 @@ external:
       pvNameV1: "influxdb-pv"
   nats:
     appName: "nats"
+    service:
+      type: "LoadBalancer"
+      externalTrafficPolicy: "Local"
     version:
   kafkaVersion: 2.2.0
   zookeeperVersion: 3.4.13

Reply via email to