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

Update e2e test images url #103724

Merged

Conversation

claudiubelu
Copy link
Contributor

@claudiubelu claudiubelu commented Jul 15, 2021

What type of PR is this?

/kind cleanup

/sig testing
/priority important-soon

What this PR does / why we need it:

Removes any reference from the registry gcr.io/kubernetes-e2e-test-images in kubernetes/kubernetes, replacing them with k8s.gcr.io/kubernetes-e2e-test-images. In some cases, the images had to be updated since a few things have changed since
their original implementation, most notably being the fact that some of the images have been centralized into the agnhost image.

Co-Authored-By: Claudiu Belu cbelu@cloudbasesolutions.com

Which issue(s) this PR fixes:

Fixes #96770

Special notes for your reviewer:

Cherry-picked from: #100470

Does this PR introduce a user-facing change?

``gcr.io/kubernetes-e2e-test-images`` will no longer be used in E2E / CI testing, ``k8s.gcr.io/e2e-test-images`` will be used instead.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. sig/testing Categorizes an issue or PR as relevant to SIG Testing. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. area/test sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Jul 15, 2021
@claudiubelu
Copy link
Contributor Author

/cc @spiffxp

@spiffxp
Copy link
Member

spiffxp commented Jul 15, 2021

@claudiubelu this needs a release note, which I don't have the bandwidth to draft today...

If I knew the answer to this before, it's been paged out of my brain, and I'll need time to page back in... what are the implications for people who are used to mirroring/air-gapping kubernetes-e2e-test-images? Do they need to use a different invocation after this lands? Would things break if they used the same invocation as they're using for v1.21? etc.

/cc @wilsonehusin @dims
I want eyes from someone who's used to air-gapping these images, if it's not you maybe you can point to someone who would be more appropriate?

@dims
Copy link
Member

dims commented Jul 15, 2021

@spiffxp for the air gapped scenarios that i have seen, folks just throw all the necessary images in the same bucket, it's us who have them in different buckets :)

cc @johnSchnake @vladimirvivien

@spiffxp
Copy link
Member

spiffxp commented Jul 16, 2021

/retest

@claudiubelu
Copy link
Contributor Author

/test pull-kubernetes-integration

@vladimirvivien
Copy link
Member

As far as an airgap use case for, say, Sonobuoy, this should be Ok as long as e2e test binary returns the proper repo when queried .

@claudiubelu
Copy link
Contributor Author

/test pull-kubernetes-integration

@@ -12,7 +12,8 @@ spec:
spec:
containers:
- name: netexec
image: gcr.io/kubernetes-e2e-test-images/netexec:1.0
image: k8s.gcr.io/e2e-test-images/agnhost:2.32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file even used anymore? I couldn't find any references to it (doing a very simple search in the repo), and the interesting part of a lot of these changes is that they aren't used in e2e anymore (but a few are used in the test/cmd shell scripts). The key point is that these can't be used inside of e2e binaries because they aren't subject to dynamic replacement (there's no code reading these and then looking up the correct value of the image before running it), so it's possible that we should move these out of test/e2e and into test/cmd/ (where appropriate).

For example:

  kubectl create -f test/e2e/testing-manifests/kubectl/agnhost-primary-pod.yaml "${kube_flags[@]}"

in test/cmd/core.sh is the only reference to the file above, so a separate PR moving these is probably appropriate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could have sworn we had code that dynamically substituted to support repo mappings passed in via KUBE_TEST_REPO

if repo := os.Getenv("KUBE_TEST_REPO"); len(repo) > 0 {
configs = GetMappedImageConfigs(originalImageConfigs, repo)
}

Maybe it's been removed since I last looked?

Copy link
Member

@spiffxp spiffxp Jul 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, here it is

// ReplaceRegistryInImageURL replaces the registry in the image URL with a custom one based
// on the configured registries.
func ReplaceRegistryInImageURL(imageURL string) (string, error) {
return replaceRegistryInImageURLWithList(imageURL, registry)
}

Used by

func patchContainerImages(containers []v1.Container) error {
var err error
for i, c := range containers {
containers[i].Image, err = imageutils.ReplaceRegistryInImageURL(c.Image)

Which you can get to via

func CreateFromManifests(f *framework.Framework, driverNamespace *v1.Namespace, patch func(item interface{}) error, files ...string) (func(), error) {

or

func PatchItems(f *framework.Framework, driverNamspace *v1.Namespace, items ...interface{}) error {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tl;dr I don't know if you were talking about the things in this specific file or these manifests in general, but they can have their images dynamically substituted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, indeed, some of these files do not seem to be used anymore, like:

test/e2e/testing-manifests/ingress/http/rc.yaml
test/e2e/testing-manifests/ingress/http2/rc.yaml
test/e2e/testing-manifests/ingress/multiple-certs/rc.yaml
test/e2e/testing-manifests/ingress/pre-shared-cert/rc.yaml
test/e2e/testing-manifests/ingress/static-ip/rc.yaml
test/e2e/testing-manifests/serviceloadbalancer/netexecrc.yaml

Some of them are still being used, like the test/e2e/testing-manifests/ingress/neg* ones.

test/e2e/testing-manifests/kubectl/agnhost-primary-pod.yaml seems to be used only in test/cmd/core.sh, so it could probably be moved out of test/e2e if needed.

And indeed, for some files the used images are dynamically substituted, which can be useful for airgapped environments (originally, AFAIK, the mechanism was introduced so we can use container images with Windows support for Windows test runs, before all the necessary work merged into k/k test images). But any other cleanup / change can be done in another PRs, specifically targeted towards those purposes. This PR just cleans up the gcr.io references.

@fedebongio
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 20, 2021
@spiffxp
Copy link
Member

spiffxp commented Jul 27, 2021

/milestone v1.23

@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Jul 27, 2021
Removes any reference from the registry gcr.io/kubernetes-e2e-test-images in
kubernetes/kubernetes, replacing it with k8s.gcr.io/kubernetes-e2e-test-images.
In some cases, the images had to be updated since a few things have changed since
their original implementation, most notably being the fact that some of the images
have been centralized into the agnhost image.

Co-Authored-By: Claudiu Belu <cbelu@cloudbasesolutions.com>
@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 28, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Jul 28, 2021
@claudiubelu
Copy link
Contributor Author

/test pull-kubernetes-integration

1 similar comment
@claudiubelu
Copy link
Contributor Author

/test pull-kubernetes-integration

@claudiubelu
Copy link
Contributor Author

/test pull-kubernetes-integration

Copy link
Member

@spiffxp spiffxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

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

@smarterclayton , it seems you're an approver for sample-apiserver. Is there anything else that needs to be addressed for this PR?

Comment on lines +23 to +24
# docker pull k8s.gcr.io/e2e-test-images/sample-apiserver:1.17.4
# docker tag k8s.gcr.io/e2e-test-images/sample-apiserver:1.17.4 kube-sample-apiserver:latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @liggitt @lavalamp @deads2k
we need an /approve from someone in sample-apiserver/OWNERS for this comment change

@liggitt
Copy link
Member

liggitt commented Aug 12, 2021

/approve

for comment change

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: claudiubelu, liggitt, spiffxp

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

@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 12, 2021
@k8s-ci-robot k8s-ci-robot merged commit 98e5263 into kubernetes:master Aug 12, 2021
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. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use k8s.gcr.io/e2e-test-images instead of gcr.io/kubernetes-e2e-test-images for e2e test images
9 participants