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
c3d400f4
Commit
c3d400f4
authored
Jan 06, 2016
by
Minhan Xia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gather Fluentd logs
parent
ed8390a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
fluentd-es.yaml
cluster/saltbase/salt/fluentd-es/fluentd-es.yaml
+0
-2
es_cluster_logging.go
test/e2e/es_cluster_logging.go
+16
-4
No files found.
cluster/saltbase/salt/fluentd-es/fluentd-es.yaml
View file @
c3d400f4
...
...
@@ -12,8 +12,6 @@ spec:
resources
:
limits
:
cpu
:
100m
args
:
-
-q
volumeMounts
:
-
name
:
varlog
mountPath
:
/var/log
...
...
test/e2e/es_cluster_logging.go
View file @
c3d400f4
...
...
@@ -219,9 +219,9 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
By
(
"Checking to make sure the Fluentd pod are running on each healthy node"
)
label
=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
k8sAppKey
:
fluentdValue
}))
options
=
api
.
ListOptions
{
LabelSelector
:
label
}
pods
,
err
=
f
.
Client
.
Pods
(
api
.
NamespaceSystem
)
.
List
(
options
)
fluentdPods
,
err
:
=
f
.
Client
.
Pods
(
api
.
NamespaceSystem
)
.
List
(
options
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
for
_
,
pod
:=
range
p
ods
.
Items
{
for
_
,
pod
:=
range
fluentdP
ods
.
Items
{
if
nodeInNodeList
(
pod
.
Spec
.
NodeName
,
nodes
)
{
err
=
waitForPodRunningInNamespace
(
f
.
Client
,
pod
.
Name
,
api
.
NamespaceSystem
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
...
@@ -231,7 +231,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
// Check if each healthy node has fluentd running on it
for
_
,
node
:=
range
nodes
.
Items
{
exists
:=
false
for
_
,
pod
:=
range
p
ods
.
Items
{
for
_
,
pod
:=
range
fluentdP
ods
.
Items
{
if
pod
.
Spec
.
NodeName
==
node
.
Name
{
exists
=
true
break
...
...
@@ -432,7 +432,7 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
}
for
n
:=
range
missingPerNode
{
if
missingPerNode
[
n
]
>
0
{
Logf
(
"Node %d
is missing %d logs"
,
n
,
missingPerNode
[
n
])
Logf
(
"Node %d
%s is missing %d logs"
,
n
,
nodes
.
Items
[
n
]
.
Name
,
missingPerNode
[
n
])
opts
:=
&
api
.
PodLogOptions
{}
body
,
err
=
f
.
Client
.
Pods
(
ns
)
.
GetLogs
(
podNames
[
n
],
opts
)
.
DoRaw
()
if
err
!=
nil
{
...
...
@@ -440,6 +440,18 @@ func ClusterLevelLoggingWithElasticsearch(f *Framework) {
continue
}
Logf
(
"Pod %s has the following logs: %s"
,
podNames
[
n
],
body
)
for
_
,
pod
:=
range
fluentdPods
.
Items
{
if
pod
.
Spec
.
NodeName
==
nodes
.
Items
[
n
]
.
Name
{
body
,
err
=
f
.
Client
.
Pods
(
api
.
NamespaceSystem
)
.
GetLogs
(
pod
.
Name
,
opts
)
.
DoRaw
()
if
err
!=
nil
{
Logf
(
"Cannot get logs from pod %v"
,
pod
.
Name
)
break
}
Logf
(
"Fluentd Pod %s on node %s has the following logs: %s"
,
pod
.
Name
,
nodes
.
Items
[
n
]
.
Name
,
body
)
break
}
}
}
}
Failf
(
"Failed to find all %d log lines"
,
expected
)
...
...
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