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
fa91b3e4
Commit
fa91b3e4
authored
Jun 16, 2016
by
pprokop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding option to deploy fluentd-elasticsearch in diffrent namespace then kube-system
parent
523e83fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
elasticsearch_logging_discovery.go
...elasticsearch/es-image/elasticsearch_logging_discovery.go
+11
-2
No files found.
cluster/addons/fluentd-elasticsearch/es-image/elasticsearch_logging_discovery.go
View file @
fa91b3e4
...
@@ -19,6 +19,7 @@ package main
...
@@ -19,6 +19,7 @@ package main
import
(
import
(
"flag"
"flag"
"fmt"
"fmt"
"os"
"strings"
"strings"
"time"
"time"
...
@@ -45,12 +46,20 @@ func main() {
...
@@ -45,12 +46,20 @@ func main() {
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Fatalf
(
"Failed to make client: %v"
,
err
)
glog
.
Fatalf
(
"Failed to make client: %v"
,
err
)
}
}
namespace
:=
api
.
NamespaceSystem
envNamespace
:=
os
.
Getenv
(
"NAMESPACE"
)
if
envNamespace
!=
""
{
if
_
,
err
:=
c
.
Namespaces
()
.
Get
(
envNamespace
);
err
!=
nil
{
glog
.
Fatalf
(
"%s namespace doesn't exist: %v"
,
envNamespace
,
err
)
}
namespace
=
envNamespace
}
var
elasticsearch
*
api
.
Service
var
elasticsearch
*
api
.
Service
// Look for endpoints associated with the Elasticsearch loggging service.
// Look for endpoints associated with the Elasticsearch loggging service.
// First wait for the service to become available.
// First wait for the service to become available.
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
elasticsearch
,
err
=
c
.
Services
(
api
.
NamespaceSystem
)
.
Get
(
"elasticsearch-logging"
)
elasticsearch
,
err
=
c
.
Services
(
namespace
)
.
Get
(
"elasticsearch-logging"
)
if
err
==
nil
{
if
err
==
nil
{
break
break
}
}
...
@@ -67,7 +76,7 @@ func main() {
...
@@ -67,7 +76,7 @@ func main() {
// Wait for some endpoints.
// Wait for some endpoints.
count
:=
0
count
:=
0
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
for
t
:=
time
.
Now
();
time
.
Since
(
t
)
<
5
*
time
.
Minute
;
time
.
Sleep
(
10
*
time
.
Second
)
{
endpoints
,
err
=
c
.
Endpoints
(
api
.
NamespaceSystem
)
.
Get
(
"elasticsearch-logging"
)
endpoints
,
err
=
c
.
Endpoints
(
namespace
)
.
Get
(
"elasticsearch-logging"
)
if
err
!=
nil
{
if
err
!=
nil
{
continue
continue
}
}
...
...
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