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
0736ccb1
Commit
0736ccb1
authored
Jan 16, 2020
by
Miek Gieben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better
Signed-off-by:
Miek Gieben
<
miek@miek.nl
>
parent
ec151309
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
plugin/traffic/README.md
plugin/traffic/README.md
+14
-5
plugin/traffic/xds/assignment.go
plugin/traffic/xds/assignment.go
+0
-2
No files found.
plugin/traffic/README.md
View file @
0736ccb1
...
...
@@ -11,8 +11,9 @@ and draining of clusters. The cluster information is retrieved from a service
discovery manager that implements the service discovery protocols that Envoy
[
implements
](
https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol
)
.
A Cluster is defined as: "A cluster is a group of logically similar endpoints that Envoy connects
to. Each cluster has a name, which
*traffic*
extends to be a domain name.
A Cluster is defined as: "A group of logically similar endpoints that Envoy connects
to." Each cluster has a name, which
*traffic*
extends to be a domain name. See
"Naming Clusters" below.
The use case for this plugin is when a cluster has endpoints running in multiple
(Kubernetes?) clusters and you need to steer traffic to (or away) from these endpoints, i.e.
...
...
@@ -49,18 +50,26 @@ traffic {
*
node
**ID**
is how
*traffic*
identifies itself to the control plane. This defaults to
`coredns`
.
## Naming Clusters
When a cluster is named this usually consists out of a single word, i.e. "cluster-v0", or "web". The
*traffic*
plugins uses the name(s) specified in the Server Block to create fully qualified domain
names. For example if the Server Block specifies
`lb.example.org`
as one of the names, 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`
.
## Examples
~~~
corefile
example.org {
lb.
example.org {
traffic grpc://127.0.0.1:18000
debug
log
}
~~~
This will
add load balancing for domains under example.org; the upstream information comes from
10.
12.13.14; depending on received assignments, replies will be let through as-is or are load balanced
.
This will
load balance any names under
`lb.example.org`
using the data from the manager running on
localhost on port 18000. The node ID will default to
`coredns`
.
## Also See
...
...
plugin/traffic/xds/assignment.go
View file @
0736ccb1
...
...
@@ -20,14 +20,12 @@ func (a *assignment) SetClusterLoadAssignment(cluster string, cla *xdspb.Cluster
defer
a
.
mu
.
Unlock
()
_
,
ok
:=
a
.
cla
[
cluster
]
if
!
ok
{
log
.
Debugf
(
"Adding cluster %q"
,
cluster
)
a
.
cla
[
cluster
]
=
cla
return
}
if
cla
==
nil
{
return
}
log
.
Debugf
(
"Updating cluster %q"
,
cluster
)
a
.
cla
[
cluster
]
=
cla
}
...
...
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