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

[WIP] dns: add support for clusters based on SRV DNS record #35160

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mikhainin
Copy link
Contributor

@mikhainin mikhainin commented Jul 11, 2024

One more attempt to address #125 (resolve cluster IPs via SRV-record)

Yet on early stage. Tested with Consul and the collowing configuration:

  clusters:
  - name: local-php
    connect_timeout: 0.25s
    lb_policy: round_robin
    # http2_protocol_options: {}
    cluster_type:
      name: envoy.clusters.dns_srv
      typed_config:
        "@type": "type.googleapis.com/envoy.extensions.clusters.dns_srv.v3.Cluster"
        srv_names:
          - srv_name: _local-php._tcp.service.consul.
    dns_resolvers:
    typed_dns_resolver_config:
      name: envoy.network.dns_resolver.cares
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.network.dns_resolver.cares.v3.CaresDnsResolverConfig
        resolvers:
          - socket_address:
              address: 127.0.0.1
              port_value: 8600

Based on discussion and design doc by @kylebevans in #125 (comment)

Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #35160 was opened by mikhainin.

see: more, trace.

Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @wbpcode
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #35160 was opened by mikhainin.

see: more, trace.

Signed-off-by: Mikhail Galanin <[email protected]>
Signed-off-by: Mikhail Galanin <[email protected]>
Signed-off-by: Mikhail Galanin <[email protected]>
@mikhainin
Copy link
Contributor Author

Testing locally with Consul:
run consul:

consul agent -server -advertise=127.0.0.1 -data-dir=consul-data -ui -bootstrap-expect=1 -dev -log-level=debug

Add service nodes:

consul services register -name=local-php -id=web-1 -address=192.168.1.102 -port=80 -tag=v1 -tag=prod
consul services register -name=local-php -id=web-2 -address=192.168.1.102 -port=81 -tag=v1 -tag=prod

Verify that the service local-php can be resolved via Consul:

dig @127.0.0.1 -p 8600 local-php.service.consul. SRV
# or
dig @127.0.0.1 -p 8600 _local-php._tcp.service.consul. SRV

main doc: https://developer.hashicorp.com/consul/docs/services/discovery/dns-static-lookups

Signed-off-by: Mikhail Galanin <[email protected]>
@mikhainin
Copy link
Contributor Author

Hi there, apologies for openning in this state - I acknowledge that there still lots.
I just needed someone to point me at what I'm missing and get feedback whether I'm going in the right direction.

@mikhainin mikhainin marked this pull request as ready for review August 19, 2024 19:39
@wbpcode wbpcode marked this pull request as draft August 21, 2024 12:49
@wbpcode
Copy link
Member

wbpcode commented Aug 21, 2024

Thanks for you contribution. But based on our contributing rules (see https://github.com/envoyproxy/envoy/blob/main/CONTRIBUTING.md), any extension, should have a maintainer sponsor to help review and maintain the code.

And I think this should be a DNS extension rather than a new cluster extension?

@mikhainin
Copy link
Contributor Author

mikhainin commented Aug 21, 2024

should have a maintainer sponsor to help review and maintain the code

@wbpcode, Thank you for your comment. I posted a message in slack some while ago but didn't hear anything back. What would be the right way for this?

And I think this should be a DNS extension rather than a new cluster extension?

Based on previous discussion, it was decided to go with the cluster extension. Basically, I followed the previous proposal.

I will be happy to discuss the new design if someone helps me to find the right place. The initial issue doesn't seem to have activity :/

Copy link

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Sep 20, 2024
@mikhainin
Copy link
Contributor Author

This isn't yet forgotten, going to ping maintainers in the maillist

@github-actions github-actions bot removed the stale stalebot believes this issue/PR has not been touched recently label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants