Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : add cluster registration step in pull mode to installation-cli.yaml #6006

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

SkySingh04
Copy link
Contributor

@SkySingh04 SkySingh04 commented Dec 31, 2024

Signed-off-by: Akash [email protected]

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:
Parts of #5916

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 31, 2024
@SkySingh04 SkySingh04 changed the title feat : add cluster registration step in pull mode to installation workflow feat : add cluster registration step in pull mode to installation-cli.yaml Dec 31, 2024
@codecov-commenter
Copy link

codecov-commenter commented Dec 31, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.10%. Comparing base (f6e035f) to head (1120b10).
Report is 16 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6006      +/-   ##
==========================================
- Coverage   48.12%   48.10%   -0.02%     
==========================================
  Files         668      668              
  Lines       55291    55313      +22     
==========================================
+ Hits        26609    26610       +1     
- Misses      26948    26968      +20     
- Partials     1734     1735       +1     
Flag Coverage Δ
unittests 48.10% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SkySingh04 SkySingh04 force-pushed the karmadactlInstallationCLI branch from e94498a to 5d8cefa Compare January 18, 2025 17:37
@karmada-bot karmada-bot removed the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Jan 18, 2025
@zhzhuang-zju
Copy link
Contributor

/assign

@zhzhuang-zju
Copy link
Contributor

@SkySingh04 the ci failed due to not finding the command karmadactl.
And then the command you provided for cluster registration is incorrect. The usage of command karmadactl register can refer to https://karmada.io/docs/next/userguide/clustermanager/cluster-registration/#register-cluster-with-pull-mode and https://karmada.io/docs/next/reference/karmadactl/karmadactl-commands/karmadactl_register/

          karmadactl register cluster \
            --cluster-name ${{ matrix.k8s }} \
            --mode Pull

@karmada-bot karmada-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 26, 2025
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 6, 2025
@akashsinghvance
Copy link

@zhzhuang-zju This PR is also related to the issue we are facing in #6007 as well.

Reference :
#6007 (comment) and #6007 (comment)

@zhzhuang-zju
Copy link
Contributor

@SkySingh04 The CI has two jobs, init-config and test-on-kubernetes-matrix. Each job will use the hack script to execute karmadactl init to set up a Karmada system. It is recommended to integrate karmadactl register directly into the corresponding hack script.

For example, the job test-on-kubernetes-matrix uses hack/cli-testing-environment.sh, in which karmadactl join is used to join two member clusters. Just replace one of them with karmadactl register.

echo "Join member clusters..."
${BUILD_PATH}/karmadactl --kubeconfig ${HOME}/karmada/karmada-apiserver.config join ${MEMBER_CLUSTER_1_NAME} --cluster-kubeconfig=${KUBECONFIG_PATH}/${MEMBER_CLUSTER_1_NAME}.config
${BUILD_PATH}/karmadactl --kubeconfig ${HOME}/karmada/karmada-apiserver.config join ${MEMBER_CLUSTER_2_NAME} --cluster-kubeconfig=${KUBECONFIG_PATH}/${MEMBER_CLUSTER_2_NAME}.config
kubectl wait --for=condition=Ready clusters --all --timeout=800s --kubeconfig=${HOME}/karmada/karmada-apiserver.config

@SkySingh04 SkySingh04 force-pushed the karmadactlInstallationCLI branch from 48d2fc9 to f223397 Compare February 13, 2025 08:20
zhzhuang-zju added a commit to zhzhuang-zju/karmada that referenced this pull request Feb 14, 2025
Signed-off-by: zhzhuang-zju <[email protected]>
zhzhuang-zju added a commit to zhzhuang-zju/karmada that referenced this pull request Feb 14, 2025
Signed-off-by: zhzhuang-zju <[email protected]>
zhzhuang-zju added a commit to zhzhuang-zju/karmada that referenced this pull request Feb 14, 2025
Signed-off-by: zhzhuang-zju <[email protected]>
zhzhuang-zju added a commit to zhzhuang-zju/karmada that referenced this pull request Feb 14, 2025
Signed-off-by: zhzhuang-zju <[email protected]>
zhzhuang-zju added a commit to zhzhuang-zju/karmada that referenced this pull request Feb 14, 2025
Signed-off-by: zhzhuang-zju <[email protected]>
zhzhuang-zju added a commit to zhzhuang-zju/karmada that referenced this pull request Feb 14, 2025
Signed-off-by: zhzhuang-zju <[email protected]>
@SkySingh04 SkySingh04 force-pushed the karmadactlInstallationCLI branch 3 times, most recently from 7c448f8 to e4cc1e8 Compare February 18, 2025 05:23
@SkySingh04
Copy link
Contributor Author

@zhzhuang-zju Your requested changes have been made, branch rebased and commits squashed!

@SkySingh04 SkySingh04 force-pushed the karmadactlInstallationCLI branch 2 times, most recently from c663e94 to 55803b5 Compare February 18, 2025 15:24
@SkySingh04
Copy link
Contributor Author

@zhzhuang-zju Your requested changes have been made and the CI is passing!

Copy link
Contributor

@zhzhuang-zju zhzhuang-zju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, thanks~
Others LGTM

@@ -99,6 +99,7 @@ kind load docker-image "${REGISTRY}/karmada-controller-manager:${VERSION}" --nam
kind load docker-image "${REGISTRY}/karmada-scheduler:${VERSION}" --name="${HOST_CLUSTER_NAME}"
kind load docker-image "${REGISTRY}/karmada-webhook:${VERSION}" --name="${HOST_CLUSTER_NAME}"
kind load docker-image "${REGISTRY}/karmada-aggregated-apiserver:${VERSION}" --name="${HOST_CLUSTER_NAME}"
kind load docker-image "${REGISTRY}/karmada-agent:${VERSION}" --name="${MEMBER_CLUSTER_1_NAME}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step also needs to be synchronized into hack/cli-testing-init-with-config.sh to ensure that the CI uses the image generated from the latest code instead of the image pulled from the remote image repository.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been added!

@SkySingh04 SkySingh04 force-pushed the karmadactlInstallationCLI branch from 55803b5 to fc37762 Compare February 19, 2025 02:52
@akashsinghvance
Copy link

@zhzhuang-zju updated!

@zhzhuang-zju
Copy link
Contributor

/lgtm
cc @XiShanYongYe-Chang

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 19, 2025
@@ -44,6 +44,8 @@ jobs:
hack/cli-testing-environment.sh
# run a single e2e
export PULL_BASED_CLUSTERS="member1:${HOME}/.kube/member1.config"
export KARMADA_PULL_CLUSTER_NAME="member1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable does not seem to be necessary. Can you help confirm it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean KARMADA_PULL_CLUSTER_NAME?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XiShanYongYe-Chang If the e2e test needs to identify cluster member1 as a pull-mode cluster, we need to export these variables :

CC : #6006 (comment)

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean KARMADA_PULL_CLUSTER_NAME?

Yes, it is.

Copy link
Contributor Author

@SkySingh04 SkySingh04 Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@XiShanYongYe-Chang Apologies for my oversight, this export is not needed and is removed

@@ -44,6 +44,8 @@ jobs:
hack/cli-testing-environment.sh
# run a single e2e
export PULL_BASED_CLUSTERS="member1:${HOME}/.kube/member1.config"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting member1 as a pull cluster is the logic of the hack/cli-testing-environment.sh script, so I suggest setting this variable in the script as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it because the variables set in the script fail outside the script?

Copy link
Contributor Author

@SkySingh04 SkySingh04 Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, since they are needed for the e2e tests

ginkgo -v --race --trace -p  --focus="[BasicPropagation] propagation testing deployment propagation testing"  ./test/e2e/suites/base

CC : @zhzhuang-zju can confirm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I get it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for commenting on a wrong direction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries! I have removed the commit and we are good to go!

@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 20, 2025
@SkySingh04 SkySingh04 force-pushed the karmadactlInstallationCLI branch from d3e82b9 to fc37762 Compare February 20, 2025 07:50
@SkySingh04
Copy link
Contributor Author

@XiShanYongYe-Chang If all comments are resolved, we are good to go!

Signed-off-by: Sky Singh <[email protected]>
@SkySingh04 SkySingh04 force-pushed the karmadactlInstallationCLI branch from 5149870 to 1120b10 Compare February 20, 2025 08:35
Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@SkySingh04
Copy link
Contributor Author

@XiShanYongYe-Chang @zhzhuang-zju Following up on this, Any blockers for this to be merged?

@XiShanYongYe-Chang
Copy link
Member

/approve
Ask @zhzhuang-zju to help make sure again.

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XiShanYongYe-Chang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 22, 2025
@zhzhuang-zju
Copy link
Contributor

thanks,
/lgtm

@zhzhuang-zju
Copy link
Contributor

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 22, 2025
@karmada-bot karmada-bot merged commit a5ca5cc into karmada-io:master Feb 22, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants