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
bf0f070f
Commit
bf0f070f
authored
Mar 23, 2017
by
Mik Vyatskov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check fluentd deployment befure running cluster logging e2e tests
parent
13e2f5d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
cluster_logging_es.go
test/e2e/cluster_logging_es.go
+3
-0
cluster_logging_gcl.go
test/e2e/cluster_logging_gcl.go
+3
-0
cluster_logging_utils.go
test/e2e/cluster_logging_utils.go
+25
-0
No files found.
test/e2e/cluster_logging_es.go
View file @
bf0f070f
...
@@ -44,6 +44,9 @@ var _ = framework.KubeDescribe("Cluster level logging using Elasticsearch [Featu
...
@@ -44,6 +44,9 @@ var _ = framework.KubeDescribe("Cluster level logging using Elasticsearch [Featu
err
=
esLogsProvider
.
EnsureWorking
()
err
=
esLogsProvider
.
EnsureWorking
()
framework
.
ExpectNoError
(
err
,
"Elasticsearch is not working"
)
framework
.
ExpectNoError
(
err
,
"Elasticsearch is not working"
)
err
=
ensureSingleFluentdOnEachNode
(
f
,
esLogsProvider
.
FluentdApplicationName
())
framework
.
ExpectNoError
(
err
,
"Fluentd deployed incorrectly"
)
By
(
"Running synthetic logger"
)
By
(
"Running synthetic logger"
)
pod
:=
createLoggingPod
(
f
,
podName
,
10
*
60
,
10
*
time
.
Minute
)
pod
:=
createLoggingPod
(
f
,
podName
,
10
*
60
,
10
*
time
.
Minute
)
defer
f
.
PodClient
()
.
Delete
(
podName
,
&
meta_v1
.
DeleteOptions
{})
defer
f
.
PodClient
()
.
Delete
(
podName
,
&
meta_v1
.
DeleteOptions
{})
...
...
test/e2e/cluster_logging_gcl.go
View file @
bf0f070f
...
@@ -42,6 +42,9 @@ var _ = framework.KubeDescribe("Cluster level logging using GCL", func() {
...
@@ -42,6 +42,9 @@ var _ = framework.KubeDescribe("Cluster level logging using GCL", func() {
err
=
gclLogsProvider
.
EnsureWorking
()
err
=
gclLogsProvider
.
EnsureWorking
()
framework
.
ExpectNoError
(
err
,
"GCL is not working"
)
framework
.
ExpectNoError
(
err
,
"GCL is not working"
)
err
=
ensureSingleFluentdOnEachNode
(
f
,
gclLogsProvider
.
FluentdApplicationName
())
framework
.
ExpectNoError
(
err
,
"Fluentd deployed incorrectly"
)
By
(
"Running synthetic logger"
)
By
(
"Running synthetic logger"
)
pod
:=
createLoggingPod
(
f
,
podName
,
10
*
60
,
10
*
time
.
Minute
)
pod
:=
createLoggingPod
(
f
,
podName
,
10
*
60
,
10
*
time
.
Minute
)
defer
f
.
PodClient
()
.
Delete
(
podName
,
&
meta_v1
.
DeleteOptions
{})
defer
f
.
PodClient
()
.
Delete
(
podName
,
&
meta_v1
.
DeleteOptions
{})
...
...
test/e2e/cluster_logging_utils.go
View file @
bf0f070f
...
@@ -284,6 +284,31 @@ func getMissingLinesCount(logsProvider logsProvider, pod *loggingPod) (int, erro
...
@@ -284,6 +284,31 @@ func getMissingLinesCount(logsProvider logsProvider, pod *loggingPod) (int, erro
return
pod
.
ExpectedLinesNumber
-
len
(
pod
.
Occurrences
),
nil
return
pod
.
ExpectedLinesNumber
-
len
(
pod
.
Occurrences
),
nil
}
}
func
ensureSingleFluentdOnEachNode
(
f
*
framework
.
Framework
,
fluentdApplicationName
string
)
error
{
fluentdPodList
,
err
:=
getFluentdPods
(
f
,
fluentdApplicationName
)
if
err
!=
nil
{
return
err
}
fluentdPodsPerNode
:=
make
(
map
[
string
]
int
)
for
_
,
fluentdPod
:=
range
fluentdPodList
.
Items
{
fluentdPodsPerNode
[
fluentdPod
.
Spec
.
NodeName
]
++
}
nodeList
:=
framework
.
GetReadySchedulableNodesOrDie
(
f
.
ClientSet
)
for
_
,
node
:=
range
nodeList
.
Items
{
fluentdPodCount
,
ok
:=
fluentdPodsPerNode
[
node
.
Name
]
if
!
ok
{
return
fmt
.
Errorf
(
"node %s doesn't have fluentd instance"
,
node
.
Name
)
}
else
if
fluentdPodCount
!=
1
{
return
fmt
.
Errorf
(
"node %s contains %d fluentd instaces, expected exactly one"
,
node
.
Name
,
fluentdPodCount
)
}
}
return
nil
}
func
getFluentdPods
(
f
*
framework
.
Framework
,
fluentdApplicationName
string
)
(
*
api_v1
.
PodList
,
error
)
{
func
getFluentdPods
(
f
*
framework
.
Framework
,
fluentdApplicationName
string
)
(
*
api_v1
.
PodList
,
error
)
{
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"k8s-app"
:
fluentdApplicationName
}))
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"k8s-app"
:
fluentdApplicationName
}))
options
:=
meta_v1
.
ListOptions
{
LabelSelector
:
label
.
String
()}
options
:=
meta_v1
.
ListOptions
{
LabelSelector
:
label
.
String
()}
...
...
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