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

push headless endpoint change when headless enabled or dns is enabled #42165

Merged
merged 3 commits into from
Nov 29, 2022

Conversation

ramaraochavali
Copy link
Contributor

Continuing on #42089, when headless service endpoints change, but features. EnableHeadlessService is off, DNS is enabled, NDS will have stale endpoints.

This PR fixes it.

  • Ambient
  • Configuration Infrastructure
  • Docs
  • Installation
  • Networking
  • Performance and Scalability
  • Policies and Telemetry
  • Security
  • Test and Release
  • User Experience
  • Developer Infrastructure

Please check any characteristics that apply to this pull request.

  • Does not have any user-facing changes. This may include CLI changes, API changes, behavior changes, performance improvements, etc.

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@ramaraochavali ramaraochavali requested review from a team as code owners November 26, 2022 07:41
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 26, 2022
@ramaraochavali ramaraochavali added the release-notes-none Indicates a PR that does not require release notes. label Nov 26, 2022
@ramaraochavali
Copy link
Contributor Author

/test release-notes

// When endpoints for headless service change, we should push if EnableHeadlessService is true
// so that we create updated listeners or when DNSCapture is enabled for proxy so that the NDS
// table is updated.
if req.Full && len(req.Reason) == 1 && req.Reason[0] == model.HeadlessEndpointUpdate &&
Copy link
Member

Choose a reason for hiding this comment

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

This is not very right, we could merge two push requests. If so the reasons index can be random

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah Right. I missed that part.

Copy link
Contributor

Choose a reason for hiding this comment

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

@hzxuzhonghu & @ramaraochavali One more question, I noticed that only one request reason can be added in L#77, so where should more than one requests can be merged? Thanks!

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@istio-policy-bot
Copy link

🤔 🐛 You appear to be fixing a bug in Go code, yet your PR doesn't include updates to any test files. Did you forget to add a test?

Courtesy of your friendly test nag.

// When endpoints for headless service change, we should push if EnableHeadlessService is true
// so that we create updated listeners or when DNSCapture is enabled for proxy so that the NDS
// table is updated.
if req.Full && headlessEndpointsUpdated(req) && (features.EnableHeadlessService || bool(proxy.Metadata.DNSCapture)) {
Copy link
Member

Choose a reason for hiding this comment

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

This may introduce additional full push when EnableHeadlessService = false, actually in this case we only need NDS and EDS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we push NDS only on full push - so this is needed.

Copy link
Member

Choose a reason for hiding this comment

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

How about updating ndsNeedsPush, push nds on headless service endpoint updated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But is n't it the same if headlessendpoints trigger full push whether we do it here or in ndsNeedsPush?

Copy link
Member

Choose a reason for hiding this comment

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

The diff is make full = false and you can set reason = HeadlessEndpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we can make full = false because it is needed when EnableHeadlessService is enabled. But changed a bit - hopefully this is better. PTAL

@@ -35,6 +35,13 @@ func ConfigAffectsProxy(req *model.PushRequest, proxy *model.Proxy) bool {
return true
}

// When endpoints for headless service change, we should push if EnableHeadlessService is true
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure I am following.. since this checks Full && ..., wouldn't we push it anyways? The only way we would filter is if it was filtered out by a Sidecar, but in that case we really don't want to push?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you saying full pushes are always pushed? But when we pushConnection, do not we call this for every proxy?

Copy link
Member

Choose a reason for hiding this comment

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

No, it isn't always, but ConfigAffectsProxy scopes based on Sidecar which seems fine...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed it a bit. Hopefully that should address this part. PTAL and let me know.

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Copy link
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

This is what i thought, let @howardjohn give a chance to have a look

Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

We should have a test case but lgtm

@istio-testing istio-testing merged commit e2e2299 into istio:master Nov 29, 2022
@ramaraochavali
Copy link
Contributor Author

I will add tests.

@ramaraochavali ramaraochavali deleted the fix/dns_push branch November 29, 2022 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes-none Indicates a PR that does not require release notes. 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.

6 participants