From 6c6f90196acc43b11dc8f47a55fdd25cb7d02a5e Mon Sep 17 00:00:00 2001 From: Chitanya Reddy Onteddu Date: Wed, 2 Jul 2025 11:33:41 +0530 Subject: [PATCH 01/10] debugging ocm failure Signed-off-by: Amit Singh Signed-off-by: semmet95 --- .github/workflows/ci.yaml | 2 ++ .gitignore | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 897664a5..54546a8a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -148,6 +148,7 @@ jobs: node_image: kindest/node:v1.31.9 - name: Prepare OCM testing environment run: | + set -ex clusteradm init --output-join-command-file join.sh --wait sh -c "$(cat join.sh) loopback --force-internal-endpoint-lookup" clusteradm accept --clusters loopback --wait 30 @@ -167,4 +168,5 @@ jobs: kubectl wait --for=condition=Available apiservice/v1alpha1.cluster.core.oam.dev - name: Run e2e test run: | + set -ex make test-e2e-ocm diff --git a/.gitignore b/.gitignore index 4b48354d..d186a521 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ bin # Kubernetes Generated files - skip generated files, except for vendored files !vendor/**/zz_generated.* +join.sh # editor and IDE paraphernalia .idea From 57316521117644b91e8c701331846178e59a1126 Mon Sep 17 00:00:00 2001 From: Chitanya Reddy Onteddu Date: Wed, 2 Jul 2025 12:34:37 +0530 Subject: [PATCH 02/10] chore: reverts kind version Signed-off-by: Amit Singh Signed-off-by: semmet95 --- .github/workflows/ci.yaml | 10 +++++----- .gitignore | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 54546a8a..dedc8efa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ env: # Common versions GO_VERSION: '1.23' GOLANGCI_VERSION: 'v1.56' - KIND_VERSION: 'v0.29.0' + KIND_VERSION: 'v0.27.0' jobs: @@ -99,8 +99,8 @@ jobs: - name: Create k8s Kind Cluster uses: helm/kind-action@v1.2.0 with: - version: v0.29.0 - node_image: kindest/node:v1.31.9 + version: ${{ env.KIND_VERSION }} + node_image: kindest/node:v1.31.6 - name: Build Image run: | make image @@ -144,8 +144,8 @@ jobs: - name: Create k8s Kind Cluster uses: helm/kind-action@v1.2.0 with: - version: v0.29.0 - node_image: kindest/node:v1.31.9 + version: ${{ env.KIND_VERSION }} + node_image: kindest/node:v1.31.6 - name: Prepare OCM testing environment run: | set -ex diff --git a/.gitignore b/.gitignore index d186a521..f1f0d4cb 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ bin join.sh # editor and IDE paraphernalia +.vscode/ .idea *.swp *.swo From 86c7850f57969ecd9e24a9aedb237a6a513b2ffa Mon Sep 17 00:00:00 2001 From: Chitanya Reddy Onteddu Date: Wed, 2 Jul 2025 13:22:15 +0530 Subject: [PATCH 03/10] feat: adds resources to cluster-gateway-addon-manager deployment Signed-off-by: Amit Singh Signed-off-by: semmet95 --- charts/addon-manager/templates/addon-manager.yaml | 7 +++++++ charts/addon-manager/values.yaml | 9 ++++++++- .../templates/cluster-gateway-apiserver.yaml | 7 +++++++ charts/cluster-gateway/values.yaml | 10 +++++++++- e2e/ocm/clustergateway.go | 2 +- 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/charts/addon-manager/templates/addon-manager.yaml b/charts/addon-manager/templates/addon-manager.yaml index aa2300e7..b8a3e8a4 100644 --- a/charts/addon-manager/templates/addon-manager.yaml +++ b/charts/addon-manager/templates/addon-manager.yaml @@ -20,5 +20,12 @@ spec: - name: cluster-gateway-addon-manager image: {{ .Values.image }}:{{ .Values.tag | default (print "v" .Chart.Version) }} imagePullPolicy: IfNotPresent + resources: + requests: + cpu: {{ .Values.resources.requests.cpu }} + memory: {{ .Values.resources.requests.memory }} + limits: + cpu: {{ .Values.resources.limits.cpu }} + memory: {{ .Values.resources.limits.memory }} args: - --leader-elect=true \ No newline at end of file diff --git a/charts/addon-manager/values.yaml b/charts/addon-manager/values.yaml index 1f0ec3eb..4bccc0f1 100644 --- a/charts/addon-manager/values.yaml +++ b/charts/addon-manager/values.yaml @@ -1,5 +1,12 @@ -# Image of the cluster-gateway instances +# Specs of cluster-gateway-addon-manager deployment image: oamdev/cluster-gateway-addon-manager +resources: + requests: + cpu: "250m" + memory: "256Mi" + limits: + cpu: "500m" + memory: "512Mi" tag: diff --git a/charts/cluster-gateway/templates/cluster-gateway-apiserver.yaml b/charts/cluster-gateway/templates/cluster-gateway-apiserver.yaml index b535a80a..cb3d3189 100644 --- a/charts/cluster-gateway/templates/cluster-gateway-apiserver.yaml +++ b/charts/cluster-gateway/templates/cluster-gateway-apiserver.yaml @@ -27,6 +27,13 @@ spec: - name: gateway image: {{ .Values.image }}:{{ .Values.tag | default (print "v" .Chart.Version) }} imagePullPolicy: IfNotPresent + resources: + requests: + cpu: {{ .Values.resources.requests.cpu }} + memory: {{ .Values.resources.requests.memory }} + limits: + cpu: {{ .Values.resources.limits.cpu }} + memory: {{ .Values.resources.limits.memory }} args: - --secure-port=9443 - --secret-namespace={{ .Values.secretNamespace }} diff --git a/charts/cluster-gateway/values.yaml b/charts/cluster-gateway/values.yaml index 4d1b13d1..5bf6c470 100644 --- a/charts/cluster-gateway/values.yaml +++ b/charts/cluster-gateway/values.yaml @@ -1,5 +1,13 @@ -# Image of the cluster-gateway instances +# Specs of gateway-deployment deployment image: oamdev/cluster-gateway +resources: + requests: + cpu: "250m" + memory: "256Mi" + limits: + cpu: "500m" + memory: "512Mi" + tag: diff --git a/e2e/ocm/clustergateway.go b/e2e/ocm/clustergateway.go index 5e43e1ba..a0432793 100644 --- a/e2e/ocm/clustergateway.go +++ b/e2e/ocm/clustergateway.go @@ -54,7 +54,7 @@ var _ = Describe("Addon Manager Test", func() { gwHealthy := gw.Status.Healthy return addonHealthy && gwHealthy, nil }). - WithTimeout(time.Minute). + WithTimeout(2 * time.Minute). Should(BeTrue()) }) It("Manual probe healthiness should work", From a4a3cbff880d01dd271d66739c489f2566d0513a Mon Sep 17 00:00:00 2001 From: Chitanya Reddy Onteddu Date: Wed, 2 Jul 2025 14:16:00 +0530 Subject: [PATCH 04/10] feat: removes resource block Signed-off-by: Amit Singh Signed-off-by: semmet95 --- .github/workflows/ci.yaml | 7 ++++--- charts/addon-manager/templates/addon-manager.yaml | 7 ------- charts/addon-manager/values.yaml | 7 ------- .../templates/cluster-gateway-apiserver.yaml | 7 ------- charts/cluster-gateway/values.yaml | 8 -------- e2e/ocm/clustergateway.go | 2 +- 6 files changed, 5 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dedc8efa..7bbc26e1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,8 @@ env: # Common versions GO_VERSION: '1.23' GOLANGCI_VERSION: 'v1.56' - KIND_VERSION: 'v0.27.0' + KIND_VERSION: 'v0.29.0' + K8S_VERSION: 'v1.31.9' jobs: @@ -100,7 +101,7 @@ jobs: uses: helm/kind-action@v1.2.0 with: version: ${{ env.KIND_VERSION }} - node_image: kindest/node:v1.31.6 + node_image: kindest/node:${{ env.K8S_VERSION }} - name: Build Image run: | make image @@ -145,7 +146,7 @@ jobs: uses: helm/kind-action@v1.2.0 with: version: ${{ env.KIND_VERSION }} - node_image: kindest/node:v1.31.6 + node_image: kindest/node:${{ env.K8S_VERSION }} - name: Prepare OCM testing environment run: | set -ex diff --git a/charts/addon-manager/templates/addon-manager.yaml b/charts/addon-manager/templates/addon-manager.yaml index b8a3e8a4..aa2300e7 100644 --- a/charts/addon-manager/templates/addon-manager.yaml +++ b/charts/addon-manager/templates/addon-manager.yaml @@ -20,12 +20,5 @@ spec: - name: cluster-gateway-addon-manager image: {{ .Values.image }}:{{ .Values.tag | default (print "v" .Chart.Version) }} imagePullPolicy: IfNotPresent - resources: - requests: - cpu: {{ .Values.resources.requests.cpu }} - memory: {{ .Values.resources.requests.memory }} - limits: - cpu: {{ .Values.resources.limits.cpu }} - memory: {{ .Values.resources.limits.memory }} args: - --leader-elect=true \ No newline at end of file diff --git a/charts/addon-manager/values.yaml b/charts/addon-manager/values.yaml index 4bccc0f1..ef508978 100644 --- a/charts/addon-manager/values.yaml +++ b/charts/addon-manager/values.yaml @@ -1,12 +1,5 @@ # Specs of cluster-gateway-addon-manager deployment image: oamdev/cluster-gateway-addon-manager -resources: - requests: - cpu: "250m" - memory: "256Mi" - limits: - cpu: "500m" - memory: "512Mi" tag: diff --git a/charts/cluster-gateway/templates/cluster-gateway-apiserver.yaml b/charts/cluster-gateway/templates/cluster-gateway-apiserver.yaml index cb3d3189..b535a80a 100644 --- a/charts/cluster-gateway/templates/cluster-gateway-apiserver.yaml +++ b/charts/cluster-gateway/templates/cluster-gateway-apiserver.yaml @@ -27,13 +27,6 @@ spec: - name: gateway image: {{ .Values.image }}:{{ .Values.tag | default (print "v" .Chart.Version) }} imagePullPolicy: IfNotPresent - resources: - requests: - cpu: {{ .Values.resources.requests.cpu }} - memory: {{ .Values.resources.requests.memory }} - limits: - cpu: {{ .Values.resources.limits.cpu }} - memory: {{ .Values.resources.limits.memory }} args: - --secure-port=9443 - --secret-namespace={{ .Values.secretNamespace }} diff --git a/charts/cluster-gateway/values.yaml b/charts/cluster-gateway/values.yaml index 5bf6c470..e9b11624 100644 --- a/charts/cluster-gateway/values.yaml +++ b/charts/cluster-gateway/values.yaml @@ -1,13 +1,5 @@ # Specs of gateway-deployment deployment image: oamdev/cluster-gateway -resources: - requests: - cpu: "250m" - memory: "256Mi" - limits: - cpu: "500m" - memory: "512Mi" - tag: diff --git a/e2e/ocm/clustergateway.go b/e2e/ocm/clustergateway.go index a0432793..5e43e1ba 100644 --- a/e2e/ocm/clustergateway.go +++ b/e2e/ocm/clustergateway.go @@ -54,7 +54,7 @@ var _ = Describe("Addon Manager Test", func() { gwHealthy := gw.Status.Healthy return addonHealthy && gwHealthy, nil }). - WithTimeout(2 * time.Minute). + WithTimeout(time.Minute). Should(BeTrue()) }) It("Manual probe healthiness should work", From 3e5968997f3e23399aa46afeffc20544286ade5a Mon Sep 17 00:00:00 2001 From: Chitanya Reddy Onteddu Date: Wed, 2 Jul 2025 14:42:37 +0530 Subject: [PATCH 05/10] increases kind cluster nodes Signed-off-by: Amit Singh Signed-off-by: semmet95 --- .github/workflows/ci.yaml | 2 ++ e2e/config/kind-config.yaml | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 e2e/config/kind-config.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7bbc26e1..a5020856 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -147,6 +147,7 @@ jobs: with: version: ${{ env.KIND_VERSION }} node_image: kindest/node:${{ env.K8S_VERSION }} + config: e2e/config/kind-config.yaml - name: Prepare OCM testing environment run: | set -ex @@ -171,3 +172,4 @@ jobs: run: | set -ex make test-e2e-ocm + kubectl get nodes diff --git a/e2e/config/kind-config.yaml b/e2e/config/kind-config.yaml new file mode 100644 index 00000000..e33bfa01 --- /dev/null +++ b/e2e/config/kind-config.yaml @@ -0,0 +1,10 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +containerdConfigPatches: +- |- + [plugins."io.containerd.grpc.v1.cri".registry] + config_path = "/etc/containerd/certs.d" +nodes: +- role: control-plane +- role: worker +- role: worker \ No newline at end of file From 43facadd0db43b080d702baf772d5b39d2ff515f Mon Sep 17 00:00:00 2001 From: Chitanya Reddy Onteddu Date: Wed, 2 Jul 2025 14:52:27 +0530 Subject: [PATCH 06/10] removes redundant node check Signed-off-by: Amit Singh Signed-off-by: semmet95 --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a5020856..a289db08 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -172,4 +172,3 @@ jobs: run: | set -ex make test-e2e-ocm - kubectl get nodes From 87ca575936b98b36fbb553e02efbd19ef69d220a Mon Sep 17 00:00:00 2001 From: Chitanya Reddy Onteddu Date: Wed, 2 Jul 2025 14:54:05 +0530 Subject: [PATCH 07/10] increases worker node count to 3 Signed-off-by: Amit Singh --- .github/workflows/ci.yaml | 2 -- e2e/config/kind-config.yaml | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a289db08..069ee304 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -150,7 +150,6 @@ jobs: config: e2e/config/kind-config.yaml - name: Prepare OCM testing environment run: | - set -ex clusteradm init --output-join-command-file join.sh --wait sh -c "$(cat join.sh) loopback --force-internal-endpoint-lookup" clusteradm accept --clusters loopback --wait 30 @@ -170,5 +169,4 @@ jobs: kubectl wait --for=condition=Available apiservice/v1alpha1.cluster.core.oam.dev - name: Run e2e test run: | - set -ex make test-e2e-ocm diff --git a/e2e/config/kind-config.yaml b/e2e/config/kind-config.yaml index e33bfa01..77b355e8 100644 --- a/e2e/config/kind-config.yaml +++ b/e2e/config/kind-config.yaml @@ -7,4 +7,5 @@ containerdConfigPatches: nodes: - role: control-plane - role: worker +- role: worker - role: worker \ No newline at end of file From 83499d35319dbcaead8a4de38869764e31650c2c Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Thu, 3 Jul 2025 12:57:16 +0530 Subject: [PATCH 08/10] test: increases polling interval Signed-off-by: Amit Singh --- e2e/ocm/clustergateway.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/e2e/ocm/clustergateway.go b/e2e/ocm/clustergateway.go index 5e43e1ba..53b1d1da 100644 --- a/e2e/ocm/clustergateway.go +++ b/e2e/ocm/clustergateway.go @@ -53,8 +53,7 @@ var _ = Describe("Addon Manager Test", func() { } gwHealthy := gw.Status.Healthy return addonHealthy && gwHealthy, nil - }). - WithTimeout(time.Minute). + }, 1*time.Minute, 20*time.Second). Should(BeTrue()) }) It("Manual probe healthiness should work", From afe9943817a1d7717daf5644ca97dd13d60b909f Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Thu, 3 Jul 2025 13:10:12 +0530 Subject: [PATCH 09/10] test: increases timeout Signed-off-by: Amit Singh --- .github/workflows/ci.yaml | 2 +- e2e/config/kind-config.yaml | 11 ----------- e2e/ocm/clustergateway.go | 4 ++-- 3 files changed, 3 insertions(+), 14 deletions(-) delete mode 100644 e2e/config/kind-config.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 069ee304..ddde0ae7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -147,7 +147,6 @@ jobs: with: version: ${{ env.KIND_VERSION }} node_image: kindest/node:${{ env.K8S_VERSION }} - config: e2e/config/kind-config.yaml - name: Prepare OCM testing environment run: | clusteradm init --output-join-command-file join.sh --wait @@ -169,4 +168,5 @@ jobs: kubectl wait --for=condition=Available apiservice/v1alpha1.cluster.core.oam.dev - name: Run e2e test run: | + kubectl get clustergateways -A make test-e2e-ocm diff --git a/e2e/config/kind-config.yaml b/e2e/config/kind-config.yaml deleted file mode 100644 index 77b355e8..00000000 --- a/e2e/config/kind-config.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: Cluster -apiVersion: kind.x-k8s.io/v1alpha4 -containerdConfigPatches: -- |- - [plugins."io.containerd.grpc.v1.cri".registry] - config_path = "/etc/containerd/certs.d" -nodes: -- role: control-plane -- role: worker -- role: worker -- role: worker \ No newline at end of file diff --git a/e2e/ocm/clustergateway.go b/e2e/ocm/clustergateway.go index 53b1d1da..6636335a 100644 --- a/e2e/ocm/clustergateway.go +++ b/e2e/ocm/clustergateway.go @@ -53,10 +53,10 @@ var _ = Describe("Addon Manager Test", func() { } gwHealthy := gw.Status.Healthy return addonHealthy && gwHealthy, nil - }, 1*time.Minute, 20*time.Second). + }, 3*time.Minute, 20*time.Second). Should(BeTrue()) }) - It("Manual probe healthiness should work", + XIt("Manual probe healthiness should work", func() { resp, err := f.HubNativeClient().Discovery(). RESTClient(). From 1feb173cc79b1c8fb3ef616598476c82576c804b Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Thu, 3 Jul 2025 13:58:42 +0530 Subject: [PATCH 10/10] test: runs tests prallely Signed-off-by: Amit Singh --- .github/workflows/ci.yaml | 4 +++- e2e/ocm/clustergateway.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ddde0ae7..032ccc7f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -160,13 +160,15 @@ jobs: kind load docker-image oamdev/cluster-gateway-addon-manager:latest --name chart-testing - name: Install latest cluster-gateway run: | + set -ex helm install --create-namespace -n open-cluster-management-addon \ cluster-gateway ./charts/addon-manager \ --set tag=latest go run ./e2e/env/prepare | kubectl apply -f - kubectl rollout status deployment -n vela-system gateway-deployment --timeout 1m - kubectl wait --for=condition=Available apiservice/v1alpha1.cluster.core.oam.dev + kubectl wait --for=condition=Available apiservice/v1alpha1.cluster.core.oam.dev --timeout=300s - name: Run e2e test run: | + sleep 360 kubectl get clustergateways -A make test-e2e-ocm diff --git a/e2e/ocm/clustergateway.go b/e2e/ocm/clustergateway.go index 6636335a..0b83ed25 100644 --- a/e2e/ocm/clustergateway.go +++ b/e2e/ocm/clustergateway.go @@ -20,7 +20,7 @@ const ( ocmTestBasename = "ocm-addon" ) -var _ = Describe("Addon Manager Test", func() { +var _ = Describe("Addon Manager Test", Ordered, func() { f := framework.NewE2EFramework(ocmTestBasename) It("ClusterGateway addon installation should work", func() { @@ -56,7 +56,7 @@ var _ = Describe("Addon Manager Test", func() { }, 3*time.Minute, 20*time.Second). Should(BeTrue()) }) - XIt("Manual probe healthiness should work", + It("Manual probe healthiness should work", func() { resp, err := f.HubNativeClient().Discovery(). RESTClient().