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

[bug] fix some bugs when local up openyurt #517

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

Congrool
Copy link
Member

@Congrool Congrool commented Oct 12, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

When we set NODE_NUM greater than 2, there's a bug which prevents us from converting worker nodes into openyurt nodes.
The reason of the problem is that the following command will end in format error when we use it to load images into kind nodes.

 local nodesarg=$(echo "${master} ${edgenodes[@]}" | sed "s/ /,/g")

Assuming that we have two edge nodes called openyurt-e2e-test-worker and openyurt-e2e-test-worker2 respectively. The master node is called as openyurt-e2e-test-control-plane. The result of the command is

loading image yurthub-linux-amd64.tar to nodes
++ echo 'openyurt-e2e-test-control-plane openyurt-e2e-test-worker
openyurt-e2e-test-worker2'
++ sed 's/ /,/g'
+ local 'nodesarg=openyurt-e2e-test-control-plane,openyurt-e2e-test-worker
openyurt-e2e-test-worker2'

Then when we use nodesarg to load images into kind nodes, the result is something like this:

+ kind load image-archive /root/openyurt/openyurt/_output/images/yurthub-linux-amd64.tar --name openyurt-e2e-test --nodes openyurt-e2e-test-control-plane,openyurt-e2e-test-worker openyurt-e2e-test-worker2

We can find that there's no comma between openyurt-e2e-test-worker and openyurt-e2e-test-worker2 which kind requires. As a result, the image is only loaded into openyurt-e2e-test-control-plane and openyurt-e2e-test-worker. Thus, the conversion of openyurt-e2e-test-worker2 will fail for the lack of images.

[root@node1 openyurt]# kubectl get pod -A
NAMESPACE            NAME                                                      READY   STATUS             RESTARTS   AGE
kube-system          coredns-66bff467f8-6zrgr                                  1/1     Running            0          11m
kube-system          coredns-66bff467f8-blcd4                                  1/1     Running            0          11m
kube-system          etcd-openyurt-e2e-test-control-plane                      1/1     Running            0          11m
kube-system          kindnet-csdvg                                             1/1     Running            0          11m
kube-system          kindnet-kvj55                                             1/1     Running            0          11m
kube-system          kindnet-r5vnm                                             1/1     Running            0          11m
kube-system          kube-apiserver-openyurt-e2e-test-control-plane            1/1     Running            0          11m
kube-system          kube-controller-manager-openyurt-e2e-test-control-plane   1/1     Running            0          10m
kube-system          kube-proxy-dg7mc                                          1/1     Running            0          11m
kube-system          kube-proxy-k6cnw                                          1/1     Running            0          11m
kube-system          kube-proxy-rc855                                          1/1     Running            0          11m
kube-system          kube-scheduler-openyurt-e2e-test-control-plane            1/1     Running            0          11m
kube-system          yurt-controller-manager-64869c8847-tb8rp                  1/1     Running            0          10m
kube-system          yurt-hub-openyurt-e2e-test-control-plane                  1/1     Running            0          7m58s
kube-system          yurt-hub-openyurt-e2e-test-worker                         1/1     Running            0          9m58s
kube-system          yurtctl-servant-convert-openyurt-e2e-test-worker2-dxw89   0/1     ImagePullBackOff   0          9m59s
local-path-storage   local-path-provisioner-59c6df4d-x8l29                     1/1     Running            0          11m

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

@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 bug

What this PR does / why we need it:

When we set NODE_NUM greater than 2, there's a bug which makes us cannot convert worker nodes into openyurt nodes.
The reason of the problem is that the following command will end in format error when we use it to load images into kind nodes.

local nodesarg=$(echo "${master} ${edgenodes[@]}" | sed "s/ /,/g")

Assuming that we have two edge nodes called openyurt-e2e-test-worker and openyurt-e2e-test-worker2 respectively. The master node is called as openyurt-e2e-test-control-plane. The result of the command is

loading image yurthub-linux-amd64.tar to nodes
++ echo 'openyurt-e2e-test-control-plane openyurt-e2e-test-worker
openyurt-e2e-test-worker2'
++ sed 's/ /,/g'
+ local 'nodesarg=openyurt-e2e-test-control-plane,openyurt-e2e-test-worker
openyurt-e2e-test-worker2'

Then when we use nodesarg to load images into kind nodes, the result is something like this:

+ kind load image-archive /root/openyurt/openyurt/_output/images/yurthub-linux-amd64.tar --name openyurt-e2e-test --nodes openyurt-e2e-test-control-plane,openyurt-e2e-test-worker openyurt-e2e-test-worker2

We can find that there's no comma between openyurt-e2e-test-worker and openyurt-e2e-test-worker2 which kind requires. As a result, the image is only loaded into openyurt-e2e-test-control-plane and openyurt-e2e-test-worker. Thus, the conversion of openyurt-e2e-test-worker2 will fail for the lack of images.

[root@node1 openyurt]# kubectl get pod -A
NAMESPACE            NAME                                                      READY   STATUS             RESTARTS   AGE
kube-system          coredns-66bff467f8-6zrgr                                  1/1     Running            0          11m
kube-system          coredns-66bff467f8-blcd4                                  1/1     Running            0          11m
kube-system          etcd-openyurt-e2e-test-control-plane                      1/1     Running            0          11m
kube-system          kindnet-csdvg                                             1/1     Running            0          11m
kube-system          kindnet-kvj55                                             1/1     Running            0          11m
kube-system          kindnet-r5vnm                                             1/1     Running            0          11m
kube-system          kube-apiserver-openyurt-e2e-test-control-plane            1/1     Running            0          11m
kube-system          kube-controller-manager-openyurt-e2e-test-control-plane   1/1     Running            0          10m
kube-system          kube-proxy-dg7mc                                          1/1     Running            0          11m
kube-system          kube-proxy-k6cnw                                          1/1     Running            0          11m
kube-system          kube-proxy-rc855                                          1/1     Running            0          11m
kube-system          kube-scheduler-openyurt-e2e-test-control-plane            1/1     Running            0          11m
kube-system          yurt-controller-manager-64869c8847-tb8rp                  1/1     Running            0          10m
kube-system          yurt-hub-openyurt-e2e-test-control-plane                  1/1     Running            0          7m58s
kube-system          yurt-hub-openyurt-e2e-test-worker                         1/1     Running            0          9m58s
kube-system          yurtctl-servant-convert-openyurt-e2e-test-worker2-dxw89   0/1     ImagePullBackOff   0          9m59s
local-path-storage   local-path-provisioner-59c6df4d-x8l29                     1/1     Running            0          11m

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


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.

@openyurt-bot openyurt-bot added the kind/bug kind/bug label Oct 12, 2021
@openyurt-bot openyurt-bot added the size/XS size/XS: 0-9 label Oct 12, 2021
@Congrool Congrool changed the title [bug] fix local_up_openyurt when NODES_NUM is greater than 2 [bug] fix some bugs when local up openyurt Oct 12, 2021
@Congrool
Copy link
Member Author

Congrool commented Oct 12, 2021

Also we find that expr substr doesn't work on Mac, so we replace it with cut.

@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

@openyurt-bot openyurt-bot merged commit 71fd79c into openyurtio:master Oct 12, 2021
MrGirl pushed a commit to MrGirl/openyurt that referenced this pull request Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved kind/bug kind/bug lgtm lgtm size/XS size/XS: 0-9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants