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

feature: add ability for 'yurtctl convert/revert' to deploy/remove yurthub on cloud side. #513

Merged
merged 2 commits into from
Oct 11, 2021

Conversation

DrmagicE
Copy link
Member

@DrmagicE DrmagicE commented Oct 1, 2021

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage
/sig storage

/kind feature

What this PR does / why we need it:

#504

Which issue(s) this PR fixes:

Fixes #504

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

TODO:

  • yurtctl convert can deploy yurthub on cloud side.
  • yurtctl revert can remove yurthub on cloud side.

@openyurt-bot
Copy link
Collaborator

@DrmagicE: 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?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage
/sig storage

/kind feature

What this PR does / why we need it:

#504

Which issue(s) this PR fixes:

Fixes #504

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

TODO:

  • yurtctl convert can deploy yurthub on cloud side.
  • yurtctl revert can remove yurthub on cloud side.

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.

@openyurt-bot openyurt-bot added kind/feature kind/feature do-not-merge/work-in-progress do-not-merge/work-in-progress labels Oct 1, 2021
@openyurt-bot openyurt-bot requested review from huangyuqi and qclc October 1, 2021 12:47
@openyurt-bot openyurt-bot added the size/XL size/XL: 500-999 label Oct 1, 2021
@openyurt-bot openyurt-bot added size/XXL and removed size/XL size/XL: 500-999 labels Oct 10, 2021
@DrmagicE
Copy link
Member Author

DrmagicE commented Oct 10, 2021

I have tested this feature with a kubeadm setup cluster, here is the log output from yurtctl convert and yurtctl revert:

[root@master-1 ~]# ./yurtctl convert --provider kubeadm --cloud-nodes master-1 -t -e  \
> --kubeadm-conf-path /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf \
> --yurthub-healthcheck-timeout 5m \
> --yurtctl-servant-image xxx/yurtctl-servant:latest \
> --yurt-app-manager-image xxx/yurt-app-manager:v0.5.0 \
> --yurt-controller-manager-image xxx/yurt-controller-manager:v0.5.0 \
> --yurt-tunnel-agent-image xxx/yurt-tunnel-agent:v0.5.0 \
> --yurt-tunnel-server-image xxx/yurt-tunnel-server:v0.5.0 \
>  --yurthub-image xxx/yurthub:v0.5.0
I1008 13:35:17.600540   14261 convert.go:318] mark master-1 as the cloud-node
I1008 13:36:07.683598   14261 util.go:494] servant job(yurtctl-disable-node-controller-master-1) has succeeded
I1008 13:36:07.683625   14261 convert.go:343] complete disabling node-controller
I1008 13:36:07.773106   14261 convert.go:354] yurt-tunnel-server is deployed
I1008 13:36:07.796837   14261 convert.go:362] yurt-tunnel-agent is deployed
I1008 13:36:07.809423   14261 convert.go:443] kube-public/cluster-info configmap already exists, skip to prepare it
CustomResourceDefinition/nodepools.apps.openyurt.io createdI1008 13:36:09.012591   14261 request.go:621] Throttling request took 1.119056688s, request: GET:https://192.168.33.220:6443/apis/node.k8s.io/v1beta1?timeout=32s
CustomResourceDefinition/uniteddeployments.apps.openyurt.io createdI1008 13:36:09.380570   14261 convert.go:381] yurt-app-manager is deployed
I1008 13:36:09.425444   14261 convert.go:408] deploying the yurt-hub and resetting the kubelet service on edge nodes...
I1008 13:37:39.480938   14261 util.go:494] servant job(yurtctl-servant-convert-worker-1) has succeeded
I1008 13:37:39.480971   14261 convert.go:414] complete deploying yurt-hub on edge nodes
I1008 13:37:39.480980   14261 convert.go:417] deploying the yurt-hub and resetting the kubelet service on cloud nodes
I1008 13:38:59.539698   14261 util.go:494] servant job(yurtctl-servant-convert-master-1) has succeeded
I1008 13:38:59.539732   14261 convert.go:423] complete deploying yurt-hub on cloud nodes
[root@master-1 ~]# ./yurtctl revert  --kubeadm-conf-path /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf \
> --yurtctl-servant-image xxx/yurtctl-servant:latest
I1008 13:39:08.101451   17020 revert.go:164] yurt controller manager is removed
I1008 13:39:08.109483   17020 revert.go:174] serviceaccount for yurt controller manager is removed
I1008 13:39:08.130562   17020 revert.go:184] clusterrole for yurt controller manager is removed
I1008 13:39:08.155027   17020 revert.go:194] clusterrolebinding for yurt controller manager is removed
I1008 13:39:48.425237   17020 util.go:494] servant job(yurtctl-enable-node-controller-master-1) has succeeded
I1008 13:39:48.425271   17020 revert.go:219] complete enabling node-controller
I1008 13:39:58.444250   17020 util.go:494] servant job(yurtctl-servant-revert-worker-1) has succeeded
I1008 13:39:58.444285   17020 revert.go:232] complete removing yurt-hub and resetting kubelet service on edge nodes
I1008 13:40:08.467508   17020 util.go:494] servant job(yurtctl-servant-revert-master-1) has succeeded
I1008 13:40:08.467544   17020 revert.go:240] complete removing yurt-hub and resetting kubelet service on cloud nodes
I1008 13:40:08.504408   17020 revert.go:248] delete yurthub clusterrole and clusterrolebinding

@DrmagicE
Copy link
Member Author

/assign @rambohe-ch

@DrmagicE DrmagicE changed the title [WIP]feature: add ability for 'yurtctl convert/revert' to deploy/remove yurthub on cloud side. feature: add ability for 'yurtctl convert/revert' to deploy/remove yurthub on cloud side. Oct 10, 2021
@openyurt-bot openyurt-bot removed the do-not-merge/work-in-progress do-not-merge/work-in-progress label Oct 10, 2021
@openyurt-bot openyurt-bot added the approved approved label Oct 11, 2021
@rambohe-ch
Copy link
Member

/lgtm
/approve

@openyurt-bot openyurt-bot added the lgtm lgtm label Oct 11, 2021
@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DrmagicE, 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

@openyurt-bot openyurt-bot merged commit 0386d05 into openyurtio:master Oct 11, 2021
MrGirl pushed a commit to MrGirl/openyurt that referenced this pull request Mar 29, 2022
…rthub on cloud side. (openyurtio#513)

* feature: add ability for 'yurtctl convert' to deploy yurthub on cloud side

* add 'yurtctl revert cloudnode' subcommand to revert cloud nodes
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] Add ability for yurtctl to deploy yurthub in cloud nodes.
3 participants