Skip to content

ignore STRICT_DNS/STATIC Cluster doesnot have endpoints#20981

Merged
istio-testing merged 5 commits intoistio:masterfrom
ydh926:master
Feb 12, 2020
Merged

ignore STRICT_DNS/STATIC Cluster doesnot have endpoints#20981
istio-testing merged 5 commits intoistio:masterfrom
ydh926:master

Conversation

@ydh926
Copy link
Copy Markdown
Contributor

@ydh926 ydh926 commented Feb 10, 2020

No description provided.

@ydh926 ydh926 requested a review from a team as a code owner February 10, 2020 03:00
@istio-testing istio-testing added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test labels Feb 10, 2020
@istio-testing
Copy link
Copy Markdown
Collaborator

Hi @ydh926. Thanks for your PR.

I'm waiting for a istio 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.

Details

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.

@googlebot
Copy link
Copy Markdown
Collaborator

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no Set by the Google CLA bot to indicate the author of a PR has not signed the Google CLA. label Feb 10, 2020
@ydh926
Copy link
Copy Markdown
Contributor Author

ydh926 commented Feb 10, 2020

STRICT_DNS/STATIC Cluster does not have endpoint will block envoy.
envoyproxy/envoy#9963

Impact on pilot:
#20933

@ydh926
Copy link
Copy Markdown
Contributor Author

ydh926 commented Feb 10, 2020

@googlebot I fixed it

@googlebot
Copy link
Copy Markdown
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. and removed cla: no Set by the Google CLA bot to indicate the author of a PR has not signed the Google CLA. labels Feb 10, 2020
@hzxuzhonghu
Copy link
Copy Markdown
Member

/ok-to-test

@istio-testing istio-testing added ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. and removed needs-ok-to-test labels Feb 10, 2020
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you explain how can this happen?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For example:

  1. configure a DNS type ServiceEntry
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: static-20191230
  namespace: gateway-system
spec:
  endpoints:
  - address: 10.108.251.133
    ports:
      http: 80
  - address: 10.96.144.80
    ports:
      http: 80
  exportTo:
  - '*'
  hosts:
  - com.netease.static-20191230
  location: MESH_EXTERNAL
  ports:
  - name: http
    number: 80
    protocol: HTTP
  resolution: DNS
  1. configure a subset, which cannot select any endpoint
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: static-1230
  namespace: gateway-system
spec:
  host: com.netease.static-20191230
  subsets:
  - altStatName: healthCheckTest
    name: static-20191230-test1
    labels:
       app: none

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no need check outbound

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@hzxuzhonghu
Copy link
Copy Markdown
Member

@ydh926 Add a test for it in cluster_test.go

@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 10, 2020
@ydh926 ydh926 force-pushed the master branch 2 times, most recently from 1362d2a to b27b4b1 Compare February 10, 2020 13:28
@ydh926
Copy link
Copy Markdown
Contributor Author

ydh926 commented Feb 10, 2020

@ydh926 Add a test for it in cluster_test.go
is this ok? @hzxuzhonghu

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove the error message please as this is going to get very noisy. Instead add it as a metric (look around pilot code for how we do metrics for these kinds of things).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@ydh926 ydh926 force-pushed the master branch 2 times, most recently from 3699941 to a38dae2 Compare February 11, 2020 02:56
@ydh926
Copy link
Copy Markdown
Contributor Author

ydh926 commented Feb 11, 2020

/retest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

pilot_dns_cluster_without_endpoints

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
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.

One question: we do have a BlackHoleCluster cluster of static type without endpoints, why there is no error?

@ydh926
Copy link
Copy Markdown
Contributor Author

ydh926 commented Feb 11, 2020

One question: we do have a BlackHoleCluster cluster of static type without endpoints, why there is no error?

The field loadassignment of BlackHoleCluster is nil,envoy will give it a default value. But it in STRICT_DNS cluster is a struct with an empty Endpoints array, envoy will try to resolve it. That is a bug in envoy, but I am not sure when they will fix it.

@ydh926 ydh926 force-pushed the master branch 2 times, most recently from d3f70b2 to 6d21ead Compare February 11, 2020 10:27
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

pilot_dns_cluster_without_endpoints, actually we donot sum up ths static cluster.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why this is back

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sorry,it is a mistake. fixed already

@ramaraochavali
Copy link
Copy Markdown
Contributor

I think we should exclude STATIC from this check because imagine a case we create a service entry with STATIC resolution type and if its endpoints ever become zero, with this change we do not send that cluster to Envoy and Envoy would delete the cluster - That is not correct because we should just clear the endpoints not the cluster it self. I fixed similar thing to allow empty endpoints to static cluster in service entries #19036

@ydh926
Copy link
Copy Markdown
Contributor Author

ydh926 commented Feb 12, 2020

I think we should exclude STATIC from this check because imagine a case we create a service entry with STATIC resolution type and if its endpoints ever become zero, with this change we do not send that cluster to Envoy and Envoy would delete the cluster - That is not correct because we should just clear the endpoints not the cluster it self. I fixed similar thing to allow empty endpoints to static cluster in service entries #19036

In your description, a ServiceEntry of static type will be converted to a cluster of type eds. If so, these changes will not affect the ServiceEntry of static type. We only deal with static or DNS clusters.

For Service Entries with STATIC resolution, we should allow empty endpoints. Since we internally convert it to EDS type of cluster in Envoy - it will work and it is valid for the external service represented by the Service Entry to have zero endpoints.

Static type clusters seem to only be used internally, so I will remove the description to avoid ambiguity

@hzxuzhonghu
Copy link
Copy Markdown
Member

make sense, fix the lint, and i will approve.

@ramaraochavali
Copy link
Copy Markdown
Contributor

Ah.. sorry. Makes sense. Thank you

@ydh926
Copy link
Copy Markdown
Contributor Author

ydh926 commented Feb 12, 2020

fixed @hzxuzhonghu

@hzxuzhonghu
Copy link
Copy Markdown
Member

@ydh926 Do you forget to push?

@istio-testing istio-testing merged commit af85f9c into istio:master Feb 12, 2020
sdake pushed a commit to sdake/istio that referenced this pull request Feb 21, 2020
@lambdai
Copy link
Copy Markdown
Contributor

lambdai commented Apr 9, 2020

cherrypick/release-1.4

@lambdai
Copy link
Copy Markdown
Contributor

lambdai commented Apr 9, 2020

cherrypick/release-1.5

venilnoronha added a commit to vmware-allspark/envoy that referenced this pull request Apr 21, 2020
istio/istio#22837 (comment)
envoyproxy#10728
istio/istio#20981

Signed-off-by: Venil Noronha <veniln@vmware.com>
@chaudyg
Copy link
Copy Markdown
Contributor

chaudyg commented May 1, 2020

@lambdai I don't think the cherrypick in 1.4 worked. Any idea?

@ydh926 ydh926 mentioned this pull request Jan 11, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/networking cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. 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.

9 participants