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
09f4e8ae
Commit
09f4e8ae
authored
Jan 16, 2020
by
Miek Gieben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format
Signed-off-by:
Miek Gieben
<
miek@miek.nl
>
parent
8582830b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
24 deletions
+26
-24
plugin/traffic/README.md
plugin/traffic/README.md
+25
-24
plugin/traffic/traffic.go
plugin/traffic/traffic.go
+1
-0
No files found.
plugin/traffic/README.md
View file @
09f4e8ae
...
@@ -11,19 +11,19 @@ and draining of clusters. The cluster information is retrieved from a service
...
@@ -11,19 +11,19 @@ and draining of clusters. The cluster information is retrieved from a service
discovery manager that implements the service discovery protocols that Envoy
discovery manager that implements the service discovery protocols that Envoy
[
implements
](
https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol
)
.
[
implements
](
https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol
)
.
A Cluster is defined as: "A group of logically similar endpoints that Envoy connects
A Cluster is defined as: "A group of logically similar endpoints that Envoy connects to." Each
to." Each cluster has a name, which
*traffic*
extends to be a domain name. See
cluster has a name, which
*traffic*
extends to be a domain name. See "Naming Clusters" below.
"Naming Clusters" below.
The use case for this plugin is when a cluster has endpoints running in multiple
The use case for this plugin is when a cluster has endpoints running in multiple
(Kubernetes?)
(Kubernetes?) clusters and you need to steer traffic to (or away) from these endpoints, i.e.
clusters and you need to steer traffic to (or away) from these endpoints, i.e. endpoint A needs to
endpoint A needs to be upgraded, so all traffic to it is drained. Or the entire Kubernetes needs to
be upgraded, so all traffic to it is drained. Or the entire Kubernetes needs to upgraded, and
*all*
upgraded, and
*all*
endpoints need to be drained from it.
endpoints need to be drained from it.
*Traffic*
discovers the endpoints via Envoy's xDS protocol. Endpoints and clusters are discovered
*Traffic*
discovers the endpoints via Envoy's xDS protocol. Endpoints and clusters are discovered
every 10 seconds. The plugin hands out responses that adhere to these assignments. Each DNS response
every 10 seconds. The plugin hands out responses that adhere to these assignments. Each DNS response
contains a single IP address that's considered the best one.
*Traffic*
will load balance A and AAAA
contains a single IP address that's considered the best one.
*Traffic*
will load balance A and AAAA
queries. The TTL on these answer is set to 5s.
queries. The TTL on these answer is set to 5s. It will only return successful responses either with
an answer or otherwise a NODATA response. NXDOMAIN responses will
*never*
be sent.
The
*traffic*
plugin has no notion of draining, drop overload and anything that advanced,
*
it just
The
*traffic*
plugin has no notion of draining, drop overload and anything that advanced,
*
it just
acts upon assignments
*. This is means that if a endpoint goes down and *
traffic
*
has not seen a new
acts upon assignments
*. This is means that if a endpoint goes down and *
traffic
*
has not seen a new
...
@@ -35,10 +35,9 @@ assignment yet, it will still include this endpoint address in responses.
...
@@ -35,10 +35,9 @@ assignment yet, it will still include this endpoint address in responses.
traffic TO...
traffic TO...
~~~
~~~
*
**TO...**
are the Envoy control plane endpoint to connect to. The syntax mimics the
*forward*
*
**TO...**
are the Envoy control plane endpoint to connect to. The syntax mimics the
*forward*
plugin and must start with
`grpc://`
.
plugin and must start with
`grpc://`
.
The extended syntax is available is you want more control.
The extended syntax is available is you want more control.
~~~
~~~
...
@@ -48,14 +47,14 @@ traffic TO... {
...
@@ -48,14 +47,14 @@ traffic TO... {
}
}
~~~
~~~
*
node
**ID**
is how
*traffic*
identifies itself to the control plane. This defaults to
`coredns`
.
*
node
**ID**
is how
*traffic*
identifies itself to the control plane. This defaults to
`coredns`
.
## Naming Clusters
## Naming Clusters
When a cluster is named this usually consists out of a single word, i.e. "cluster-v0", or "web".
The
When a cluster is named this usually consists out of a single word, i.e. "cluster-v0", or "web".
*traffic*
plugins uses the name(s) specified in the Server Block to create fully qualified domain
The
*traffic*
plugins uses the name(s) specified in the Server Block to create fully qualified
names. For example if the Server Block specifies
`lb.example.org`
as one of the names, and
domain names. For example if the Server Block specifies
`lb.example.org`
as one of the names,
"cluster-v0" is one of the load balanced cluster,
*traffic*
will respond to query asking for
and
"cluster-v0" is one of the load balanced cluster,
*traffic*
will respond to query asking for
`cluster-v0.lb.example.org.`
and the same goes for
`web`
;
`web.lb.example.org`
.
`cluster-v0.lb.example.org.`
and the same goes for
`web`
;
`web.lb.example.org`
.
## Examples
## Examples
...
@@ -77,19 +76,21 @@ localhost on port 18000. The node ID will default to `coredns`.
...
@@ -77,19 +76,21 @@ localhost on port 18000. The node ID will default to `coredns`.
The following documents provide some background on Envoy's control plane.
The following documents provide some background on Envoy's control plane.
*
https://github.com/envoyproxy/go-control-plane
*
<https://github.com/envoyproxy/go-control-plane>
*
https://blog.christianposta.com/envoy/guidance-for-building-a-control-plane-to-manage-envoy-proxy-based-infrastructure/
*
https://github.com/envoyproxy/envoy/blob/442f9fcf21a5f091cec3fe9913ff309e02288659/api/envoy/api/v2/discovery.proto#L63
*
<https://blog.christianposta.com/envoy/guidance-for-building-a-control-plane-to-manage-envoy-proxy-based-infrastructure/>
*
<https://github.com/envoyproxy/envoy/blob/442f9fcf21a5f091cec3fe9913ff309e02288659/api/envoy/api/v2/discovery.proto#L63>
## Bugs
## Bugs
Priority from ClusterLoadAssignments is not used. Locality is also not used. Health status of the
Priority from ClusterLoadAssignments is not used. Locality is also not used. Health status of the
endpoints is ignore (for now).
endpoints is ignore (for now).
Load reporting via xDS is not supported; this can be implemented, but there are some things that
make
Load reporting via xDS is not supported; this can be implemented, but there are some things that
this difficult. A single (DNS) query is done by a resolver. Behind this resolver there may be many
make this difficult. A single (DNS) query is done by a resolver. Behind this resolver there may be
clients that will use this reply, the responding server (CoreDNS) has no idea how many clients use
many clients that will use this reply, the responding server (CoreDNS) has no idea how many clients
this resolver. So reporting a load of +1 on the CoreDNS side can be anything from 1 to 1000+, making
use this resolver. So reporting a load of +1 on the CoreDNS side can be anything from 1 to 1000+,
the load reporting highly inaccurate.
making
the load reporting highly inaccurate.
Multiple
**TO**
addresses is not implemented.
Multiple
**TO**
addresses is not implemented.
plugin/traffic/traffic.go
View file @
09f4e8ae
...
@@ -51,6 +51,7 @@ func (t *Traffic) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
...
@@ -51,6 +51,7 @@ func (t *Traffic) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
m
:=
new
(
dns
.
Msg
)
m
:=
new
(
dns
.
Msg
)
m
.
SetReply
(
r
)
m
.
SetReply
(
r
)
m
.
Authoritative
=
true
if
addr
==
nil
{
if
addr
==
nil
{
m
.
Ns
=
soa
(
state
.
Zone
)
m
.
Ns
=
soa
(
state
.
Zone
)
...
...
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