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

Enable CI tests in K8s 1.25 #1341

Merged
merged 3 commits into from
Oct 7, 2022

Conversation

torredil
Copy link
Member

@torredil torredil commented Aug 15, 2022

What is this PR about? / Why do we need it?

  • Upgrade k8s.io/kubernetes to 1.25.
  • Upgrade github.com/onsi/ginkgo to v2.
  • Use kubetest2 for e2e-kubernetes and use the upstream binary for this test.
  • Split K8S_VERSION in tests between kOps and eksctl so that we can test them independently.
  • Removed migration tests due to in-tree driver removal.
  • Remove CSIDriverRegistry, CSINodeInfo, and CSIBlockVolume from hack/kops-patch.yaml as the feature gates have been GA since K8s v1.18.

Signed-off-by: Eddie Torres torredil@amazon.com

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 15, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 15, 2022
@ConnorJC3
Copy link
Contributor

Needs eksctl version bump to https://github.com/weaveworks/eksctl/releases/tag/v0.109.0-rc.0 for k8s 1.23 support.

@olemarkus
Copy link

@torredil I wonder if it is worth implementing a feature in kops where you tell kops the addon is enabled, but it's selfmanaged. That way kops will behave as if it installed the addon, but won't deploy the manifest. We do this e.g for cert-manager, which a lot of people prefer to self-manage.

This will make it a lot easier to migrate to 1.24, where CSI driver is mandatory and cannot be disabled.

@ConnorJC3
Copy link
Contributor

kops patch needs merge with this to disable security feature of preventing nodes from accessing IMDSv2:

spec:
  instanceMetadata:
    httpPutResponseHopLimit: 3

@torredil
Copy link
Member Author

@olemarkus Can you clarify this point: "CSI driver is mandatory and cannot be disabled". My understanding was that even in kOps v1.24, users would still be able to disable the CSI driver as currently done in kops-patch.yaml.

cloudConfig:
    awsEBSCSIDriver:
      enabled: false

If this is not the case, then I think the solution you are proposing would be worth implementing.

@olemarkus
Copy link

@olemarkus Can you clarify this point: "CSI driver is mandatory and cannot be disabled". My understanding was that even in kOps v1.24, users would still be able to disable the CSI driver as currently done in kops-patch.yaml.

cloudConfig:
    awsEBSCSIDriver:
      enabled: false

If this is not the case, then I think the solution you are proposing would be worth implementing.

To be precise, kOps 1.24 with K8s 1.24 will enable external cloud-controller-manager, which in turn requires CSI. So the above snippet will fail with "external cloud controller manager requires CSI driver to be enabled" or something to that effect.

@ConnorJC3
Copy link
Contributor

@olemarkus thoughts on just disabling the external CCM in CI as a temporary fix? I can't think of any reason it would be needed in CI.

Also, I think I might have seen someone mention this elsewhere on another issue, but I wonder if as a long term fix it would be better to add a kops option to override the EBS CSI Driver container repo/tag. Then, the CI could just deploy the driver via kops which would be easier and probably more accurately represent real-world customer installations.

@torredil
Copy link
Member Author

torredil commented Aug 15, 2022

Adding this here for context: As of kOps 1.22, new clusters running Kubernetes 1.22+ on AWS will restrict Pod access to the instance metadata service. This means that Pods will also be prevented from directly assuming instance roles. See https://kops.sigs.k8s.io/iam_roles/#adding-additional-policies

@olemarkus
Copy link

@olemarkus thoughts on just disabling the external CCM in CI as a temporary fix? I can't think of any reason it would be needed in CI.

kOps is moving away from in-tree CCM. From kOps perspective it doesn't make much sense to add any option to disable it.

Also, I think I might have seen someone mention this elsewhere on another issue, but I wonder if as a long term fix it would be better to add a kops option to override the EBS CSI Driver container repo/tag. Then, the CI could just deploy the driver via kops which would be easier and probably more accurately represent real-world customer installations.

Yes. That is also an option. There are quite a few images involved though, so a question of how much configurability you need. E.g do you want to test all the sidecars?

FWIW, we run the CSI driver e2e test against all our configurations now. So e.g the 1.23 results can be seen here: https://testgrid.k8s.io/kops-k8s-1.23#kops-aws-k8s-1-23 (tests containing the string "External Storage")

hack/kops-patch.yaml Outdated Show resolved Hide resolved
@torredil torredil force-pushed the update-k8s-ci branch 4 times, most recently from 3e78697 to c275e78 Compare August 15, 2022 23:19
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 15, 2022
@torredil torredil force-pushed the update-k8s-ci branch 2 times, most recently from cf72f41 to 3669771 Compare August 16, 2022 00:10
@torredil torredil removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2022
@ghost
Copy link

ghost commented Sep 12, 2022

@torredil anything we can do to get this merged anytime soon? We currently are running our own tests manually on every driver release because upstream doesn't bother running them for k8s 1.25

@olemarkus
Copy link

@MurphyPuppy See e.g https://testgrid.k8s.io/kops-k8s-1.23#kops-aws-k8s-1-23 mentioned above. The k8s community already tests this driver on multiple versions and configurations.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 12, 2022
@torredil torredil force-pushed the update-k8s-ci branch 2 times, most recently from 0f78410 to 06af297 Compare October 3, 2022 18:51
@torredil
Copy link
Member Author

torredil commented Oct 3, 2022

/retest

@olemarkus
Copy link

Some great work here!

@torredil torredil marked this pull request as ready for review October 4, 2022 14:42
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 4, 2022
Makefile Outdated Show resolved Hide resolved
hack/e2e/run.sh Show resolved Hide resolved
hack/update-gomock Show resolved Hide resolved
tests/e2e-kubernetes/manifests.yaml Show resolved Hide resolved
tests/e2e/suite_test.go Outdated Show resolved Hide resolved
hack/e2e/run.sh Outdated Show resolved Hide resolved
@ConnorJC3
Copy link
Contributor

/hold for more reviews
/lgtm other than needing an irebase to cleanup the history

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 5, 2022
@ConnorJC3
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 5, 2022
@wongma7
Copy link
Contributor

wongma7 commented Oct 5, 2022

/lgtm
thx

torredil and others added 3 commits October 6, 2022 21:37
Signed-off-by: Eddie Torres <torredil@amazon.com>
Co-authored-by: ConnorJC3 <conncatl@amazon.com>
Signed-off-by: Eddie Torres <torredil@amazon.com>
Signed-off-by: Eddie Torres <torredil@amazon.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 6, 2022
@torredil
Copy link
Member Author

torredil commented Oct 6, 2022

Good to go
thanks team 👍

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gtxu, torredil

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

@gtxu
Copy link
Contributor

gtxu commented Oct 7, 2022

/lgtm
/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 7, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2022
@k8s-ci-robot k8s-ci-robot merged commit c156536 into kubernetes-sigs:master Oct 7, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants