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

add yurtctl test init cmd to setup OpenYurt cluster with kind #783

Merged
merged 2 commits into from
Apr 11, 2022

Conversation

Congrool
Copy link
Member

@Congrool Congrool commented Mar 14, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

As mentioned is #736, we will deprecate yurtctl convert/revert which is used by github actions. To run e2e tests in github actions, we still need a way to setup OpenYurt cluster with kind. It is this pr.

Which issue(s) this PR fixes:

Fixes #754

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Currently, the yurtctl test looks like as follows:

$ _output/bin/yurtctl test -h
Tools for developers to test the OpenYurt Cluster

Usage:
  yurtctl test [flags]
  yurtctl test [command]

Available Commands:
  init        Using kind to setup OpenYurt cluster for test

Flags:
  -h, --help   help for test
$ _output/bin/yurtctl test init -h
Using kind to setup OpenYurt cluster for test

Usage:
  yurtctl test init [flags]

Flags:
      --cloud-nodes string          Comma separated list of cloud nodes. The control-plane will always be cloud node.If no cloud node specified, the control-plane node will be the only one cloud node.
      --cluster-name string         The cluster name of the new-created kind cluster. (default "openyurt")
  -h, --help                        help for init
      --ignore-error                Igore error when using openyurt version that is not officially released.
      --kind-config-path string     Specify the path where the kind config file will be generated. (default "/tmp/kindconfig.yaml")
      --kube-config string          Path where the kubeconfig file of new cluster will be stored. The default is ${HOME}/.kube/config.
      --kubernetes-version string   The version of kubernetes that the openyurt cluster is based on. (default "v1.21")
      --node-num int                Specify the node number of the kind cluster. (default 2)
      --openyurt-version string     The version of openyurt components. (default "latest")
      --use-local-images            If set, local images stored by docker will be used first.

So, that developers can setup openyurt cluster with cmd yurtctl test init.

CHANGLOG-2022.4.9
Revise the local_up_openyurt.sh to use yurtctl test init to setup OpenYurt cluster.

@openyurt-bot
Copy link
Collaborator

@Congrool: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #754

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Currently, the yurtctl init is as follows:

$ _output/bin/yurtctl init -h
Initialize the OpenYurt cluster.

Usage:
 yurtctl init [flags]
 yurtctl init [command]

Available Commands:
 kind        Setup OpenYurt cluster with kind
 sealer      Setup OpenYurt cluster with sealer

Flags:
 -h, --help   help for init
$ _output/bin/yurtctl init sealer -h
Setup OpenYurt cluster with sealer

Usage:
 yurtctl init sealer [flags]

Flags:
     --apiserver-advertise-address string   The IP address the API Server will advertise it's listening on.
 -h, --help                                 help for sealer
     --image-repository string              Choose a registry to pull cluster images from (default "registry.cn-hangzhou.aliyuncs.com/openyurt")
     --openyurt-version string              Choose a specific OpenYurt version for the control plane. (default "latest")
 -p, --passwd string                        set master server ssh password
     --pod-network-cidr string              Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.
     --service-cidr string                  Use alternative range of IP address for service VIPs.
     --yurt-tunnel-server-address string    The yurt-tunnel-server address.
$ _output/bin/yurtctl init kind -h
Setup OpenYurt cluster with kind

Usage:
 yurtctl init kind [flags]

Flags:
     --cloud-nodes string          Comma separated list of cloud nodes. The control-plane will always be cloud node.If no cloud node specifed, the control-plane node will be the only one cloud node.
     --cluster-name string         The cluster name of the new-created kind cluster. (default "openyurt")
 -h, --help                        help for kind
     --ignore-error                Igore error when using openyurt version that is not officially released.
     --kind-config-path string     Specify the customized kind config path. (default "/tmp/kindconfig.yaml")
     --kube-config string          Path where the kubeconfig file of new cluster will be stored. The default is ${HOME}/.kube/config.
     --kubernetes-version string   The version of kubernetes that the openyurt cluster is based on. (default "v1.21")
     --nodes-num int               Specify the node number of the kind cluster. (default 2)
     --openyurt-version string     The version of openyurt components. (default "latest")
     --use-local-image             If set, local images stored by docker will be used first. The default is false.

So, that users used to use yurtctl init should use yurtctl init sealer instead.

other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Congrool
Copy link
Member Author

This pr only enables yurtctl init to setup OpenYurt cluster with kind, and the github actions still use the yurtctl convert. I'll update it in another pr.

@rambohe-ch
Copy link
Member

/assign @Peeknut

@rambohe-ch
Copy link
Member

@Congrool Because usage of yurtctl init is changed, so how about to update user manual document of yurtctl init in the following link: https://openyurt.io/zh/docs/installation/yurtctl-init-join

@Congrool
Copy link
Member Author

@Congrool Because usage of yurtctl init is changed, so how about to update user manual document of yurtctl init in the following link: https://openyurt.io/zh/docs/installation/yurtctl-init-join

OK, I'll update it.

@Peeknut
Copy link
Member

Peeknut commented Mar 17, 2022

lgtm

But we want yurtctl init to just initialize the master node and yurtctl join to join the nodes. After the change, yurtctl init kind can be used to create a cluster, not just a master node. It seems complicate the use of yurtctl init. Does this go against the original idea? @rambohe-ch

@rambohe-ch
Copy link
Member

lgtm

But we want yurtctl init to just initialize the master node and yurtctl join to join the nodes. After the change, yurtctl init kind can be used to create a cluster, not just a master node. It seems complicate the use of yurtctl init. Does this go against the original idea? @rambohe-ch

@Peeknut It's a good question, and i agree with that yurtctl init kind create a cluster will go against the original idea. maybe we need to add another command for yurtctl to create a cluster. @Congrool @Peeknut Do you have any suggestions?

@Congrool
Copy link
Member Author

🤔 How adout adding a new command called yurtctl test, and we can use yurtctl test init to create this kind cluster. In further, we can integrate e2e tests into it by yurtctl test run. @rambohe-ch @Peeknut

@Peeknut
Copy link
Member

Peeknut commented Mar 17, 2022

🤔 How adout adding a new command called yurtctl test, and we can use yurtctl test init to create this kind cluster. In further, we can integrate e2e tests into it by yurtctl test run. @rambohe-ch @Peeknut

agree

@rambohe-ch
Copy link
Member

🤔 How adout adding a new command called yurtctl test, and we can use yurtctl test init to create this kind cluster. In further, we can integrate e2e tests into it by yurtctl test run. @rambohe-ch @Peeknut

@Congrool agree +1, add a new command yurtctl test.

@Congrool
Copy link
Member Author

/hold

@openyurt-bot openyurt-bot added the do-not-merge/hold do-not-merge/hold label Mar 17, 2022
@Congrool Congrool changed the title enable yurtctl init to setup OpenYurt cluster with kind add yurtctl test init cmd to setup OpenYurt cluster with kind Mar 25, 2022
@Congrool
Copy link
Member Author

/unhold

@openyurt-bot openyurt-bot removed the do-not-merge/hold do-not-merge/hold label Mar 25, 2022
@rambohe-ch
Copy link
Member

@Congrool How about modify e2e test in github action to use yurtctl test init?

@Congrool
Copy link
Member Author

Sure, I'll revise the github action.
/hold

@openyurt-bot openyurt-bot added the do-not-merge/hold do-not-merge/hold label Mar 30, 2022
@Congrool Congrool force-pushed the kindinit branch 2 times, most recently from cb8f93f to 0884ee5 Compare April 9, 2022 08:05
@Congrool
Copy link
Member Author

Congrool commented Apr 9, 2022

/unhold

@openyurt-bot openyurt-bot removed the do-not-merge/hold do-not-merge/hold label Apr 9, 2022
@openyurt-bot openyurt-bot added the approved approved label Apr 10, 2022
@rambohe-ch
Copy link
Member

/lgtm
/approve

@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Congrool, rambohe-ch

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

@kadisi kadisi removed the lgtm lgtm label Apr 11, 2022
@rambohe-ch
Copy link
Member

/lgtm

1 similar comment
@kadisi
Copy link
Member

kadisi commented Apr 11, 2022

/lgtm

@openyurt-bot openyurt-bot added the lgtm lgtm label Apr 11, 2022
@openyurt-bot openyurt-bot merged commit fba76e0 into openyurtio:master Apr 11, 2022
@Congrool Congrool deleted the kindinit branch April 18, 2022 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] refactor of yurtctl init to support kind
5 participants