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

Add conformance test flag to set implementation labels on mesh namespaces #1957

Merged
merged 10 commits into from
May 17, 2023

Conversation

frankbu
Copy link
Contributor

@frankbu frankbu commented Apr 21, 2023

What type of PR is this?

/test
/area conformance

What this PR does / why we need it:

Some mesh implementations require namespaces that are part of the mesh to include implementation-specific labels. For example, Istio requires an istio-injection=enabled label on mesh namespaces to turn on sidecar injection.

This PR adds a new flag that can be used to pass in labels that should be added to namespaces where mesh-enabled services are deployed (e.g., --namespace-labels "istio-injection=enabled" can be set to run on Istio).

This new flag is implemented using the existing NamespaceLabels field in suite.Options. This PR is only making it settable via the command line.

Note that this PR also includes a small fix in pod.go to check that the expected backends are being called. Without this fix, the split-mesh test isn't actually confirming that the correct backends are called, just that some backend has been called.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added area/conformance cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 21, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @frankbu. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 21, 2023
@k8s-ci-robot
Copy link
Contributor

@frankbu: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

What type of PR is this?

/test
/area conformance

What this PR does / why we need it:

Some mesh implementations require namespaces that are part of the mesh to include implementation-specific labels. For example, Istio requires an istio-injection=enabled label on mesh namespaces to turn on sidecar injection.

This PR adds a new flag that can be used to pass in labels that should be added to namespaces where mesh-enabled services are deployed (e.g., --mesh-namespace-labels "istio-injection=enabled" can be set to run on Istio).

This PR is currently adding the extra label(s) to namespaces that have a gateway-conformance: mesh label, which may not be ideal, depending on exactly what gateway-conformance=mesh is supposed to represent. Thoughts?

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

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.


// MeshNamespaceLabels are implentation-specific labels that should be added
// to namespaces where mesh-enabled services will be deployed.
MeshNamespaceLabels map[string]string
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this when we already have NamespaceLabels? It only applies to "mesh workload" namespaces not everywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It only applies to "mesh workload" namespaces not everywhere?

Yes, that is the difference.

It wasn't clear to me what the intended use of NamespaceLabels is, so I added another field. What kind of labels would we want to add to ALL namespaces, mesh or not?

Copy link
Member

Choose a reason for hiding this comment

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

If I'm understanding correctly we expect that there will be tests where some but not all namespaces will be included in the mesh?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shaneutt, yes, that is my assumption. Mesh egress tests, for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually the more general problem is that if one wants to run both the Gateway and Mesh tests, there is no way to label only the mesh namespace(s), but not the ones hosting plain k8s services that the Gateway/Route tests use. Maybe that's what we want? When running Mesh and Gateway tests together, the Gateway tests switch to mesh-ingress (instead of k8s-ingress) tests?

Copy link
Member

Choose a reason for hiding this comment

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

@frankbu This seems like something that's maybe a bit too implementation-specific to include in our conformance test helpers unless I'm missing something. Would it be possible to just have mesh tests runs separately from ingress tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@robscott, yes, absolutely, I think that would be fine. The only potential issue is if we have mesh tests that want to call services outside of the mesh (egress testing). In Istio, we use a "non-mesh" namespace to run services that simulate external services for this kind of testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@robscott @shaneutt I removed MeshNamespaceLabels and just use the existing NamespaceLabels for now. If in the future we need to differentiate mesh/not-mesh namespaces we can figure out a way to do it then.

So now this PR is only adding a flag to set NamespaceLabels and fixing up pod.go to properly check that the version routing test is actually calling the expected backends.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 24, 2023
@shaneutt shaneutt added this to the v0.7.1 milestone Apr 24, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 24, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 27, 2023
@robscott
Copy link
Member

robscott commented May 5, 2023

@frankbu can you update the PR description to match what we've settled on? It looks like one of your latest commits caused CLA to fail, so that will also need to be fixed before this can be merged.

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 5, 2023
@frankbu
Copy link
Contributor Author

frankbu commented May 5, 2023

/easycla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 5, 2023
@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 8, 2023
@frankbu
Copy link
Contributor Author

frankbu commented May 8, 2023

/easycla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 8, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 9, 2023
@frankbu
Copy link
Contributor Author

frankbu commented May 12, 2023

@robscott I added the unit tests you requested. Are there any other issues holding it up?

@robscott
Copy link
Member

Hey @frankbu we're effectively frozen right now until v0.7.0 releases, but we're expecting that to happen on Monday.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 16, 2023
Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @frankbu! This LGTM other than one tiny nit + needing a rebase.

/hold cancel

@@ -0,0 +1,69 @@
/*
Copyright 2022 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

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

Tiny nit:

Suggested change
Copyright 2022 The Kubernetes Authors.
Copyright 2023 The Kubernetes Authors.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2023
@frankbu
Copy link
Contributor Author

frankbu commented May 17, 2023

@robscott should be good to go now, thanks.

@robscott robscott added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label May 17, 2023
@robscott
Copy link
Member

Thanks @frankbu!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 17, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frankbu, robscott

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 May 17, 2023
@k8s-ci-robot k8s-ci-robot merged commit 123fe3c into kubernetes-sigs:main May 17, 2023
@frankbu frankbu deleted the mesh-labels branch September 25, 2023 14:20
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/conformance 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

5 participants