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 kubernetes registry in front of ServiceEntry #51003

Merged
merged 6 commits into from
May 15, 2024

Conversation

hzxuzhonghu
Copy link
Member

@hzxuzhonghu hzxuzhonghu commented May 13, 2024

Please provide a description of this PR:

Fix #50968

Without this we can get proxy labels from WLE when the wle's address = pod ip

@hzxuzhonghu hzxuzhonghu requested a review from a team as a code owner May 13, 2024 04:07
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 13, 2024
for i, r := range c.registries {
if r.Provider() != provider.Kubernetes {
// insert the registry in the position of the first non kubernetes registry
newRegistries := make([]*registryEntry, len(c.registries)+1)
Copy link
Member

Choose a reason for hiding this comment

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

nit: can we use slices.Insert to avoid this complex code

Copy link
Member Author

Choose a reason for hiding this comment

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

good to know that function.

@hzxuzhonghu hzxuzhonghu requested a review from a team as a code owner May 14, 2024 07:37
@costinm
Copy link
Contributor

costinm commented May 14, 2024 via email

@hzxuzhonghu
Copy link
Member Author

Should we prevent WE from using the same IP as a pod instead ? Any security
implications ?

That can not be 100% possible.

Any impact on backwards compatibility ?

@costinm Maybe no, and in services ordering we have already sort kubernetes service before serviceentry

@costinm
Copy link
Contributor

costinm commented May 15, 2024 via email

@hzxuzhonghu
Copy link
Member Author

We do build a map from IP to 'workload info' - so it should not be
impossible to detect.

OK, i know your point. We can do that in istiod. I meant we cannot prevent it from creating with validating webhook

@hzxuzhonghu
Copy link
Member Author

It seems out certificate used for test has expired again

{Failed      utils_test.go:312: failed at updateMutatingWebhookConfig: failed to verify the certificate chain: x509: certificate has expired or is not yet valid: current time 2024-05-15T02:46:41Z is after 2024-05-14T23:11:26Z}

@zirain
Copy link
Member

zirain commented May 15, 2024

/retest-required

@hzxuzhonghu
Copy link
Member Author

/test integ-pilot-istiodremote-mc

1 similar comment
@hzxuzhonghu
Copy link
Member Author

/test integ-pilot-istiodremote-mc

@istio-testing istio-testing merged commit c62ebac into istio:master May 15, 2024
28 checks passed
@hzxuzhonghu hzxuzhonghu added cherrypick/release-1.20 Set this label on a PR to auto-merge it to the release-1.20 branch cherrypick/release-1.21 Set this label on a PR to auto-merge it to the release-1.21 branch cherrypick/release-1.22 Set this label on a PR to auto-merge it to the release-1.22 branch labels May 15, 2024
@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #51003 failed to apply on top of branch "release-1.21":

Applying: add kubernetes registry infront of serviceentry
Applying: add test
Applying: add release note
Applying: address comments
Using index info to reconstruct a base tree...
M	pilot/pkg/serviceregistry/aggregate/controller.go
Falling back to patching base and 3-way merge...
Auto-merging pilot/pkg/serviceregistry/aggregate/controller.go
CONFLICT (content): Merge conflict in pilot/pkg/serviceregistry/aggregate/controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 address comments
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new issue created for failed cherrypick: #51055

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #51003 failed to apply on top of branch "release-1.20":

Applying: add kubernetes registry infront of serviceentry
Applying: add test
Applying: add release note
Applying: address comments
Using index info to reconstruct a base tree...
M	pilot/pkg/serviceregistry/aggregate/controller.go
Falling back to patching base and 3-way merge...
Auto-merging pilot/pkg/serviceregistry/aggregate/controller.go
CONFLICT (content): Merge conflict in pilot/pkg/serviceregistry/aggregate/controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 address comments
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new issue created for failed cherrypick: #51056

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new pull request created: #51057

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #51003 failed to apply on top of branch "release-1.21":

Applying: add kubernetes registry infront of serviceentry
Applying: add test
Applying: add release note
Applying: address comments
Using index info to reconstruct a base tree...
M	pilot/pkg/serviceregistry/aggregate/controller.go
Falling back to patching base and 3-way merge...
Auto-merging pilot/pkg/serviceregistry/aggregate/controller.go
CONFLICT (content): Merge conflict in pilot/pkg/serviceregistry/aggregate/controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 address comments
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new issue created for failed cherrypick: #51058

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #51003 failed to apply on top of branch "release-1.20":

Applying: add kubernetes registry infront of serviceentry
Applying: add test
Applying: add release note
Applying: address comments
Using index info to reconstruct a base tree...
M	pilot/pkg/serviceregistry/aggregate/controller.go
Falling back to patching base and 3-way merge...
Auto-merging pilot/pkg/serviceregistry/aggregate/controller.go
CONFLICT (content): Merge conflict in pilot/pkg/serviceregistry/aggregate/controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 address comments
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new issue created for failed cherrypick: #51059

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new pull request could not be created: failed to create pull request against istio/istio#release-1.22 from head istio-testing:cherry-pick-51003-to-release-1.22: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for istio-testing:cherry-pick-51003-to-release-1.22."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"}

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #51003 failed to apply on top of branch "release-1.20":

Applying: add kubernetes registry infront of serviceentry
Applying: add test
Applying: add release note
Applying: address comments
Using index info to reconstruct a base tree...
M	pilot/pkg/serviceregistry/aggregate/controller.go
Falling back to patching base and 3-way merge...
Auto-merging pilot/pkg/serviceregistry/aggregate/controller.go
CONFLICT (content): Merge conflict in pilot/pkg/serviceregistry/aggregate/controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 address comments
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new issue created for failed cherrypick: #51060

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #51003 failed to apply on top of branch "release-1.21":

Applying: add kubernetes registry infront of serviceentry
Applying: add test
Applying: add release note
Applying: address comments
Using index info to reconstruct a base tree...
M	pilot/pkg/serviceregistry/aggregate/controller.go
Falling back to patching base and 3-way merge...
Auto-merging pilot/pkg/serviceregistry/aggregate/controller.go
CONFLICT (content): Merge conflict in pilot/pkg/serviceregistry/aggregate/controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0004 address comments
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new issue created for failed cherrypick: #51061

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new pull request could not be created: failed to create pull request against istio/istio#release-1.22 from head istio-testing:cherry-pick-51003-to-release-1.22: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for istio-testing:cherry-pick-51003-to-release-1.22."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick/release-1.20 Set this label on a PR to auto-merge it to the release-1.20 branch cherrypick/release-1.21 Set this label on a PR to auto-merge it to the release-1.21 branch cherrypick/release-1.22 Set this label on a PR to auto-merge it to the release-1.22 branch size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sidecar CRD is ignored when pod rebalance from one Istiod to another and is endpoint in a ServiceEnrty
6 participants