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] adapt k8s v1.22 version #809

Merged
merged 1 commit into from May 25, 2022

Conversation

rambohe-ch
Copy link
Member

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:

adapt k8s v1.22.3 version for OpenYurt components, the main work as following:

  1. upgrade NodeLifeCycle controller in yurt-controll-manager by referencing kube-controller-manager v1.22.3
  2. upgrade certificates manage for adapting v1.CSR and v1beta1.CSR api

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

@rambohe-ch: 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:

adapt k8s v1.22.3 version for OpenYurt components, the main work as following:

  1. upgrade NodeLifeCycle controller in yurt-controll-manager by referencing kube-controller-manager v1.22.3
  2. upgrade certificates manage for adapting v1.CSR and v1beta1.CSR api

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 kind/feature kind/feature size/XL size/XL: 500-999 labels Apr 19, 2022
@rambohe-ch rambohe-ch changed the title [feature] adapt k8s v1.22 version [WIP][feature] adapt k8s v1.22 version Apr 19, 2022
@openyurt-bot openyurt-bot added the do-not-merge/work-in-progress do-not-merge/work-in-progress label Apr 19, 2022
@openyurt-bot openyurt-bot added the approved approved label Apr 19, 2022
@rambohe-ch
Copy link
Member Author

/assign @Congrool @huiwq1990

@huiwq1990
Copy link
Member

/assign @Congrool @huiwq1990

@rambohe-ch I think we have some works to do with k8s1.22, like: unittest still use kind 1.21. How to contribute it?

@huiwq1990
Copy link
Member

After some check, I found why the unit test run failed. It's because the csr not auto approve, and they are in pending status.

[root@hg vagrant]# kubectl get csr
NAME        AGE     SIGNERNAME                                    REQUESTOR                              CONDITION
csr-lfkbn   5m13s   kubernetes.io/kube-apiserver-client-kubelet   system:bootstrap:abcdef                Approved,Issued
csr-n8f25   2m58s   kubernetes.io/kube-apiserver-client           system:bootstrap:abcdef                Approved,Issued
csr-rhtnp   88s     kubernetes.io/kubelet-serving                 system:node:openyurt-e2e-test-worker   Approved,Issued
csr-vxtrg   28s     kubernetes.io/kube-apiserver-client           system:bootstrap:abcdef                Pending
csr-zsztg   4m19s   kubernetes.io/kube-apiserver-client           system:node:openyurt-e2e-test-worker   Approved,Issued

We can manually approve them use command below.

kubectl get csr -o go-template --template='{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'  | xargs -n 1 kubectl certificate approve

As far as I know, we want to generate cert for edgenode, but apiserver need approve the csr before generate cert. Auto approve csr maybe the easiest way to solve it.

@Congrool
Copy link
Member

@huiwq1990
At https://github.com/openyurtio/openyurt/blob/master/pkg/yurtctl/cmd/yurttest/kindinit/init.go#L59-L65.
If we want to run kind with k8s v1.22, we should add its kind node image here.

One point we need to concern:
When supporting v1.22, we should also enable user to run openyurt based on k8s v1.21 or previous version. So, I think it should pass e2e-test of v1.21 as well.

@huiwq1990
Copy link
Member

@huiwq1990 At https://github.com/openyurtio/openyurt/blob/master/pkg/yurtctl/cmd/yurttest/kindinit/init.go#L59-L65. If we want to run kind with k8s v1.22, we should add its kind node image here.

One point we need to concern: When supporting v1.22, we should also enable user to run openyurt based on k8s v1.21 or previous version. So, I think it should pass e2e-test of v1.21 as well.

The k8s v1.22 feature is on branch rambohe-ch:update-k8s-v1.22, where we commit the code?

@Congrool
Copy link
Member

Congrool commented Apr 20, 2022

The k8s v1.22 feature is on branch rambohe-ch:update-k8s-v1.22, where we commit the code?

@huiwq1990 Well, there're serval ways for cooperation on Github.

  1. The most common case:
    We can open a new pull request to openyurt:master to enable yurtctl test to run openyurt based on k8s v1.22. And @rambohe-ch can use git rebase to merge this code in rambohe-ch:update-k8s-v1.22. After adapting the v1.22 csr, we can finally add v1.22 e2e-test into github action.
  2. Create pull request in the forked repo
    You can fork rambohe:openyurt, and commit to the branch in your forked repo. Then create a pull request to rambohe:openyurt. @rambohe-ch can merge your commit into rambohe-ch:update-k8s-v1.22 and finally create a pull request to openyurt:master.
  3. As a collaborator of the forked repo
    In this case, it needs @rambohe-ch to invite you as a collaborator of rambohe:openyurt. Then you can commit to the branch directly.

@huiwq1990
Copy link
Member

@rambohe-ch @Congrool Hi, I just finish adapt k8s 1.22 and create a pull request #821. My work is base on your code. What's your suggestion use which branch?

@rambohe-ch rambohe-ch changed the title [WIP][feature] adapt k8s v1.22 version [feature] adapt k8s v1.22 version May 23, 2022
@openyurt-bot openyurt-bot added size/XXL and removed size/XL size/XL: 500-999 do-not-merge/work-in-progress do-not-merge/work-in-progress labels May 23, 2022
@rambohe-ch
Copy link
Member Author

@huiwq1990 @Congrool OpenYurt for K8s v1.22.3 adaption has been completed. please take a look.

@Congrool
Copy link
Member

Do we mainly focus on this pr, what about #821? @rambohe-ch @huiwq1990

@rambohe-ch
Copy link
Member Author

Do we mainly focus on this pr, what about #821? @rambohe-ch @huiwq1990

@Congrool yes, i had contacted with @huiwq1990 , we will use this pr to adapt k8s v1.22 for OpenYurt.

cmd/yurt-tunnel-server/app/start.go Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
@huiwq1990
Copy link
Member

@rambohe-ch we should push other project adapt k8s 1.22 too ,like openyurtio/yurt-app-manager#49.

@Congrool
Copy link
Member

/lgtm

@openyurt-bot openyurt-bot added the lgtm lgtm label May 24, 2022
@rambohe-ch
Copy link
Member Author

Fixes #734

@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

@rambohe-ch
Copy link
Member Author

Fixes #734

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]adapt Kubernetes v1.22+ for yurthub/yurt-tunnel components.
5 participants