recorded decision · public · no signup
KEP-2464: Kubetest2 CI migration
What was chosen
- This KEP proposes a plan for migrating and deprecating CI jobs in the critical path of a release to kubetest2.adr ↗
- All Kubernetes release-blocking and merge-blocking jobs will use kubetest2 to reduce maintenance burden and improve troubleshooting.adr ↗
- Shadow canary jobs will be created for presubmit-kubernetes-blocking and release-blocking jobs using kubetest2 as optional, non-blocking tests.adr ↗
- The `scenario=execute` script will be replaced by the kubetest2 exec tester.adr ↗
- The `scenarios=kubernetes_build` script, used for pushing CI builds, will be replaced by KREL.adr ↗
What was ruled out· 1
- Improving kubetest, scenarios, and push-build.sh was rejected due to their inherent design flaws and maintenance difficulties.adr ↗
Constraints
- Implementing kubetest2 deployers for all existing kubetest providers is not a goal of this KEP.adr ↗
- Migrating all 1700+ e2e jobs away from deprecated tools like scenarios and bootstrap is not a goal of this KEP.adr ↗
- No changes will be made to existing release branches or their CI; old jobs will age out.adr ↗
Consequences
- Kubetest lacks proper owners and active contribution, leading to support being added only when bugs are discovered.adr ↗
The recorded why
KEP-2464: Kubetest2 CI migration
<!-- This is the title of your KEP. Keep it short, simple, and descriptive. A good title can help communicate what the KEP is and should be considered as part of any review. --> <!-- A table of contents is helpful for quickly jumping to sections of a KEP and for highlighting any additional information provided beyond the standard KEP template. Ensure the TOC is wrapped with <code><!-- toc --&rt;<!-- /toc --&rt;</code> tags, and then generate with `hack/update-toc.sh`. --> <!-- toc -->- Release Signoff Checklist
- Summary
- Motivation
- Proposal
- Design Details
- Production Readiness Review Questionnaire
- Implementation History
- Drawbacks
- Alternatives
- Infrastructure Needed (Optional)
§ Release Signoff Checklist
<!-- **ACTION REQUIRED:** In order to merge code into a release, there must be an issue in [kubernetes/enhancements] referencing this KEP and targeting a release milestone **before the [Enhancement Freeze](https://git.k8s.io/sig-release/releases) of the targeted release**. For enhancements that make changes to code or processes/procedures in core Kubernetes—i.e., [kubernetes/kubernetes], we require the following Release Signoff checklist to be completed. Check these off as they are completed for the Release Team to track. These checklist items _must_ be updated for the enhancement to be released. -->Items marked with (R) are required prior to targeting to a milestone / release.
- (R) Enhancement issue in release milestone, which links to KEP dir in kubernetes/enhancements (not the initial KEP PR)
- (R) KEP approvers have approved the KEP status as
implementable - (R) Design details are appropriately documented
- (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
- (R) Graduation criteria is in place
- (R) Production readiness review completed
- (R) Production readiness review approved
- "Implementation History" section is up-to-date for milestone
- User-facing documentation has been created in kubernetes/website, for publication to kubernetes.io
- Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
§ Summary
<!-- This section is incredibly important for producing high-quality, user-focused documentation such as release notes or a development roadmap. It should be possible to collect this information before implementation begins, in order to avoid requiring implementors to split their attention between writing release notes and implementing the feature itself. KEP editors and SIG Docs should help to ensure that the tone and content of the `Summary` section is useful for a wide audience. A good summary is probably at least a paragraph in length. Both in this section and below, follow the guidelines of the [documentation style guide]. In particular, wrap lines to a reasonable length, to make it easier for reviewers to cite specific portions, and to minimize diff churn on updates. [documentation style guide]: https://github.com/kubernetes/community/blob/master/contributors/guide/style-guide.md -->Kubernetes currently uses Kubetest as the interface for launching and running e2e tests.
It also uses a set of scripts called “scenarios” for running common use cases such as setting up end-to-end tests or pushing CI builds.
Kubetest and scenarios have both been deprecated, (2) for a while, with a recommendation to move jobs to kubetest2.
This KEP proposes a plan for migration/deprecation of CI jobs that are in the critical path of a release.
§ Motivation
<!-- This section is for explicitly listing the motivation, goals, and non-goals of this KEP. Describe why the change is important and the benefits to users. The motivation section can optionally provide links to [experience reports] to demonstrate the interest in a KEP within the wider Kubernetes community. [experience reports]: https://github.com/golang/go/wiki/ExperienceReports -->Goals
- Converge towards a single community-supported e2e launcher tool for kubernetes
- Ensure all kubernetes/kubernetes release-blocking and merge-blocking jobs use the same e2e test tool, to reduce community maintenance burden, increase community troubleshooting awareness
- Document guides for migrating jobs away from kubetest to kubetest2 to enable self-service migration of non-blocking jobs
- Accelerate the migration from bootstrap.py to pod-utilities since Kubetest2 does not depend on bootstrap
- Enable SIG Release to deprecate legacy push-build.sh
Non-Goals
<!-- What is out of scope for this KEP? Listing non-goals helps to focus discussion and make progress. -->- Implementing kubetest2 deployers for all existing kubetest providers
- kubetest2 enables implementing custom deployers out-of-tree so replacing all of the deployers upstream is not a hard requirement
- Migrate all 1700+ e2e jobs away from the deprecated e2e test tools (e.g. scenarios, bootstrap, kubetes)
- This KEP only covers migrating all kubernetes/kubernetes release-blocking and merge-blocking jobs.
- We propose enforcing no further changes to the remaining deprecated tools to incentivize community migration and improvements to kubetest2.
- Other community efforts are already underway (e.g. removing the kubernetes_build scenario)
- Backporting changes to older release branches
- In general, no changes should be made to the release branches or their CI and the old jobs will age out.
- Decoupling from kubekins to a more minimal image
- The kubekins image has become a kitchen-sink over the years, used by more jobs than necessary, and containing more dependencies than required for effective kubetest2 usage
- Migrating kubekins away from bootstrap as a base image is only feasible once all jobs have migrated away from bootstrap, which is a non-goal of this KEP
§ Proposal
<!-- This is where we get down to the specifics of what the proposal actually is. This should have enough detail that reviewers can understand exactly what you're proposing, but should not include things like API designs or implementation. What is the desired outcome and how do we measure success?. The "Design Details" section below is for the real nitty-gritty. -->For the development (main/master) branch only, NOT the existing release branches:
- Create shadow canary jobs for each presubmit-kubernetes-blocking, release-blocking to use kubetest2 as optional, non-blocking
- Monitor these canary jobs till they are stable
- Make kubetest2 jobs non-optional, non-blocking
- Make kubetest2 jobs non-optional, blocking
No changes should be made to the release branches or their CI.
User Stories (Optional)
<!-- Detail the things that people will be able to do if this KEP is implemented. Include as much detail as possible so that people can understand the "how" of the system. The goal here is to make this feel real for users without getting bogged down. -->Story 1
Story 2
Notes/Constraints/Caveats (Optional)
<!-- What are the caveats to the proposal? What are some important details that didn't come across above? Go in to as much detail as necessary here. This might be a good place to talk about core concepts and how they relate. -->Risks and Mitigations
<!-- What are the risks of this proposal, and how do we mitigate? Think broadly. For example, consider both security and how this will impact the larger Kubernetes ecosystem. How will security be reviewed, and by whom? How will UX be reviewed, and by whom? Consider including folks who also work outside the SIG or subproject. -->- Stage 1 of shipping the kubetest2 binary involves keeping HEAD at kubetest2 unbroken (same as kubetest currently).
- Stage 2 of the proposal involves monitoring a job to become stable which might encounter discrepancies between its existing kubetest2 counterpart.
§ Design Details
<!-- This section should contain enough information that the specifics of your change are understandable. This may include API specs (though not always required) or even code snippets. If there's any ambiguity about HOW your proposal will be implemented, this is the place to discuss them. -->CI Jobs:
The following deployers/testers are used as part of the jobs in consideration:
-
KIND:
KIND jobs neither uses scenarios nor kubetest so most KIND jobs are noops.
- KIND is already a supported kubetest2 deployer for basic end-to-end testing.
- Possible future consideration for kubetest2 kind jobs:
- A typical kind job runs using the krte image, downloads the latest kind binary, sets up the environment for the test job using e2e-k8s.sh
- Future additions required to the KIND deployer
- support fetching latest kind binaries
- move over functionality from e2e-k8s.sh as part of the kind deployer
-
GCE:
GCE jobs are the ones that use scenarios and kubetest the most. Most of the GCE deployer logic has been ported over to kubetest2, see implementation history for details. We also have a canary job for GCE conformance using kubetest2.
-
Node:
Most of the node e2e logic is consolidated as part of the e2e test themselves. So the jobs basically create noop clusters which will need to be implemented in kubetest2. This noop deployer will also be useful for other build jobs. Additionally, we can have a short wrapper over the noop deployer specifically for the node deployer to mimic what kubetest does, e.g. setting up GCP SSH Keys
-
Scale:
Scale tests use the clusterloader2 framework in kubernetes/perf-tests. kubetest2 already has support for clusterloader2 tester.
-
Ginkgo:
All of the jobs (apart from scale jobs) are using the kubernetes test/e2e framework which uses ginkgo for the end-to-end tests. kubetest2 already supports this ginkgo tester. Some tests require checking for version-skew between the client and server version, support for which will need to be added in kubetest2.
Scenarios:
There are mainly 3 scenarios that are currently used:
-
scenario=executeis used to run arbitrary test scripts. It can be replaced by the kubetest2 exec tester.kubetest2 --test=exec – script.sh -
scenario=kubernetes_e2eis used for setting up the environment for end-to-end jobs.- It specifies it’s own set of flags to customize the setup all of which are deprecated and unused.
- It has a lot of functionality for setting up Kops clusters which will need to be ported over to be part of the kubetest2 kops deployer. They are currently being monitored in testgrid here: https://testgrid.k8s.io/kops-kubetest2#e2e-kubetest2
Most other usages in jobs are used to indirectly invoke kubetest, which will be replaced by their equivalent kubetest2 commands.
kubetest2 <deployer> --build --up --down --deployer-specific-setup-flags -
scenarios=kubernetes_buildwhich is primarily used for pushing CI builds to GCS. This is where we are also using the legacy push-build scripts (in addition to kubetest --stage). These will be replaced by KREL.Optionally they can also be migrated to use the kubetest2 KREL integration.
kubetest2 noop --build --stage=gs://bucketAdditionally, there is exactly one usage of
scenario=canarypushwhich can be replaced by an equivalent script and migrated to using kubetest2 exec tester.
Managing kubetest2 dependency
- Add a script to kubekins-e2e to fetch pre-built latest kubetest2 binaries (stored in GCS) as part of each job
- Distribute a tagged version of kubetest2 binary for each release and add to variants.yaml for kubekins-e2e
- Publish a kubetest2 specific images (optional)
Test Plan
<!-- **Note:** *Not required until targeted at a release.* Consider the following in developing a test plan for this enhancement: - Will there be e2e and integration tests, in addition to unit tests? - How will it be tested in isolation vs with other components? No need to outline all of the test cases, just the general strategy. Anything that would count as tricky in the implementation, and anything particularly challenging to test, should be called out. All code is expected to have adequate tests (eventually with coverage expectations). Please adhere to the [Kubernetes testing guidelines][testing-guidelines] when drafting this test plan. [testing-guidelines]: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md -->Graduation Criteria
-
This will be declared alpha when:
- Jobs fetch latest pre-built kubetest2 binaries at runtime
- GCE jobs have corresponding kubetest2 shadow jobs on k/k master
- Noop support is added for node deployer and build
-
This will be declared beta when:
- A guide for migration from kubetest to kubetest2 exists
- GCE jobs are monitored to be stable, and have moved over to kubetest2
- Node, Scale jobs have corresponding shadow jobs on k/k master
-
This will be declared GA when:
- Jobs use pre-installed tagged versions of kubetest2 binaries
- Tracking issues exist for each SIG to migrate their jobs from kubetest to kubetest2
- All kubernetes/kubernetes master presubmit-kubernetes-blocking, release-blocking jobs are using kubetest2
Excerpt — the full document is at the cited source: keps/sig-testing/2464-kubetest2-ci-migration/README.md ↗