From d9667651c41a35c7bd69e09f20ee5e61fb6d6311 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Tue, 8 Jul 2025 16:57:06 +0200 Subject: [PATCH 01/21] perform serverless instalation on master after Kubevela is instaled --- .../MASTER_START_SCRIPT.sh | 139 +++++++++--------- 1 file changed, 73 insertions(+), 66 deletions(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 87cd7ff..05ee186 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -50,13 +50,83 @@ echo "Setting KubeVela..." # Function to check for worker nodes and install KubeVela cat > /home/ubuntu/install_kubevela.sh << 'EOF' #!/bin/bash +sudo -H -E -u ubuntu bash -c 'nohup vela install --version 1.9.11' +if [ "$SERVERLESS_ENABLED" == "yes" ]; then + echo "Serverless installation." + + # Install Cosign + export COSIGN_VERSION=$(curl -s https://api.github.com/repos/sigstore/cosign/releases/latest | jq -r '.tag_name') + curl -LO "https://github.com/sigstore/cosign/releases/download/${COSIGN_VERSION}/cosign-linux-amd64" + sudo mv cosign-linux-amd64 /usr/local/bin/cosign + sudo chmod +x /usr/local/bin/cosign + + # Update system and install jq + sudo apt update + sudo apt install -y jq + + # Apply Knative Serving CRDs and core components + kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-crds.yaml + kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-core.yaml + + # Download and apply Kourier + wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/kourier.yaml + kubectl apply -f kourier.yaml + + wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/serverless-platform-definition.yaml + kubectl apply -f serverless-platform-definition.yaml + + wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/config-features.yaml + kubectl apply -f config-features.yaml + + # Patch config-domain with PUBLIC_IP + MASTER_IP=$(curl -s ifconfig.me) + + # Patch config-domain with MASTER_IP + kubectl patch configmap/config-domain \ + --namespace knative-serving \ + --type merge \ + --patch "{\"data\":{\"${MASTER_IP}.sslip.io\":\"\"}}" + + # Patch config-network to use Kourier ingress + kubectl patch configmap/config-network \ + --namespace knative-serving \ + --type merge \ + --patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}' + + # Apply default domain configuration + kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-default-domain.yaml + + kubectl apply -f https://raw.githubusercontent.com/kubevela/samples/master/06.Knative_App/componentdefinition-knative-serving.yaml + + if [ -n "$LOCAL_SERVERLESS_SERVICES" ]; then + echo "LOCAL_SERVERLESS_SERVICES is set to: $LOCAL_SERVERLESS_SERVICES" + + sudo wget -q -O /usr/local/bin/label-serverless-services.sh \ + https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/label-serverless-services.sh + + sudo chmod +x /usr/local/bin/label-serverless-services.sh + + sudo touch /var/log/label-serverless-services.log + sudo chown ubuntu:ubuntu /var/log/label-serverless-services.log + + nohup /usr/local/bin/label-serverless-services.sh \ + >> /var/log/label-serverless-services.log 2>&1 & + fi +fi + +EOF + +chmod +x /home/ubuntu/install_kubevela.sh + +cat > /home/ubuntu/kubevela_installer_service.sh << 'EOF' +#!/bin/bash # Wait for at least one worker node to be ready while true; do WORKER_NODES=$(sudo -H -E -u ubuntu kubectl get nodes --selector='!node-role.kubernetes.io/control-plane' -o json | jq '.items | length') if [ "$WORKER_NODES" -gt 0 ]; then echo "$(date '+%Y-%m-%d %H:%M:%S') - Found $WORKER_NODES worker node(s), proceeding with KubeVela installation..." >> /home/ubuntu/vela.txt - sudo -H -E -u ubuntu bash -c 'nohup vela install --version 1.9.11 >> /home/ubuntu/vela.txt 2>&1' + ./home/ubuntu/install_kubevela.sh >> /home/ubuntu/vela.txt 2>&1 # Disable the service after successful installation sudo systemctl disable kubevela-installer.service exit 0 @@ -65,8 +135,7 @@ while true; do sleep 10 done EOF - -chmod +x /home/ubuntu/install_kubevela.sh +chmod +x /home/ubuntu/kubevela_installer_service.sh # Create systemd service file cat << 'EOF' | sudo tee /etc/systemd/system/kubevela-installer.service @@ -77,7 +146,7 @@ After=network.target [Service] Type=simple User=ubuntu -ExecStart=/home/ubuntu/install_kubevela.sh +ExecStart=/home/ubuntu/kubevela_installer_service.sh Restart=no [Install] @@ -126,68 +195,6 @@ $dau bash -c 'helm install solver nebulous/nebulous-optimiser-solver \ echo "Add volumes provisioner" $dau bash -c "kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.27/deploy/local-path-storage.yaml" -if [ "$SERVERLESS_ENABLED" == "yes" ]; then - echo "Serverless installation." - - # Install Cosign - export COSIGN_VERSION=$(curl -s https://api.github.com/repos/sigstore/cosign/releases/latest | jq -r '.tag_name') - curl -LO "https://github.com/sigstore/cosign/releases/download/${COSIGN_VERSION}/cosign-linux-amd64" - sudo mv cosign-linux-amd64 /usr/local/bin/cosign - sudo chmod +x /usr/local/bin/cosign - - # Update system and install jq - sudo apt update - sudo apt install -y jq - - # Apply Knative Serving CRDs and core components - kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-crds.yaml - kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-core.yaml - - # Download and apply Kourier - wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/kourier.yaml - kubectl apply -f kourier.yaml - - wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/serverless-platform-definition.yaml - kubectl apply -f serverless-platform-definition.yaml - - wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/config-features.yaml - kubectl apply -f config-features.yaml - - # Patch config-domain with PUBLIC_IP - MASTER_IP=$(curl -s ifconfig.me) - - # Patch config-domain with MASTER_IP - kubectl patch configmap/config-domain \ - --namespace knative-serving \ - --type merge \ - --patch "{\"data\":{\"${MASTER_IP}.sslip.io\":\"\"}}" - - # Patch config-network to use Kourier ingress - kubectl patch configmap/config-network \ - --namespace knative-serving \ - --type merge \ - --patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}' - - # Apply default domain configuration - kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-default-domain.yaml - - kubectl apply -f https://raw.githubusercontent.com/kubevela/samples/master/06.Knative_App/componentdefinition-knative-serving.yaml - - if [ -n "$LOCAL_SERVERLESS_SERVICES" ]; then - echo "LOCAL_SERVERLESS_SERVICES is set to: $LOCAL_SERVERLESS_SERVICES" - - sudo wget -q -O /usr/local/bin/label-serverless-services.sh \ - https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/label-serverless-services.sh - - sudo chmod +x /usr/local/bin/label-serverless-services.sh - - sudo touch /var/log/label-serverless-services.log - sudo chown ubuntu:ubuntu /var/log/label-serverless-services.log - - nohup /usr/local/bin/label-serverless-services.sh \ - >> /var/log/label-serverless-services.log 2>&1 & - fi -fi if [ "$WORKFLOW_ENABLED" == "yes" ]; then echo "Workflow installation."; From 524a13f358cf8eb5ba77a9a02cabddbcff91cc38 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Wed, 9 Jul 2025 12:45:33 +0200 Subject: [PATCH 02/21] minor improvements vela and serverless installation --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 05ee186..7aa8b79 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -50,7 +50,9 @@ echo "Setting KubeVela..." # Function to check for worker nodes and install KubeVela cat > /home/ubuntu/install_kubevela.sh << 'EOF' #!/bin/bash -sudo -H -E -u ubuntu bash -c 'nohup vela install --version 1.9.11' +echo "Start install_kubevela.sh" +sudo -H -E -u ubuntu bash -c 'vela install -y --version 1.9.11' +echo "Vela installation done." if [ "$SERVERLESS_ENABLED" == "yes" ]; then echo "Serverless installation." @@ -113,7 +115,7 @@ if [ "$SERVERLESS_ENABLED" == "yes" ]; then >> /var/log/label-serverless-services.log 2>&1 & fi fi - +echo "End install_kubevela.sh" EOF chmod +x /home/ubuntu/install_kubevela.sh @@ -126,7 +128,7 @@ while true; do WORKER_NODES=$(sudo -H -E -u ubuntu kubectl get nodes --selector='!node-role.kubernetes.io/control-plane' -o json | jq '.items | length') if [ "$WORKER_NODES" -gt 0 ]; then echo "$(date '+%Y-%m-%d %H:%M:%S') - Found $WORKER_NODES worker node(s), proceeding with KubeVela installation..." >> /home/ubuntu/vela.txt - ./home/ubuntu/install_kubevela.sh >> /home/ubuntu/vela.txt 2>&1 + /home/ubuntu/install_kubevela.sh >> /home/ubuntu/vela.txt 2>&1 # Disable the service after successful installation sudo systemctl disable kubevela-installer.service exit 0 From f4ac245392471166f0b7a753ccd4dc4eba3ce964 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Wed, 9 Jul 2025 15:05:21 +0200 Subject: [PATCH 03/21] Pass serverless env vars to kubevela-installer.service --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 7aa8b79..ff44e66 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -140,7 +140,7 @@ EOF chmod +x /home/ubuntu/kubevela_installer_service.sh # Create systemd service file -cat << 'EOF' | sudo tee /etc/systemd/system/kubevela-installer.service +cat << EOF | sudo tee /etc/systemd/system/kubevela-installer.service [Unit] Description=KubeVela One-time Installer Service After=network.target @@ -150,6 +150,8 @@ Type=simple User=ubuntu ExecStart=/home/ubuntu/kubevela_installer_service.sh Restart=no +Environment="LOCAL_SERVERLESS_SERVICES=${LOCAL_SERVERLESS_SERVICES}" +Environment="SERVERLESS_ENABLED=${SERVERLESS_ENABLED}" [Install] WantedBy=multi-user.target From 9855188d366280b09336040b16567471a499b3bb Mon Sep 17 00:00:00 2001 From: Iqqdd99 <43526636+Iqqdd99@users.noreply.github.com> Date: Mon, 21 Jul 2025 16:55:50 +0200 Subject: [PATCH 04/21] Added workflow installation (#65) --- .../MASTER_START_SCRIPT.sh | 33 +------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index ff44e66..d228f6f 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -203,38 +203,7 @@ $dau bash -c "kubectl apply -f https://raw.githubusercontent.com/rancher/local-p if [ "$WORKFLOW_ENABLED" == "yes" ]; then echo "Workflow installation."; - $dau bash -c 'helm install argo-workflows argo-workflows \ - --repo https://argoproj.github.io/argo-helm \ - --namespace argo \ - --create-namespace \ - --set crds.install=true \ - --set crds.keep=false \ - --set workflow.serviceAccount.create=true \ - --set workflow.serviceAccount.name="argo" \ - --set workflow.rbac.create=true \ - --set "controller.workflowNamespaces={argo}" \ - --set controller.metricsConfig.enabled=true \ - --set controller.telemetryConfig.enabled=true \ - --set controller.serviceMonitor.enabled=true \ - --set "server.authModes={server}" \ - --set "controller.tolerations[0].effect=NoSchedule" \ - --set "controller.tolerations[0].key=node.kubernetes.io/unschedulable" \ - --set "controller.tolerations[0].operator=Exists" \ - --set "controller.tolerations[1].effect=NoSchedule" \ - --set "controller.tolerations[1].operator=Exists" \ - --set "controller.priorityClassName=system-node-critical" \ - --set controller.nodeSelector.node-role\\.kubernetes\\.io/control-plane="" \ - --set "server.tolerations[0].effect=NoSchedule" \ - --set "server.tolerations[0].key=node.kubernetes.io/unschedulable" \ - --set "server.tolerations[0].operator=Exists" \ - --set "server.tolerations[1].effect=NoSchedule" \ - --set "server.tolerations[1].operator=Exists" \ - --set "server.priorityClassName=system-node-critical" \ - --set server.nodeSelector.node-role\\.kubernetes\\.io/control-plane=""' - - sudo -H -E -u ubuntu bash -c 'kubectl -n argo create rolebinding argo-workflows-server --role=argo-workflows-workflow --serviceaccount=argo:argo-workflows-server' - sudo -H -E -u ubuntu bash -c 'kubectl -n argo create rolebinding argo-workflows-workflow-controller --role=argo-workflows-workflow --serviceaccount=argo:argo-workflows-workflow-controller' - sudo -H -E -u ubuntu bash -c 'kubectl -n argo create rolebinding default --role=argo-workflows-workflow --serviceaccount=argo:default' + $dau bash -c 'helm install -n argo nebulous-workflow-executor nebulous/nebulous-workflow-executor --create-namespace' $dau bash -c "kubectl -n argo create secret docker-registry regcred --docker-server=$PRIVATE_DOCKER_REGISTRY_SERVER --docker-username=$PRIVATE_DOCKER_REGISTRY_USERNAME --docker-password=$PRIVATE_DOCKER_REGISTRY_PASSWORD --docker-email=$PRIVATE_DOCKER_REGISTRY_EMAIL" $dau bash -c 'kubectl -n argo patch serviceaccount default -p "{\"imagePullSecrets\": [{\"name\": \"regcred\"}]}"' From 275cc5ffc2555aafdcc352c570604be894741f5e Mon Sep 17 00:00:00 2001 From: Nikos Papageorgopoulos <150338288+npapageorgopoulos12@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:18:06 +0100 Subject: [PATCH 05/21] add security manager on main (#68) - added else on $CONTAINERIZATION_FLAVOR for env KUBECONFIG - added security-manager helm chart -opa-gatekeeper bash script installation --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index d228f6f..ebcad23 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -12,6 +12,9 @@ echo "NEBULOUS_SCRIPTS_BRANCH is set to: $NEBULOUS_SCRIPTS_BRANCH" if [[ "$CONTAINERIZATION_FLAVOR" == "k3s" ]]; then export KUBECONFIG=/etc/rancher/k3s/k3s.yaml echo "KUBECONFIG=${KUBECONFIG}" | sudo tee -a /etc/environment +else + export KUBECONFIG=/home/ubuntu/.kube/config + echo "KUBECONFIG=${KUBECONFIG}" | sudo tee -a /etc/environment fi while true; do @@ -211,3 +214,15 @@ if [ "$WORKFLOW_ENABLED" == "yes" ]; then echo "Workflow installation completed."; fi +echo "Installing OPA Gatekeeper..." +wget https://raw.githubusercontent.com/eu-nebulous/security-manager/dev/OPA-GATEKEEPER-INSTALL.sh +chmod +x OPA-GATEKEEPER-INSTALL.sh +./OPA-GATEKEEPER-INSTALL.sh + +echo "Installing Security Manager..." +$dau bash -c 'helm install security-manager nebulous/nebulous-security-manager \ + --set-file configMap.k3sConfig="$KUBECONFIG" \ + --set tolerations[0].key="node-role.kubernetes.io/control-plane" \ + --set tolerations[0].operator="Exists" \ + --set tolerations[0].effect="NoSchedule"' + From f8fa6bd0f86aa40aceb73f35021e4c07f792a497 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Mon, 1 Sep 2025 12:13:28 +0200 Subject: [PATCH 06/21] fixes in serverless installation --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index ebcad23..f226f44 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -61,7 +61,7 @@ if [ "$SERVERLESS_ENABLED" == "yes" ]; then # Install Cosign export COSIGN_VERSION=$(curl -s https://api.github.com/repos/sigstore/cosign/releases/latest | jq -r '.tag_name') - curl -LO "https://github.com/sigstore/cosign/releases/download/${COSIGN_VERSION}/cosign-linux-amd64" + sudo curl -LO "https://github.com/sigstore/cosign/releases/download/${COSIGN_VERSION}/cosign-linux-amd64" sudo mv cosign-linux-amd64 /usr/local/bin/cosign sudo chmod +x /usr/local/bin/cosign @@ -74,13 +74,13 @@ if [ "$SERVERLESS_ENABLED" == "yes" ]; then kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-core.yaml # Download and apply Kourier - wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/kourier.yaml + sudo wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/kourier.yaml kubectl apply -f kourier.yaml - wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/serverless-platform-definition.yaml + sudo wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/serverless-platform-definition.yaml kubectl apply -f serverless-platform-definition.yaml - wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/config-features.yaml + sudo wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/config-features.yaml kubectl apply -f config-features.yaml # Patch config-domain with PUBLIC_IP @@ -155,6 +155,8 @@ ExecStart=/home/ubuntu/kubevela_installer_service.sh Restart=no Environment="LOCAL_SERVERLESS_SERVICES=${LOCAL_SERVERLESS_SERVICES}" Environment="SERVERLESS_ENABLED=${SERVERLESS_ENABLED}" +Environment="APPLICATION_ID=${APPLICATION_ID}" +Environment="NEBULOUS_SCRIPTS_BRANCH=${NEBULOUS_SCRIPTS_BRANCH}" [Install] WantedBy=multi-user.target From f437b9f7d4b6695549c62c2e45e43ce85b3293b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Tue, 2 Sep 2025 09:37:17 +0200 Subject: [PATCH 07/21] Extend `knative-serving` component (#64) Own the `knative-serving` component instead of using the example. This allows controlling additional fields that we need. Additionally, configure the serverless platform to support the new features. Co-authored-by: robert-sanfeliu --- .../MASTER_START_SCRIPT.sh | 6 +- serverless/config-features.yaml | 4 +- serverless/knative-serving-definition.yaml | 91 +++++++++++++++++++ 3 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 serverless/knative-serving-definition.yaml diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index f226f44..76a3a9b 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -80,6 +80,10 @@ if [ "$SERVERLESS_ENABLED" == "yes" ]; then sudo wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/serverless-platform-definition.yaml kubectl apply -f serverless-platform-definition.yaml + + sudo wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/knative-serving-definition.yaml + kubectl apply -f knative-serving-definition.yaml + sudo wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/config-features.yaml kubectl apply -f config-features.yaml @@ -101,8 +105,6 @@ if [ "$SERVERLESS_ENABLED" == "yes" ]; then # Apply default domain configuration kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-default-domain.yaml - kubectl apply -f https://raw.githubusercontent.com/kubevela/samples/master/06.Knative_App/componentdefinition-knative-serving.yaml - if [ -n "$LOCAL_SERVERLESS_SERVICES" ]; then echo "LOCAL_SERVERLESS_SERVICES is set to: $LOCAL_SERVERLESS_SERVICES" diff --git a/serverless/config-features.yaml b/serverless/config-features.yaml index f131259..7c7118a 100644 --- a/serverless/config-features.yaml +++ b/serverless/config-features.yaml @@ -50,13 +50,13 @@ data: # # WARNING: Cannot safely be disabled once enabled. # See: https://knative.dev/docs/serving/feature-flags/#kubernetes-node-selector - kubernetes.podspec-nodeselector: "disabled" + kubernetes.podspec-nodeselector: "enabled" # Indicates whether Kubernetes tolerations support is enabled # # WARNING: Cannot safely be disabled once enabled # See: https://knative.dev/docs/serving/feature-flags/#kubernetes-toleration - kubernetes.podspec-tolerations: "disabled" + kubernetes.podspec-tolerations: "enabled" # Indicates whether Kubernetes FieldRef support is enabled # diff --git a/serverless/knative-serving-definition.yaml b/serverless/knative-serving-definition.yaml new file mode 100644 index 0000000..c6c036b --- /dev/null +++ b/serverless/knative-serving-definition.yaml @@ -0,0 +1,91 @@ +apiVersion: core.oam.dev/v1beta1 +kind: ComponentDefinition +metadata: + name: knative-serving + annotations: + definition.oam.dev/description: "Knative serving." +spec: + workload: + definition: + apiVersion: serving.knative.dev/v1 + kind: Service + schematic: + cue: + template: | + output: { + apiVersion: "serving.knative.dev/v1" + kind: "Service" + metadata: { + name: context.name + labels: { + "app.oam.dev/component": context.name + } + annotations: parameter.annotations + } + spec: { + template: + spec: + containers: [{ + image: parameter.image + env: parameter.env + resources: parameter.resources + nodeSelector: parameter.nodeSelector + tolerations: parameter.tolerations + affinity: parameter.affinity + }] + } + } + parameter: { + annotations?: { + [string]: string + } + image: string + env?: [...{ + // +usage=Environment variable name + name: string + // +usage=The value of the environment variable + value?: string + // +usage=Specifies a source the value of this var should come from + valueFrom?: { + // +usage=Selects a key of a secret in the pod's namespace + secretKeyRef: { + // +usage=The name of the secret in the pod's namespace to select from + name: string + // +usage=The key of the secret to select from. Must be a valid secret key + key: string + } + } + }] + resources?: { + limits?: { + cpu?: string + memory?: string + } + requests?: { + cpu?: string + memory?: string + } + } + nodeSelector?: { + [string]: string + } + tolerations?: [...{ + key: string + operator?: string + value?: string + effect?: string + }] + affinity?: { + nodeAffinity?: { + requiredDuringSchedulingIgnoredDuringExecution?: { + nodeSelectorTerms: [...{ + matchExpressions: [...{ + key: string + operator: string + values?: [...string] + }] + }] + } + } + } + } From e67eaeddf25a76f906b85164cb8f52d8a7d89d41 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Tue, 2 Sep 2025 10:45:45 +0200 Subject: [PATCH 08/21] added missing KUBECONFIG for kubevela install --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 76a3a9b..7ecf7b8 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -159,6 +159,7 @@ Environment="LOCAL_SERVERLESS_SERVICES=${LOCAL_SERVERLESS_SERVICES}" Environment="SERVERLESS_ENABLED=${SERVERLESS_ENABLED}" Environment="APPLICATION_ID=${APPLICATION_ID}" Environment="NEBULOUS_SCRIPTS_BRANCH=${NEBULOUS_SCRIPTS_BRANCH}" +Environment="KUBECONFIG=${KUBECONFIG}" [Install] WantedBy=multi-user.target From acf167616e8007ab298447a73b303404c01df4e5 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Tue, 2 Sep 2025 12:10:16 +0200 Subject: [PATCH 09/21] add kubevela install debug messages --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 7ecf7b8..7e49ada 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -54,6 +54,9 @@ echo "Setting KubeVela..." cat > /home/ubuntu/install_kubevela.sh << 'EOF' #!/bin/bash echo "Start install_kubevela.sh" +echo "-----${KUBECONFIG}---------" +sudo cat ${KUBECONFIG} +echo "--------------" sudo -H -E -u ubuntu bash -c 'vela install -y --version 1.9.11' echo "Vela installation done." if [ "$SERVERLESS_ENABLED" == "yes" ]; then From 2b1c5be328a84b2083528e629d53c6a78fdfd792 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Mon, 8 Sep 2025 15:52:36 +0200 Subject: [PATCH 10/21] add vela installation test --- .../MASTER_START_SCRIPT.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 7e49ada..37e6896 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -131,15 +131,28 @@ chmod +x /home/ubuntu/install_kubevela.sh cat > /home/ubuntu/kubevela_installer_service.sh << 'EOF' #!/bin/bash +is_vela_installed() { + if vela ls &>/dev/null; then + exit 0 + else + exit 1 + fi +} + # Wait for at least one worker node to be ready while true; do WORKER_NODES=$(sudo -H -E -u ubuntu kubectl get nodes --selector='!node-role.kubernetes.io/control-plane' -o json | jq '.items | length') if [ "$WORKER_NODES" -gt 0 ]; then echo "$(date '+%Y-%m-%d %H:%M:%S') - Found $WORKER_NODES worker node(s), proceeding with KubeVela installation..." >> /home/ubuntu/vela.txt /home/ubuntu/install_kubevela.sh >> /home/ubuntu/vela.txt 2>&1 - # Disable the service after successful installation - sudo systemctl disable kubevela-installer.service - exit 0 + if is_vela_installed; then + # Disable the service after successful installation + sudo systemctl disable kubevela-installer.service + exit 0 + else + echo "'vela ls' returned an error. Trying again in 30 seconds..." >> /home/ubuntu/vela.txt + sleep 30 + fi fi echo "$(date '+%Y-%m-%d %H:%M:%S') - Waiting for worker nodes to be ready..." >> /home/ubuntu/vela.txt sleep 10 From e188b186c9260a383b1be603e3ae23cab31a7b69 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Mon, 8 Sep 2025 16:31:00 +0200 Subject: [PATCH 11/21] improvements is_vela_installed --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 37e6896..87646d7 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -133,9 +133,9 @@ cat > /home/ubuntu/kubevela_installer_service.sh << 'EOF' is_vela_installed() { if vela ls &>/dev/null; then - exit 0 + return 0 else - exit 1 + return 1 fi } From 58104604cb392ed1ebf8bd8deda9a3559e23922e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Tue, 9 Sep 2025 09:43:59 +0200 Subject: [PATCH 12/21] Adapt the knative-serving definition to needs (#70) Make it compatible with bundled traits by filtering optional parameters. Closes #69 --- serverless/knative-serving-definition.yaml | 48 ++++++++-------------- 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/serverless/knative-serving-definition.yaml b/serverless/knative-serving-definition.yaml index c6c036b..195d919 100644 --- a/serverless/knative-serving-definition.yaml +++ b/serverless/knative-serving-definition.yaml @@ -20,26 +20,32 @@ spec: labels: { "app.oam.dev/component": context.name } - annotations: parameter.annotations } spec: { template: spec: containers: [{ - image: parameter.image - env: parameter.env - resources: parameter.resources - nodeSelector: parameter.nodeSelector - tolerations: parameter.tolerations - affinity: parameter.affinity + name: context.name + + image: parameter.image + + if parameter.imagePullPolicy != _|_ { + imagePullPolicy: parameter.imagePullPolicy + } + + if parameter.env != _|_ { + env: parameter.env + } + + if parameter.resources != _|_ { + resources: parameter.resources + } }] } } parameter: { - annotations?: { - [string]: string - } image: string + imagePullPolicy?: string env?: [...{ // +usage=Environment variable name name: string @@ -66,26 +72,4 @@ spec: memory?: string } } - nodeSelector?: { - [string]: string - } - tolerations?: [...{ - key: string - operator?: string - value?: string - effect?: string - }] - affinity?: { - nodeAffinity?: { - requiredDuringSchedulingIgnoredDuringExecution?: { - nodeSelectorTerms: [...{ - matchExpressions: [...{ - key: string - operator: string - values?: [...string] - }] - }] - } - } - } } From 5c297c314e28cc52f386631649158bb989905662 Mon Sep 17 00:00:00 2001 From: ipatini <3739531+ipatini@users.noreply.github.com> Date: Fri, 19 Sep 2025 12:22:45 +0300 Subject: [PATCH 13/21] Updated MASTER_START_SCRIPT.sh in order to use 'main' EMS client image (#73) --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 87646d7..007ba0f 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -203,7 +203,8 @@ $dau bash -c 'helm install ems nebulous/ems-server \ --set tolerations[0].effect="NoSchedule" \ --set app_uuid=$APPLICATION_ID \ --set broker_address=$BROKER_ADDRESS \ - --set image.tag="latest" \ + --set image.tag="main" \ + --set client.image.tag="ems-client-main" \ --set broker_port=$BROKER_PORT' From db391860a4c85dc110ea69d47b9b634cd6edf9b7 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Tue, 30 Sep 2025 11:17:19 +0200 Subject: [PATCH 14/21] ems-server install use $NEBULOUS_SCRIPTS_BRANCH env var --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 007ba0f..b5e330f 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -203,7 +203,7 @@ $dau bash -c 'helm install ems nebulous/ems-server \ --set tolerations[0].effect="NoSchedule" \ --set app_uuid=$APPLICATION_ID \ --set broker_address=$BROKER_ADDRESS \ - --set image.tag="main" \ + --set image.tag=$NEBULOUS_SCRIPTS_BRANCH \ --set client.image.tag="ems-client-main" \ --set broker_port=$BROKER_PORT' From 0a5dbedb3b8231efd1c73104a93f8c1a340678e8 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Tue, 30 Sep 2025 11:21:23 +0200 Subject: [PATCH 15/21] set ems client.image.tag based on $NEBULOUS_SCRIPTS_BRANCH --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index b5e330f..bee08f9 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -204,7 +204,7 @@ $dau bash -c 'helm install ems nebulous/ems-server \ --set app_uuid=$APPLICATION_ID \ --set broker_address=$BROKER_ADDRESS \ --set image.tag=$NEBULOUS_SCRIPTS_BRANCH \ - --set client.image.tag="ems-client-main" \ + --set client.image.tag="ems-client-$NEBULOUS_SCRIPTS_BRANCH" \ --set broker_port=$BROKER_PORT' From dbc0c82c5a4191021e91c7cdbf3fef5b8328643b Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Tue, 30 Sep 2025 13:12:43 +0200 Subject: [PATCH 16/21] replaced incorrect dash char from install-kube scripts --- k8s/install-kube-u22-wg.sh | 2 +- k8s/install-kube-u22.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/install-kube-u22-wg.sh b/k8s/install-kube-u22-wg.sh index 0483d71..dd50ae6 100644 --- a/k8s/install-kube-u22-wg.sh +++ b/k8s/install-kube-u22-wg.sh @@ -146,7 +146,7 @@ if [ `grep Swap /proc/meminfo | grep SwapTotal: | cut -d" " -f14` == "0" ]; then log_print INFO "The swap memory is Off" else - sudo swapoff –a || { log_print ERROR "swap memory can't be turned off "; exit $EXITCODE; } + sudo swapoff -a || { log_print ERROR "swap memory can't be turned off "; exit $EXITCODE; } fi diff --git a/k8s/install-kube-u22.sh b/k8s/install-kube-u22.sh index 3c745b7..c014fd4 100644 --- a/k8s/install-kube-u22.sh +++ b/k8s/install-kube-u22.sh @@ -123,7 +123,7 @@ if [ `grep Swap /proc/meminfo | grep SwapTotal: | cut -d" " -f14` == "0" ]; then log_print INFO "The swap memory is Off" else - sudo swapoff –a || { log_print ERROR "swap memory can't be turned off "; exit $EXITCODE; } + sudo swapoff -a || { log_print ERROR "swap memory can't be turned off "; exit $EXITCODE; } fi From 3dc7b6cc771e1473eb8a919824246ecfb81e799f Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Tue, 21 Oct 2025 15:28:17 +0200 Subject: [PATCH 17/21] use flannel instead of cilium --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index bee08f9..9ec01f0 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -41,9 +41,9 @@ then else echo "User Ubuntu is not found" fi -#$dau kubectl apply -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml; -$dau bash -c 'helm repo add cilium https://helm.cilium.io/ && helm repo update' -$dau bash -c 'helm install cilium cilium/cilium --namespace kube-system --set encryption.enabled=true --set encryption.type=wireguard' +$dau bash -c 'kubectl apply -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml'; +#$dau bash -c 'helm repo add cilium https://helm.cilium.io/ && helm repo update' +#$#dau bash -c 'helm install cilium cilium/cilium --namespace kube-system --set encryption.enabled=true --set encryption.type=wireguard' echo "Installing Vela CLI" $dau bash -c 'curl -fsSl https://kubevela.io/script/install.sh | bash' From f12b021bbcb514825cd373badea05e36e8bda24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= Date: Wed, 22 Oct 2025 12:20:35 +0200 Subject: [PATCH 18/21] Pin kubevela and knative to control-plane (#74) This way they don't interfere with resources dedicated to deployed apps. --- .../MASTER_START_SCRIPT.sh | 31 ++++++++++++++++++- serverless/kourier.yaml | 12 +++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 9ec01f0..89af8ac 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -49,6 +49,31 @@ echo "Installing Vela CLI" $dau bash -c 'curl -fsSl https://kubevela.io/script/install.sh | bash' echo "Configuration complete." +cat > /home/ubuntu/kubevela-values.yaml << EOF +nodeSelector: + "node-role.kubernetes.io/control-plane": "" +tolerations: + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoSchedule" +EOF + +$dau bash -c 'helm repo add kubevela https://kubevela.github.io/chart && helm repo update' + +cat > /home/ubuntu/patch-pin-to-control-plane.yaml << EOF +apiVersion: apps/v1 +kind: Deployment +spec: + template: + spec: + nodeSelector: + "node-role.kubernetes.io/control-plane": "" + tolerations: + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoSchedule" +EOF + echo "Setting KubeVela..." # Function to check for worker nodes and install KubeVela cat > /home/ubuntu/install_kubevela.sh << 'EOF' @@ -57,7 +82,7 @@ echo "Start install_kubevela.sh" echo "-----${KUBECONFIG}---------" sudo cat ${KUBECONFIG} echo "--------------" -sudo -H -E -u ubuntu bash -c 'vela install -y --version 1.9.11' +sudo -H -E -u ubuntu bash -c 'helm upgrade --install --create-namespace -n vela-system kubevela kubevela/vela-core --version 1.9.11 --values /home/ubuntu/kubevela-values.yaml --wait' echo "Vela installation done." if [ "$SERVERLESS_ENABLED" == "yes" ]; then echo "Serverless installation." @@ -75,6 +100,10 @@ if [ "$SERVERLESS_ENABLED" == "yes" ]; then # Apply Knative Serving CRDs and core components kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-crds.yaml kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.4/serving-core.yaml + kubectl patch deployment -n knative-serving activator --patch "$(cat /home/ubuntu/patch-pin-to-control-plane.yaml)" + kubectl patch deployment -n knative-serving autoscaler --patch "$(cat /home/ubuntu/patch-pin-to-control-plane.yaml)" + kubectl patch deployment -n knative-serving controller --patch "$(cat /home/ubuntu/patch-pin-to-control-plane.yaml)" + kubectl patch deployment -n knative-serving webhook --patch "$(cat /home/ubuntu/patch-pin-to-control-plane.yaml)" # Download and apply Kourier sudo wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/$NEBULOUS_SCRIPTS_BRANCH/serverless/kourier.yaml diff --git a/serverless/kourier.yaml b/serverless/kourier.yaml index ea146fd..38597e3 100644 --- a/serverless/kourier.yaml +++ b/serverless/kourier.yaml @@ -399,6 +399,12 @@ spec: memory: 500Mi restartPolicy: Always serviceAccountName: net-kourier + nodeSelector: + "node-role.kubernetes.io/control-plane": "" + tolerations: + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoSchedule" --- apiVersion: v1 kind: Service @@ -543,6 +549,12 @@ spec: configMap: name: kourier-bootstrap restartPolicy: Always + nodeSelector: + "node-role.kubernetes.io/control-plane": "" + tolerations: + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoSchedule" --- apiVersion: v1 kind: Service From 5d7d90d64244d02259ea1c70fa0aaa214852dd63 Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Wed, 22 Oct 2025 13:56:22 +0200 Subject: [PATCH 19/21] retry vela install if fails --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 9ec01f0..fae65b0 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -57,7 +57,18 @@ echo "Start install_kubevela.sh" echo "-----${KUBECONFIG}---------" sudo cat ${KUBECONFIG} echo "--------------" -sudo -H -E -u ubuntu bash -c 'vela install -y --version 1.9.11' +# Retry vela install up to 5 times with a 10-second delay between attempts +max_attempts=5 +attempt=1 +until sudo -H -E -u ubuntu bash -c 'vela install -y --version 1.9.11'; do + if (( attempt >= max_attempts )); then + echo "Vela installation failed after $attempt attempts. Exiting." + exit 1 + fi + echo "Vela install failed. Retrying in 10 seconds... ($attempt/$max_attempts)" + attempt=$((attempt+1)) + sleep 10 +done echo "Vela installation done." if [ "$SERVERLESS_ENABLED" == "yes" ]; then echo "Serverless installation." From 96df60c17bdf662649fad2d423f867e6befcc19e Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Thu, 23 Oct 2025 10:06:02 +0200 Subject: [PATCH 20/21] touch /tmp/vela_ready.flag after vela install to signal vela is ready --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index f78c397..5db8b68 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -75,6 +75,8 @@ spec: EOF echo "Setting KubeVela..." +# Delete the flag file if it exists +$dau bash -c 'rm -f /tmp/vela_ready.flag' # Function to check for worker nodes and install KubeVela cat > /home/ubuntu/install_kubevela.sh << 'EOF' #!/bin/bash @@ -186,8 +188,14 @@ while true; do echo "$(date '+%Y-%m-%d %H:%M:%S') - Found $WORKER_NODES worker node(s), proceeding with KubeVela installation..." >> /home/ubuntu/vela.txt /home/ubuntu/install_kubevela.sh >> /home/ubuntu/vela.txt 2>&1 if is_vela_installed; then + echo "Vela installation successful" >> /home/ubuntu/vela.txt # Disable the service after successful installation + echo "Disabling kubevela-installer.service" >> /home/ubuntu/vela.txt sudo systemctl disable kubevela-installer.service + # Create a flag file to indicate that vela is ready. This flag will be read by the script that runs `vela up -f ...`. + # This is is needed to avoid the vela up command to fail if the vela installation has not completed yet. + echo "touching /tmp/vela_ready.flag" >> /home/ubuntu/vela.txt + touch /tmp/vela_ready.flag exit 0 else echo "'vela ls' returned an error. Trying again in 30 seconds..." >> /home/ubuntu/vela.txt From 740ec018aa73fa545744a37ffa9b1e274d7894bf Mon Sep 17 00:00:00 2001 From: "robert.sanfeliu" Date: Thu, 23 Oct 2025 14:58:39 +0200 Subject: [PATCH 21/21] wait forever vela install --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 5db8b68..767616d 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -84,15 +84,10 @@ echo "Start install_kubevela.sh" echo "-----${KUBECONFIG}---------" sudo cat ${KUBECONFIG} echo "--------------" -# Retry vela install up to 5 times with a 10-second delay between attempts -max_attempts=5 +# Retry vela install with a 10-second delay between attempts attempt=1 until sudo -H -E -u ubuntu bash -c 'helm upgrade --install --create-namespace -n vela-system kubevela kubevela/vela-core --version 1.9.11 --values /home/ubuntu/kubevela-values.yaml --wait'; do - if (( attempt >= max_attempts )); then - echo "Vela installation failed after $attempt attempts. Exiting." - exit 1 - fi - echo "Vela install failed. Retrying in 10 seconds... ($attempt/$max_attempts)" + echo "Vela install failed. Retrying in 10 seconds... ($attempt/)" attempt=$((attempt+1)) sleep 10 done