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
9832ae12
Commit
9832ae12
authored
Oct 17, 2016
by
Mik Vyatskov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update elasticsearch and kibana usage
parent
714f816a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
47 deletions
+17
-47
es-controller.yaml
cluster/addons/fluentd-elasticsearch/es-controller.yaml
+2
-2
kibana-controller.yaml
cluster/addons/fluentd-elasticsearch/kibana-controller.yaml
+1
-1
es-controller.yaml
...manifests/addons/fluentd-elasticsearch/es-controller.yaml
+4
-4
kibana-controller.yaml
...fests/addons/fluentd-elasticsearch/kibana-controller.yaml
+1
-1
cluster_logging_es.go
test/e2e/cluster_logging_es.go
+9
-39
No files found.
cluster/addons/fluentd-elasticsearch/es-controller.yaml
View file @
9832ae12
...
...
@@ -20,8 +20,8 @@ spec:
kubernetes.io/cluster-service
:
"
true"
spec
:
containers
:
-
image
:
gcr.io/google_containers/elasticsearch:
1.9
name
:
elasticsearch-logging
-
image
:
gcr.io/google_containers/elasticsearch:
v2.4.1
name
:
elasticsearch-logging
resources
:
# need more cpu upon initialization, therefore burstable class
limits
:
...
...
cluster/addons/fluentd-elasticsearch/kibana-controller.yaml
View file @
9832ae12
...
...
@@ -21,7 +21,7 @@ spec:
spec
:
containers
:
-
name
:
kibana-logging
image
:
gcr.io/google_containers/kibana:
1.3
image
:
gcr.io/google_containers/kibana:
v4.6.1
resources
:
# keep request = limit to keep this container in guaranteed class
limits
:
...
...
cluster/gce/coreos/kube-manifests/addons/fluentd-elasticsearch/es-controller.yaml
View file @
9832ae12
...
...
@@ -20,12 +20,12 @@ spec:
kubernetes.io/cluster-service
:
"
true"
spec
:
containers
:
-
image
:
gcr.io/google_containers/elasticsearch:
1.9
name
:
elasticsearch-logging
-
image
:
gcr.io/google_containers/elasticsearch:
v2.4.1
name
:
elasticsearch-logging
resources
:
#
keep request = limit to keep this container in guaranteed
class
#
need more cpu upon initialization, therefore burstable
class
limits
:
cpu
:
100m
cpu
:
100
0
m
requests
:
cpu
:
100m
ports
:
...
...
cluster/gce/coreos/kube-manifests/addons/fluentd-elasticsearch/kibana-controller.yaml
View file @
9832ae12
...
...
@@ -21,7 +21,7 @@ spec:
spec
:
containers
:
-
name
:
kibana-logging
image
:
gcr.io/google_containers/kibana:
1.3
image
:
gcr.io/google_containers/kibana:
v4.6.1
resources
:
# keep request = limit to keep this container in guaranteed class
limits
:
...
...
test/e2e/cluster_logging_es.go
View file @
9832ae12
...
...
@@ -111,8 +111,7 @@ func checkElasticsearchReadiness(f *framework.Framework) error {
By
(
"Checking to make sure we are talking to an Elasticsearch service."
)
// Perform a few checks to make sure this looks like an Elasticsearch cluster.
var
statusCode
float64
var
esResponse
map
[
string
]
interface
{}
var
statusCode
int
err
=
nil
var
body
[]
byte
for
start
:=
time
.
Now
();
time
.
Since
(
start
)
<
graceTime
;
time
.
Sleep
(
10
*
time
.
Second
)
{
...
...
@@ -122,52 +121,25 @@ func checkElasticsearchReadiness(f *framework.Framework) error {
continue
}
// Query against the root URL for Elasticsearch.
body
,
err
=
proxyRequest
.
Namespace
(
api
.
NamespaceSystem
)
.
response
:
=
proxyRequest
.
Namespace
(
api
.
NamespaceSystem
)
.
Name
(
"elasticsearch-logging"
)
.
DoRaw
()
Do
()
err
=
response
.
Error
()
response
.
StatusCode
(
&
statusCode
)
if
err
!=
nil
{
framework
.
Logf
(
"After %v proxy call to elasticsearch-loigging failed: %v"
,
time
.
Since
(
start
),
err
)
continue
}
err
=
json
.
Unmarshal
(
body
,
&
esResponse
)
if
err
!=
nil
{
framework
.
Logf
(
"After %v failed to convert Elasticsearch JSON response %v to map[string]interface{}: %v"
,
time
.
Since
(
start
),
string
(
body
),
err
)
continue
}
statusIntf
,
ok
:=
esResponse
[
"status"
]
if
!
ok
{
framework
.
Logf
(
"After %v Elasticsearch response has no status field: %v"
,
time
.
Since
(
start
),
esResponse
)
continue
}
statusCode
,
ok
=
statusIntf
.
(
float64
)
if
!
ok
{
// Assume this is a string returning Failure. Retry.
framework
.
Logf
(
"After %v expected status to be a float64 but got %v of type %T"
,
time
.
Since
(
start
),
statusIntf
,
statusIntf
)
continue
}
if
int
(
statusCode
)
!=
200
{
framework
.
Logf
(
"After %v Elasticsearch cluster has a bad status: %v"
,
time
.
Since
(
start
),
statusCode
)
continue
}
break
}
if
err
!=
nil
{
return
err
}
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
if
int
(
statusCode
)
!=
200
{
return
fmt
.
Errorf
(
"Elasticsearch cluster has a bad status: %v"
,
statusCode
)
}
// Check to see if have a cluster_name field.
clusterName
,
ok
:=
esResponse
[
"cluster_name"
]
if
!
ok
{
return
fmt
.
Errorf
(
"No cluster_name field in Elasticsearch response: %v"
,
esResponse
)
}
if
clusterName
!=
"kubernetes-logging"
{
return
fmt
.
Errorf
(
"Connected to wrong cluster %q (expecting kubernetes_logging)"
,
clusterName
)
framework
.
Failf
(
"Elasticsearch cluster has a bad status: %v"
,
statusCode
)
}
// Now assume we really are talking to an Elasticsearch instance.
...
...
@@ -188,8 +160,7 @@ func checkElasticsearchReadiness(f *framework.Framework) error {
if
err
!=
nil
{
continue
}
var
health
map
[
string
]
interface
{}
health
:=
make
(
map
[
string
]
interface
{})
err
:=
json
.
Unmarshal
(
body
,
&
health
)
if
err
!=
nil
{
framework
.
Logf
(
"Bad json response from elasticsearch: %v"
,
err
)
...
...
@@ -210,7 +181,6 @@ func checkElasticsearchReadiness(f *framework.Framework) error {
break
}
}
if
!
healthy
{
return
fmt
.
Errorf
(
"After %v elasticsearch cluster is not healthy"
,
graceTime
)
}
...
...
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