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
57111eba
Commit
57111eba
authored
Jul 14, 2020
by
Miek Gieben
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'traffic' of github.com:coredns/coredns into traffic
parents
c5a36c70
e177ae25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
plugin/traffic/README.md
plugin/traffic/README.md
+1
-1
plugin/traffic/setup.go
plugin/traffic/setup.go
+2
-2
plugin/traffic/traffic.go
plugin/traffic/traffic.go
+2
-2
No files found.
plugin/traffic/README.md
View file @
57111eba
...
@@ -11,7 +11,7 @@ of clusters. A cluster is defined as: "A group of logically similar endpoints th
...
@@ -11,7 +11,7 @@ of clusters. A cluster is defined as: "A group of logically similar endpoints th
connects to." Each cluster has a name, which
*traffic*
extends to be a domain name. See "Naming
connects to." Each cluster has a name, which
*traffic*
extends to be a domain name. See "Naming
Clusters" below.
Clusters" below.
The use case for this plugin is when a cluster has endpoints running in multiple (
Kubernetes?
)
The use case for this plugin is when a cluster has endpoints running in multiple (
e.g. Kubernetes
)
clusters and you need to steer traffic to (or away) from these endpoints, i.e. endpoint A needs to
clusters and you need to steer traffic to (or away) from these endpoints, i.e. endpoint A needs to
be upgraded, so all traffic to it is drained. Or the entire Kubernetes needs to upgraded, and
*all*
be upgraded, so all traffic to it is drained. Or the entire Kubernetes needs to upgraded, and
*all*
endpoints need to be drained from it.
endpoints need to be drained from it.
...
...
plugin/traffic/setup.go
View file @
57111eba
...
@@ -12,7 +12,7 @@ import (
...
@@ -12,7 +12,7 @@ import (
"github.com/coredns/coredns/plugin/metrics"
"github.com/coredns/coredns/plugin/metrics"
clog
"github.com/coredns/coredns/plugin/pkg/log"
clog
"github.com/coredns/coredns/plugin/pkg/log"
"github.com/coredns/coredns/plugin/pkg/parse"
"github.com/coredns/coredns/plugin/pkg/parse"
pkg
tls
"github.com/coredns/coredns/plugin/pkg/tls"
c
tls
"github.com/coredns/coredns/plugin/pkg/tls"
"github.com/coredns/coredns/plugin/pkg/transport"
"github.com/coredns/coredns/plugin/pkg/transport"
"github.com/coredns/coredns/plugin/traffic/xds"
"github.com/coredns/coredns/plugin/traffic/xds"
...
@@ -121,7 +121,7 @@ func parseTraffic(c *caddy.Controller) (*Traffic, error) {
...
@@ -121,7 +121,7 @@ func parseTraffic(c *caddy.Controller) (*Traffic, error) {
return
nil
,
c
.
ArgErr
()
return
nil
,
c
.
ArgErr
()
}
}
tlsConfig
,
err
=
pkg
tls
.
NewTLSConfigFromArgs
(
args
...
)
tlsConfig
,
err
=
c
tls
.
NewTLSConfigFromArgs
(
args
...
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
plugin/traffic/traffic.go
View file @
57111eba
...
@@ -13,7 +13,7 @@ import (
...
@@ -13,7 +13,7 @@ import (
"github.com/coredns/coredns/plugin/traffic/xds"
"github.com/coredns/coredns/plugin/traffic/xds"
"github.com/coredns/coredns/request"
"github.com/coredns/coredns/request"
corepb
"github.com/envoyproxy/go-control-plane/envoy/config/core/v3
"
corepb
2
"github.com/envoyproxy/go-control-plane/envoy/api/v2/core
"
"github.com/miekg/dns"
"github.com/miekg/dns"
)
)
...
@@ -129,7 +129,7 @@ func (t *Traffic) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
...
@@ -129,7 +129,7 @@ func (t *Traffic) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
m
.
Answer
=
append
(
m
.
Answer
,
&
dns
.
TXT
{
m
.
Answer
=
append
(
m
.
Answer
,
&
dns
.
TXT
{
Hdr
:
dns
.
RR_Header
{
Name
:
state
.
QName
(),
Rrtype
:
dns
.
TypeTXT
,
Class
:
dns
.
ClassINET
,
Ttl
:
5
},
Hdr
:
dns
.
RR_Header
{
Name
:
state
.
QName
(),
Rrtype
:
dns
.
TypeTXT
,
Class
:
dns
.
ClassINET
,
Ttl
:
5
},
Txt
:
[]
string
{
"100"
,
"100"
,
strconv
.
Itoa
(
int
(
sa
.
Port
())),
target
,
corepb
.
HealthStatus_name
[
int32
(
sa
.
Health
)]}})
Txt
:
[]
string
{
"100"
,
"100"
,
strconv
.
Itoa
(
int
(
sa
.
Port
())),
target
,
corepb
2
.
HealthStatus_name
[
int32
(
sa
.
Health
)]}})
m
.
Extra
=
append
(
m
.
Extra
,
&
dns
.
TXT
{
Hdr
:
dns
.
RR_Header
{
Name
:
target
,
Rrtype
:
dns
.
TypeTXT
,
Class
:
dns
.
ClassINET
,
Ttl
:
5
},
Txt
:
[]
string
{
sa
.
Address
()
.
String
()}})
m
.
Extra
=
append
(
m
.
Extra
,
&
dns
.
TXT
{
Hdr
:
dns
.
RR_Header
{
Name
:
target
,
Rrtype
:
dns
.
TypeTXT
,
Class
:
dns
.
ClassINET
,
Ttl
:
5
},
Txt
:
[]
string
{
sa
.
Address
()
.
String
()}})
}
}
default
:
default
:
...
...
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