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

msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-task.git


The following commit(s) were added to refs/heads/main by this push:
     new 9d5348a  reworked streamer
9d5348a is described below

commit 9d5348a26e548e0ecd855f8573b63a733bdbfb11
Author: Michele Sciabarra <[email protected]>
AuthorDate: Thu Jun 26 13:45:30 2025 +0200

    reworked streamer
---
 setup/nuvolaris/opsfile.yml                               |  6 ++----
 .../streamer/nginx-template.yaml                          |  0
 setup/{kubernetes => nuvolaris}/streamer/opsfile.yml      | 15 ++++++---------
 .../streamer/streamer-template.yaml                       |  0
 .../streamer/traefik-template.yaml}                       |  0
 setup/opsfile.yml                                         |  2 +-
 util/docopts.md                                           |  2 ++
 util/opsfile.yml                                          | 12 ++++++++++--
 8 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/setup/nuvolaris/opsfile.yml b/setup/nuvolaris/opsfile.yml
index 952beaa..8d8199b 100644
--- a/setup/nuvolaris/opsfile.yml
+++ b/setup/nuvolaris/opsfile.yml
@@ -230,10 +230,8 @@ tasks:
   delete:
     desc: no-op delete command
 
-
-  boh:
-    cmds:
-    - realpath web
+  streamer:
+    desc: manage the streamer deployment
 
   add-user:
     silent: true
diff --git a/setup/kubernetes/streamer/nginx-template.yaml 
b/setup/nuvolaris/streamer/nginx-template.yaml
similarity index 100%
rename from setup/kubernetes/streamer/nginx-template.yaml
rename to setup/nuvolaris/streamer/nginx-template.yaml
diff --git a/setup/kubernetes/streamer/opsfile.yml 
b/setup/nuvolaris/streamer/opsfile.yml
similarity index 87%
rename from setup/kubernetes/streamer/opsfile.yml
rename to setup/nuvolaris/streamer/opsfile.yml
index f790b10..aeed76a 100644
--- a/setup/kubernetes/streamer/opsfile.yml
+++ b/setup/nuvolaris/streamer/opsfile.yml
@@ -28,8 +28,8 @@ env:
 
   KUBECONFIG:
     sh: |
-      if test -e $(realpath "$OPS_TMP/kubeconfig")
-      then echo $(realpath "$OPS_TMP/kubeconfig")
+      if test -e "$OPS_TMP/kubeconfig"
+      then echo "$OPS_TMP/kubeconfig"
       else echo ~/.kube/config
       fi
 
@@ -46,19 +46,16 @@ env:
       fi
 
   INGRESS_TYPE:
-    sh: |
-      case "$(kubectl get ingressclass 
-ojsonpath='{.items[0].spec.controller}')" in
-        k8s.io/ingress-nginx)  echo "nginx" ;;
-        traefik.io/ingress-controller) echo "k3s" ;;
-      esac
+    sh: ops util ingress-type
 
 tasks:
-
+  
   deploy:
     silent: true
     ignore_error: false
     desc: deploy the streamer 
     cmds:
+    - test -e ${INGRESS_TYPE}-template.yaml || die "No avalable template for 
ingress type ${INGRESS_TYPE}."
     - env | grep IMAGES_STREAMER > /dev/null 2>&1 || 
       (echo "IMAGES_STREAMER is not set. Please set it to the desired image 
version." && exit 1)
     - envsubst -i streamer-template.yaml -o _streamer.yaml > /dev/null 2>&1
@@ -66,7 +63,7 @@ tasks:
     - kubectl -n nuvolaris apply -f _streamer.yaml > /dev/null 2>&1
     - kubectl -n nuvolaris apply -f _ingress.yaml > /dev/null 2>&1
     - |
-      echo "Streamer API deployed with HOSTNAME: ${STREAMER_API_HOSTNAME} and 
OW_APIHOST: ${OW_APIHOST}"
+      echo "Streamer API deployed with HOSTNAME: 
stream.${STREAMER_API_HOSTNAME} and OW_APIHOST: ${OW_APIHOST}"
 
   undeploy:
     silent: true
diff --git a/setup/kubernetes/streamer/streamer-template.yaml 
b/setup/nuvolaris/streamer/streamer-template.yaml
similarity index 100%
rename from setup/kubernetes/streamer/streamer-template.yaml
rename to setup/nuvolaris/streamer/streamer-template.yaml
diff --git a/setup/kubernetes/streamer/k3s-template.yaml 
b/setup/nuvolaris/streamer/traefik-template.yaml
similarity index 100%
rename from setup/kubernetes/streamer/k3s-template.yaml
rename to setup/nuvolaris/streamer/traefik-template.yaml
diff --git a/setup/opsfile.yml b/setup/opsfile.yml
index 1ee82a3..e431bc9 100644
--- a/setup/opsfile.yml
+++ b/setup/opsfile.yml
@@ -106,7 +106,7 @@ tasks:
       - $OPS config slim
       - $OPS config apihost miniops.me --protocol=http
       - $OPS setup devcluster
-      - $OPS setup kubernetes streamer deploy
+      - $OPS setup nuvolaris streamer deploy
       - $OPS setup nuvolaris add-user
 
   devcluster:
diff --git a/util/docopts.md b/util/docopts.md
index 70908e7..23a3d97 100644
--- a/util/docopts.md
+++ b/util/docopts.md
@@ -39,6 +39,7 @@ Usage:
   util add-secret <args>...
   util remove-secret <args>...
   util list-secrets
+  util ingress-type
 ```
 
 ## Commands
@@ -59,6 +60,7 @@ Usage:
 -  add-secret              add one or multiple secrets to user metadata
 -  remove-secret           remove one or multiple secrets to user metadata
 -  list-secrets            list secrets from user metadata
+-  ingress-type            return the ingress type
 ```
 
 ## Options
diff --git a/util/opsfile.yml b/util/opsfile.yml
index 8570da5..53252f7 100644
--- a/util/opsfile.yml
+++ b/util/opsfile.yml
@@ -212,5 +212,13 @@ tasks:
         sh: |
           echo "$OPS_ROOT/util/upload/assets"
 
-    
-
+  ingress-type:
+    desc: get ingress type
+    silent: true
+    cmds:
+      - |
+        case "$(ops util kubectl -- -o jsonpath='{.items[0].spec.controller}' 
get ingressclass)" in
+          k8s.io/ingress-nginx)  echo "nginx" ;;
+          traefik.io/ingress-controller) echo "traefik" ;;
+          *) echo "unknown" ;;
+        esac

Reply via email to