Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ab02fd6f
Unverified
Commit
ab02fd6f
authored
Sep 19, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68683 from chrisohaver/trackdns
Add DNS pod resource monitoring option
parents
3429b9ac
7ea51a55
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
38 additions
and
11 deletions
+38
-11
coredns.yaml.base
cluster/addons/dns/coredns/coredns.yaml.base
+1
-1
coredns.yaml.in
cluster/addons/dns/coredns/coredns.yaml.in
+1
-1
coredns.yaml.sed
cluster/addons/dns/coredns/coredns.yaml.sed
+1
-1
config-default.sh
cluster/gce/config-default.sh
+1
-1
config-test.sh
cluster/gce/config-test.sh
+1
-1
framework.go
test/e2e/framework/framework.go
+11
-2
resource_usage_gatherer.go
test/e2e/framework/resource_usage_gatherer.go
+21
-3
nvidia-gpus.go
test/e2e/scheduling/nvidia-gpus.go
+1
-1
No files found.
cluster/addons/dns/coredns/coredns.yaml.base
View file @
ab02fd6f
...
@@ -112,7 +112,7 @@ spec:
...
@@ -112,7 +112,7 @@ spec:
imagePullPolicy: IfNotPresent
imagePullPolicy: IfNotPresent
resources:
resources:
limits:
limits:
memory: 1
7
0Mi
memory: 1
00
0Mi
requests:
requests:
cpu: 100m
cpu: 100m
memory: 70Mi
memory: 70Mi
...
...
cluster/addons/dns/coredns/coredns.yaml.in
View file @
ab02fd6f
...
@@ -112,7 +112,7 @@ spec:
...
@@ -112,7 +112,7 @@ spec:
imagePullPolicy: IfNotPresent
imagePullPolicy: IfNotPresent
resources:
resources:
limits:
limits:
memory: 1
7
0Mi
memory: 1
00
0Mi
requests:
requests:
cpu: 100m
cpu: 100m
memory: 70Mi
memory: 70Mi
...
...
cluster/addons/dns/coredns/coredns.yaml.sed
View file @
ab02fd6f
...
@@ -112,7 +112,7 @@ spec:
...
@@ -112,7 +112,7 @@ spec:
i
magePullPolicy: IfNotPresent
i
magePullPolicy: IfNotPresent
re
s
o
urces:
re
s
o
urces:
limits:
limits:
mem
o
ry: 1
7
0Mi
mem
o
ry: 1
00
0Mi
requests:
requests:
cpu: 100m
cpu: 100m
mem
o
r
y
:
70Mi
mem
o
r
y
:
70Mi
...
...
cluster/gce/config-default.sh
View file @
ab02fd6f
...
@@ -259,7 +259,7 @@ fi
...
@@ -259,7 +259,7 @@ fi
# Optional: Install cluster DNS.
# Optional: Install cluster DNS.
# Set CLUSTER_DNS_CORE_DNS to 'true' to install CoreDNS instead of kube-dns.
# Set CLUSTER_DNS_CORE_DNS to 'true' to install CoreDNS instead of kube-dns.
CLUSTER_DNS_CORE_DNS
=
"
${
CLUSTER_DNS_CORE_DNS
:-
fals
e
}
"
CLUSTER_DNS_CORE_DNS
=
"
${
CLUSTER_DNS_CORE_DNS
:-
tru
e
}
"
ENABLE_CLUSTER_DNS
=
"
${
KUBE_ENABLE_CLUSTER_DNS
:-
true
}
"
ENABLE_CLUSTER_DNS
=
"
${
KUBE_ENABLE_CLUSTER_DNS
:-
true
}
"
DNS_SERVER_IP
=
"
${
KUBE_DNS_SERVER_IP
:-
10
.0.0.10
}
"
DNS_SERVER_IP
=
"
${
KUBE_DNS_SERVER_IP
:-
10
.0.0.10
}
"
DNS_DOMAIN
=
"
${
KUBE_DNS_DOMAIN
:-
cluster
.local
}
"
DNS_DOMAIN
=
"
${
KUBE_DNS_DOMAIN
:-
cluster
.local
}
"
...
...
cluster/gce/config-test.sh
View file @
ab02fd6f
...
@@ -266,7 +266,7 @@ fi
...
@@ -266,7 +266,7 @@ fi
# Optional: Install cluster DNS.
# Optional: Install cluster DNS.
# Set CLUSTER_DNS_CORE_DNS to 'true' to install CoreDNS instead of kube-dns.
# Set CLUSTER_DNS_CORE_DNS to 'true' to install CoreDNS instead of kube-dns.
CLUSTER_DNS_CORE_DNS
=
"
${
CLUSTER_DNS_CORE_DNS
:-
fals
e
}
"
CLUSTER_DNS_CORE_DNS
=
"
${
CLUSTER_DNS_CORE_DNS
:-
tru
e
}
"
ENABLE_CLUSTER_DNS
=
"
${
KUBE_ENABLE_CLUSTER_DNS
:-
true
}
"
ENABLE_CLUSTER_DNS
=
"
${
KUBE_ENABLE_CLUSTER_DNS
:-
true
}
"
DNS_SERVER_IP
=
"10.0.0.10"
DNS_SERVER_IP
=
"10.0.0.10"
DNS_DOMAIN
=
"cluster.local"
DNS_DOMAIN
=
"cluster.local"
...
...
test/e2e/framework/framework.go
View file @
ab02fd6f
...
@@ -251,9 +251,18 @@ func (f *Framework) BeforeEach() {
...
@@ -251,9 +251,18 @@ func (f *Framework) BeforeEach() {
if
TestContext
.
GatherKubeSystemResourceUsageData
!=
"false"
&&
TestContext
.
GatherKubeSystemResourceUsageData
!=
"none"
{
if
TestContext
.
GatherKubeSystemResourceUsageData
!=
"false"
&&
TestContext
.
GatherKubeSystemResourceUsageData
!=
"none"
{
var
err
error
var
err
error
var
nodeMode
NodesSet
switch
TestContext
.
GatherKubeSystemResourceUsageData
{
case
"master"
:
nodeMode
=
MasterAndDNSNodes
case
"masteranddns"
:
nodeMode
=
MasterAndDNSNodes
default
:
nodeMode
=
AllNodes
}
f
.
gatherer
,
err
=
NewResourceUsageGatherer
(
f
.
ClientSet
,
ResourceGathererOptions
{
f
.
gatherer
,
err
=
NewResourceUsageGatherer
(
f
.
ClientSet
,
ResourceGathererOptions
{
InKubemark
:
ProviderIs
(
"kubemark"
),
InKubemark
:
ProviderIs
(
"kubemark"
),
MasterOnly
:
TestContext
.
GatherKubeSystemResourceUsageData
==
"master"
,
Nodes
:
nodeMode
,
ResourceDataGatheringPeriod
:
60
*
time
.
Second
,
ResourceDataGatheringPeriod
:
60
*
time
.
Second
,
ProbeDuration
:
15
*
time
.
Second
,
ProbeDuration
:
15
*
time
.
Second
,
PrintVerboseLogs
:
false
,
PrintVerboseLogs
:
false
,
...
...
test/e2e/framework/resource_usage_gatherer.go
View file @
ab02fd6f
...
@@ -202,12 +202,20 @@ type ContainerResourceGatherer struct {
...
@@ -202,12 +202,20 @@ type ContainerResourceGatherer struct {
type
ResourceGathererOptions
struct
{
type
ResourceGathererOptions
struct
{
InKubemark
bool
InKubemark
bool
MasterOnly
bool
Nodes
NodesSet
ResourceDataGatheringPeriod
time
.
Duration
ResourceDataGatheringPeriod
time
.
Duration
ProbeDuration
time
.
Duration
ProbeDuration
time
.
Duration
PrintVerboseLogs
bool
PrintVerboseLogs
bool
}
}
type
NodesSet
int
const
(
AllNodes
NodesSet
=
0
// All containers on all nodes
MasterNodes
NodesSet
=
1
// All containers on Master nodes only
MasterAndDNSNodes
NodesSet
=
2
// All containers on Master nodes and DNS containers on other nodes
)
func
NewResourceUsageGatherer
(
c
clientset
.
Interface
,
options
ResourceGathererOptions
,
pods
*
v1
.
PodList
)
(
*
ContainerResourceGatherer
,
error
)
{
func
NewResourceUsageGatherer
(
c
clientset
.
Interface
,
options
ResourceGathererOptions
,
pods
*
v1
.
PodList
)
(
*
ContainerResourceGatherer
,
error
)
{
g
:=
ContainerResourceGatherer
{
g
:=
ContainerResourceGatherer
{
client
:
c
,
client
:
c
,
...
@@ -237,13 +245,23 @@ func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOpt
...
@@ -237,13 +245,23 @@ func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOpt
return
nil
,
err
return
nil
,
err
}
}
}
}
dnsNodes
:=
make
(
map
[
string
]
bool
)
for
_
,
pod
:=
range
pods
.
Items
{
for
_
,
pod
:=
range
pods
.
Items
{
if
(
options
.
Nodes
==
MasterNodes
)
&&
!
system
.
IsMasterNode
(
pod
.
Spec
.
NodeName
)
{
continue
}
if
(
options
.
Nodes
==
MasterAndDNSNodes
)
&&
!
system
.
IsMasterNode
(
pod
.
Spec
.
NodeName
)
&&
pod
.
Labels
[
"k8s-app"
]
!=
"kube-dns"
{
continue
}
for
_
,
container
:=
range
pod
.
Status
.
InitContainerStatuses
{
for
_
,
container
:=
range
pod
.
Status
.
InitContainerStatuses
{
g
.
containerIDs
=
append
(
g
.
containerIDs
,
container
.
Name
)
g
.
containerIDs
=
append
(
g
.
containerIDs
,
container
.
Name
)
}
}
for
_
,
container
:=
range
pod
.
Status
.
ContainerStatuses
{
for
_
,
container
:=
range
pod
.
Status
.
ContainerStatuses
{
g
.
containerIDs
=
append
(
g
.
containerIDs
,
container
.
Name
)
g
.
containerIDs
=
append
(
g
.
containerIDs
,
container
.
Name
)
}
}
if
options
.
Nodes
==
MasterAndDNSNodes
{
dnsNodes
[
pod
.
Spec
.
NodeName
]
=
true
}
}
}
nodeList
,
err
:=
c
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
nodeList
,
err
:=
c
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -252,7 +270,7 @@ func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOpt
...
@@ -252,7 +270,7 @@ func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOpt
}
}
for
_
,
node
:=
range
nodeList
.
Items
{
for
_
,
node
:=
range
nodeList
.
Items
{
if
!
options
.
MasterOnly
||
system
.
IsMasterNode
(
node
.
Name
)
{
if
options
.
Nodes
==
AllNodes
||
system
.
IsMasterNode
(
node
.
Name
)
||
dnsNodes
[
node
.
Name
]
{
g
.
workerWg
.
Add
(
1
)
g
.
workerWg
.
Add
(
1
)
g
.
workers
=
append
(
g
.
workers
,
resourceGatherWorker
{
g
.
workers
=
append
(
g
.
workers
,
resourceGatherWorker
{
c
:
c
,
c
:
c
,
...
@@ -266,7 +284,7 @@ func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOpt
...
@@ -266,7 +284,7 @@ func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOpt
probeDuration
:
options
.
ProbeDuration
,
probeDuration
:
options
.
ProbeDuration
,
printVerboseLogs
:
options
.
PrintVerboseLogs
,
printVerboseLogs
:
options
.
PrintVerboseLogs
,
})
})
if
options
.
MasterOnly
{
if
options
.
Nodes
==
MasterNodes
{
break
break
}
}
}
}
...
...
test/e2e/scheduling/nvidia-gpus.go
View file @
ab02fd6f
...
@@ -137,7 +137,7 @@ func SetupNVIDIAGPUNode(f *framework.Framework, setupResourceGatherer bool) *fra
...
@@ -137,7 +137,7 @@ func SetupNVIDIAGPUNode(f *framework.Framework, setupResourceGatherer bool) *fra
var
rsgather
*
framework
.
ContainerResourceGatherer
var
rsgather
*
framework
.
ContainerResourceGatherer
if
setupResourceGatherer
{
if
setupResourceGatherer
{
framework
.
Logf
(
"Starting ResourceUsageGather for the created DaemonSet pods."
)
framework
.
Logf
(
"Starting ResourceUsageGather for the created DaemonSet pods."
)
rsgather
,
err
=
framework
.
NewResourceUsageGatherer
(
f
.
ClientSet
,
framework
.
ResourceGathererOptions
{
InKubemark
:
false
,
MasterOnly
:
false
,
ResourceDataGatheringPeriod
:
2
*
time
.
Second
,
ProbeDuration
:
2
*
time
.
Second
,
PrintVerboseLogs
:
true
},
pods
)
rsgather
,
err
=
framework
.
NewResourceUsageGatherer
(
f
.
ClientSet
,
framework
.
ResourceGathererOptions
{
InKubemark
:
false
,
Nodes
:
framework
.
AllNodes
,
ResourceDataGatheringPeriod
:
2
*
time
.
Second
,
ProbeDuration
:
2
*
time
.
Second
,
PrintVerboseLogs
:
true
},
pods
)
framework
.
ExpectNoError
(
err
,
"creating ResourceUsageGather for the daemonset pods"
)
framework
.
ExpectNoError
(
err
,
"creating ResourceUsageGather for the daemonset pods"
)
go
rsgather
.
StartGatheringData
()
go
rsgather
.
StartGatheringData
()
}
}
...
...
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