From 72660a9797af4d90bff3dfe2025dc33c7e5ea77b Mon Sep 17 00:00:00 2001 From: Rui Hu Date: Tue, 21 Oct 2025 14:29:24 +0800 Subject: [PATCH 1/5] fix: add random to cluster name to avoid conflict Also use action_path var to resolve config files. --- action.yaml | 15 ++++++++++++--- clevermicro-kind-config.yaml | 1 - 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/action.yaml b/action.yaml index 12ada42..d37754a 100644 --- a/action.yaml +++ b/action.yaml @@ -24,11 +24,20 @@ inputs: runs: using: composite steps: + - name: Decide kind cluster name + id: cluster-name + shell: bash + run: | + rand=$(head /dev/urandom | tr -dc a-z0-9 | head -c 16) + timestamp=$(date +%s) + echo "cluster-name=$(echo clevermicro-test-$timestamp-$rand)" >> "$FORGEJO_OUTPUT" + + # this action will setup kind and helm, then create a kind cluster - name: Bring up Kubernetes cluster using Kind uses: https://git.cleverthis.com/actions/kubernetes@master with: - cluster-name: clevermicro - kind-config-path: clevermicro-kind-config.yaml + cluster-name: ${{ steps.cluster-name.outputs.cluster-name }} + kind-config-path: ${{ forge.action_path }}/clevermicro-kind-config.yaml registry-url: ${{ inputs.registry-url }} registry-user: ${{ inputs.registry-user }} registry-password: ${{ inputs.registry-password }} @@ -59,7 +68,7 @@ runs: - name: Create additional resources for CleverMicro testing shell: bash run: | - kubectl apply -f service.yaml + kubectl apply -f ${{ forge.action_path }}/service.yaml - name: Wait for all pods ready shell: bash diff --git a/clevermicro-kind-config.yaml b/clevermicro-kind-config.yaml index c5c1c81..f393488 100644 --- a/clevermicro-kind-config.yaml +++ b/clevermicro-kind-config.yaml @@ -1,6 +1,5 @@ kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 -name: clevermicro-test networking: podSubnet: 10.242.0.0/16 serviceSubnet: 10.246.0.0/16 From fb2a784be6ba1129237e2f4d0fdfedab37a53fb9 Mon Sep 17 00:00:00 2001 From: Rui Hu Date: Tue, 21 Oct 2025 15:33:53 +0800 Subject: [PATCH 2/5] fix: add debug info, fix wrong namespace when applying service.yaml --- action.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index d37754a..533a2e2 100644 --- a/action.yaml +++ b/action.yaml @@ -45,33 +45,43 @@ runs: - name: Add Helm chart repositories shell: bash run: | + echo "==================== Adding helm chart repositories ====================" helm repo add kedacore https://kedacore.github.io/charts helm repo add cleverthis "https://${{ inputs.registry-url }}/api/packages/infra/helm" \ --username "${{ inputs.registry-user }}" \ --password "${{ inputs.registry-password }}" helm repo update + echo "==================== Done adding helm chart repositories ====================" - name: Install KEDA and wait for ready shell: bash run: | + echo "==================== Installing KEDA ====================" helm install keda kedacore/keda --namespace keda --create-namespace --wait --timeout 10m + echo "==================== Done installing KEDA ====================" - name: Install CleverMicro and wait for ready shell: bash run: | + echo "==================== Installing CleverMicro ====================" helm install clevermicro cleverthis/clevermicro-deployment --namespace clevermicro --create-namespace \ --set "clevermicro.amqp-router.image.tag=${{ inputs.amqp-router-tag }}" \ --set "clevermicro.management-service.image.tag=${{ inputs.management-service-tag }}" \ --set "client-lib-demo.image.tag=${{ inputs.client-lib-demo-tag }}" \ --wait --timeout 20m + echo "==================== Done installing CleverMicro ====================" - name: Create additional resources for CleverMicro testing shell: bash run: | - kubectl apply -f ${{ forge.action_path }}/service.yaml + echo "==================== Applying service file ====================" + kubectl -n clevermicro apply -f ${{ forge.action_path }}/service.yaml + echo "==================== Done applying service file ====================" - name: Wait for all pods ready shell: bash run: | + echo "==================== Waiting for all pods ready ====================" kubectl -n clevermicro wait pod --for=condition=Ready --timeout=10m --all kubectl -n clevermicro get pod + echo "==================== All pods ready ====================" From 1204ce4ac938985bbbbfb769298f0b2fbb99ff50 Mon Sep 17 00:00:00 2001 From: Rui Hu Date: Tue, 21 Oct 2025 15:34:07 +0800 Subject: [PATCH 3/5] temp: use fixed k8s action --- action.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 533a2e2..0f319ae 100644 --- a/action.yaml +++ b/action.yaml @@ -34,7 +34,8 @@ runs: # this action will setup kind and helm, then create a kind cluster - name: Bring up Kubernetes cluster using Kind - uses: https://git.cleverthis.com/actions/kubernetes@master + uses: https://git.cleverthis.com/hurui200320/actions-kubernetes@0262e48920fc1e20d00b9b301ba848d45b22164e +# uses: https://git.cleverthis.com/actions/kubernetes@master with: cluster-name: ${{ steps.cluster-name.outputs.cluster-name }} kind-config-path: ${{ forge.action_path }}/clevermicro-kind-config.yaml From 958ac6e185447cb0580b08788560b0e87b7e0565 Mon Sep 17 00:00:00 2001 From: Rui Hu Date: Tue, 21 Oct 2025 18:04:52 +0800 Subject: [PATCH 4/5] feat: add port 30081 for spare (minio) --- action.yaml | 2 +- clevermicro-kind-config.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 0f319ae..a06ba1e 100644 --- a/action.yaml +++ b/action.yaml @@ -85,4 +85,4 @@ runs: echo "==================== Waiting for all pods ready ====================" kubectl -n clevermicro wait pod --for=condition=Ready --timeout=10m --all kubectl -n clevermicro get pod - echo "==================== All pods ready ====================" + echo "==================== All pods ready ====================" \ No newline at end of file diff --git a/clevermicro-kind-config.yaml b/clevermicro-kind-config.yaml index f393488..232bb3d 100644 --- a/clevermicro-kind-config.yaml +++ b/clevermicro-kind-config.yaml @@ -9,6 +9,9 @@ nodes: - containerPort: 30080 hostPort: 30080 protocol: TCP + - containerPort: 30081 + hostPort: 30081 + protocol: TCP - containerPort: 8001 hostPort: 8001 protocol: TCP From 9c15c59d3543849dd2ef12f17e8cc9682e0adcdb Mon Sep 17 00:00:00 2001 From: Rui Hu Date: Tue, 21 Oct 2025 21:27:18 +0800 Subject: [PATCH 5/5] fix: update reference after actions/kubernetes#1 get merged --- action.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index a06ba1e..04c134d 100644 --- a/action.yaml +++ b/action.yaml @@ -34,8 +34,7 @@ runs: # this action will setup kind and helm, then create a kind cluster - name: Bring up Kubernetes cluster using Kind - uses: https://git.cleverthis.com/hurui200320/actions-kubernetes@0262e48920fc1e20d00b9b301ba848d45b22164e -# uses: https://git.cleverthis.com/actions/kubernetes@master + uses: https://git.cleverthis.com/actions/kubernetes@master with: cluster-name: ${{ steps.cluster-name.outputs.cluster-name }} kind-config-path: ${{ forge.action_path }}/clevermicro-kind-config.yaml