Giter VIP home page Giter VIP logo

Comments (14)

9len avatar 9len commented on June 15, 2024 3

Unfortunately, while you can set the cluster type to LOGICAL_DNS in a statically configured cluster, AFAIK there is no way to set a CDS/EDS cluster to use logical DNS. It's a hole in the API.

The way we solve this in rotor is to resolve the DNS entry within the control-plane, and hand out resolved IPs in EDS.

from go-control-plane.

oneamitj avatar oneamitj commented on June 15, 2024

Below code worked for me. webapp-service is my docker service name. This way envoy resolves webapp-service to as many IPs as its replica count.

var hosts []*core.Address
dnsRefreshRate := 15 * time.Second
hosts = append(hosts, &core.Address{
	Address: &core.Address_SocketAddress{
		SocketAddress: &core.SocketAddress{
			Protocol:     core.TCP,
			Address:      "webapp-service", // webapp-service is a docker service name
			ResolverName: "STRICT_DNS",
			PortSpecifier: &core.SocketAddress_PortValue{
				PortValue: uint32(8080),
			},
		},
	},
})
cluster := &v2.Cluster{
	Name:            "my_cluster",
	ConnectTimeout:  5 * time.Second,
	Type:            v2.Cluster_STRICT_DNS,
	LbPolicy:        v2.Cluster_ROUND_ROBIN,
	Hosts:           hosts,
	DnsLookupFamily: v2.Cluster_V4_ONLY,
	DnsRefreshRate:  &dnsRefreshRate,
}

from go-control-plane.

9len avatar 9len commented on June 15, 2024

Yes, the other way to do this is to embed the hostlist directly in the cluster response, rather than using EDS at all.

from go-control-plane.

slonka avatar slonka commented on June 15, 2024

@9len

Unfortunately, while you can set the cluster type to LOGICAL_DNS in a statically configured cluster, AFAIK there is no way to set a CDS/EDS cluster to use logical DNS. It's a hole in the API.

Is this still the case?

from go-control-plane.

9len avatar 9len commented on June 15, 2024

AFAIK yes, but I haven’t been involved with the project for several months.

from go-control-plane.

oneamitj avatar oneamitj commented on June 15, 2024

The alternative solution I provided seems no more of use (from v1.9). As Hosts in the cluster is now deprecated by LoadAssignment of type *ClusterLoadAssignment which uses EDS Cluster. This is troublesome for me too. I am staying at v1.8, as I use Docker as host and need to resolve docker service hostname to (multiple) IP.
In hope support for LOGICAL_DNS in EDS/CDS cluster will be added.
PS: Is there anything we can do to make this support added?

from go-control-plane.

alecholmez avatar alecholmez commented on June 15, 2024

Handing out resolved IPs in the server before they make it to the proxies is the best solution for this. It's a relatively trivial fix as well

from go-control-plane.

pravin-singhal avatar pravin-singhal commented on June 15, 2024

I have been using LOGICAL_DNS with envoy container starting with --dns, run dnsmasq at at the IP which can route to different DNS servers based on domains

from go-control-plane.

github-actions avatar github-actions commented on June 15, 2024

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

from go-control-plane.

github-actions avatar github-actions commented on June 15, 2024

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

from go-control-plane.

binpatel31 avatar binpatel31 commented on June 15, 2024

is this issue resolved? can we resolve DNS name with EDS as config?

from go-control-plane.

oneamitj avatar oneamitj commented on June 15, 2024

@binpatel31 I don't think we can. Though, I haven't checked the latest version.

from go-control-plane.

arttkach avatar arttkach commented on June 15, 2024

I also would like to know if this issue was addressed. Static config does work but it don't seem to be working for my dynamic config. Whenever I replace an IP with a service name, in my EDS file, I get the following error:
[warning][config] [source/common/config/filesystem_subscription_impl.cc:60] Filesystem config update rejected: malformed IP address: service. Consider setting resolver_name or setting cluster type to 'STRICT_DNS' or 'LOGICAL_DNS'.
I run envoy in a container. Any plans to address this in the near future?

from go-control-plane.

20harshal avatar 20harshal commented on June 15, 2024

In the attention note of https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/endpoint/v3/endpoint_components.proto#config-endpoint-v3-endpoint
The form of host address depends on the given cluster type. For STATIC or EDS, it is expected to be a direct IP address (or something resolvable by the specified resolver in the Address). For LOGICAL or STRICT DNS, it is expected to be hostname, and will be resolved via DNS.
But its saying [2022-07-20 16:58:29.848][6194][warning][config] [external/envoy/source/common/config/filesystem_subscription_impl.cc:43] Filesystem config update rejected: Error adding/updating listener(s) tcp_1: Unknown address resolver: 8.8.8.8

from go-control-plane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.