Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
50184d71
Commit
50184d71
authored
Mar 05, 2020
by
Miek Gieben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement trying to **TO** address
Signed-off-by:
Miek Gieben
<
miek@miek.nl
>
parent
2d677677
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
10 deletions
+31
-10
plugin/traffic/README.md
plugin/traffic/README.md
+19
-5
plugin/traffic/setup.go
plugin/traffic/setup.go
+11
-4
plugin/traffic/xds/client.go
plugin/traffic/xds/client.go
+1
-1
No files found.
plugin/traffic/README.md
View file @
50184d71
...
...
@@ -179,24 +179,36 @@ This will load balance any names under `lb.example.org` using the data from the
localhost on port 18000. The node ID will be
`test-id`
and no TLS will be used. Assuming a
management server returns config for
`web`
cluster, you can query CoreDNS for it, below we do an
address lookup, which returns an address for the endpoint. The second example shows a SRV lookup
which returns all endpoints.
which returns all endpoints.
The third shows what gRPC will ask for when looking for load balancers.
~~~
sh
$
dig
@localhost
web.lb.example.org +noall +answer
$
dig web.lb.example.org +noall +answer
web.lb.example.org. 5 IN A 127.0.1.1
$
dig @localhost web.lb.example.org SRV +noall +answer +additional
$
dig web.lb.example.org SRV +noall +answer +additional
web.lb.example.org. 5 IN SRV 100 100 18008 endpoint-0.web.lb.example.org.
web.lb.example.org. 5 IN SRV 100 100 18008 endpoint-1.web.lb.example.org.
web.lb.example.org. 5 IN SRV 100 100 18008 endpoint-2.web.lb.example.org.
endpoint-0.web.lb.example.org. 5 IN A 127.0.1.1
endpoint-1.web.lb.example.org. 5 IN A 127.0.1.2
endpoint-2.web.lb.example.org. 5 IN A 127.0.2.1
$
dig _grpclb._tcp.web.lb.example.org SRV +noall +answer +additional
_grpclb._tcp.web.lb.example.org. 5 IN SRV 100 100 18008 endpoint-0.xds.lb.example.org.
_grpclb._tcp.web.lb.example.org. 5 IN SRV 100 100 18008 endpoint-1.xds.lb.example.org.
_grpclb._tcp.web.lb.example.org. 5 IN SRV 100 100 18008 endpoint-2.xds.lb.example.org.
endpoint-0.xds.lb.example.org. 5 IN A 10.0.1.1
endpoint-1.xds.lb.example.org. 5 IN A 10.0.1.2
endpoint-2.xds.lb.example.org. 5 IN A 10.0.2.1
~~~
## Bugs
Priority and locality information from ClusterLoadAssignments is not used.
Multiple
**TO**
addresses
i
s not implemented. Credentials are not i
mplemented.
Priority and locality information from ClusterLoadAssignments is not used.
Credentials are not
implemented.
Load reporting is not supported for the following reason: A DNS query is done by a resolver.
Behind this resolver (which can also cache) there may be many clients that will use this reply. The
...
...
@@ -204,6 +216,8 @@ responding server (CoreDNS) has no idea how many clients use this resolver. So r
+1 on the CoreDNS side can results in anything from 1 to 1000+ of queries on the endpoint, making
the load reporting from
*traffic*
highly inaccurate.
Bootstrapping is not fully implemented,
*traffic*
will connect to the first working
**TO**
addresss,
but then stops short of re-connecting to he endpoints is received for the management
**CLUSTER**
.
## Also See
...
...
plugin/traffic/setup.go
View file @
50184d71
...
...
@@ -45,16 +45,23 @@ func setup(c *caddy.Controller) error {
opts
=
[]
grpc
.
DialOption
{
grpc
.
WithTransportCredentials
(
credentials
.
NewTLS
(
t
.
tlsConfig
))}
}
i
:=
0
redo
:
i
=
i
%
len
(
t
.
hosts
)
if
t
.
c
,
err
=
xds
.
New
(
t
.
hosts
[
i
],
t
.
node
,
opts
...
);
err
!=
nil
{
log
.
Warning
(
err
)
time
.
Sleep
(
2
*
time
.
Second
)
// back off foo
i
++
goto
redo
}
t
.
c
,
err
=
xds
.
New
(
t
.
hosts
[
0
],
t
.
node
,
opts
...
)
err
:=
t
.
c
.
Run
()
if
err
!=
nil
{
if
err
:=
t
.
c
.
Run
();
err
!=
nil
{
log
.
Warning
(
err
)
time
.
Sleep
(
2
*
time
.
Second
)
// back off foo
i
++
goto
redo
}
// err == nil
// err == nil
, we are connected
break
}
}()
...
...
plugin/traffic/xds/client.go
View file @
50184d71
...
...
@@ -96,7 +96,7 @@ func (c *Client) Run() error {
if
first
{
// send first request, to create stream, then wait for ADS to send us updates.
if
err
:=
c
.
clusterDiscovery
(
stream
,
c
.
Version
(
cdsURL
),
c
.
Nonce
(
cdsURL
),
[]
string
{});
err
!=
nil
{
log
.
Debug
(
err
)
return
err
}
log
.
Infof
(
"gRPC stream established to %q"
,
c
.
to
)
// might fail??
c
.
setSynced
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment