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
37af9210
Commit
37af9210
authored
Nov 07, 2014
by
Vishnu Kannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve the monitoring setup script and fix bugs in the monitoring config.
parent
ad9cb982
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
21 deletions
+46
-21
config-default.sh
cluster/gce/config-default.sh
+1
-2
config-test.sh
cluster/gce/config-test.sh
+1
-2
util.sh
cluster/gce/util.sh
+30
-14
util.sh
cluster/rackspace/util.sh
+4
-0
util.sh
cluster/vagrant/util.sh
+4
-0
util.sh
cluster/vsphere/util.sh
+4
-0
influx-grafana-service.json
examples/monitoring/influx-grafana-service.json
+2
-3
No files found.
cluster/gce/config-default.sh
View file @
37af9210
...
...
@@ -36,4 +36,4 @@ MINION_SCOPES="compute-rw"
POLL_SLEEP_INTERVAL
=
3
PORTAL_NET
=
"10.0.0.0/16"
# When set to true, heapster will be setup as part of the cluster bring up.
MONITORING
=
true
\ No newline at end of file
MONITORING
=
true
cluster/gce/config-test.sh
View file @
37af9210
...
...
@@ -35,4 +35,4 @@ MINION_SCOPES=""
# Increase the sleep interval value if concerned about API rate limits. 3, in seconds, is the default.
POLL_SLEEP_INTERVAL
=
3
PORTAL_NET
=
"10.0.0.0/16"
MONITORING
=
false
\ No newline at end of file
MONITORING
=
false
cluster/gce/util.sh
View file @
37af9210
...
...
@@ -429,9 +429,6 @@ EOF
function
kube-down
{
# Detect the project into $PROJECT
detect-project
# Monitoring might have been setup. It doesn't hurt to attempt shutdown even it wasn't setup.
teardown-monitoring
echo
"Bringing down cluster"
gcutil deletefirewall
\
...
...
@@ -577,21 +574,41 @@ function restart-kube-proxy {
function
setup-monitoring
{
if
[
$MONITORING
]
;
then
teardown-monitoring
kubectl.sh create
-f
"
${
KUBE_ROOT
}
/examples/monitoring/influx-grafana-pod.json"
&&
kubectl.sh create
-f
"
${
KUBE_ROOT
}
/examples/monitoring/influx-grafana-service.json"
&&
kubectl.sh create
-f
"
${
KUBE_ROOT
}
/examples/monitoring/heapster-pod.json"
if
!
gcutil getfirewall monitoring-heapster &> /dev/null
;
then
gcutil addfirewall monitoring-heapster
\
--project
"
${
PROJECT
}
"
\
--norespect_terminal_width
\
--sleep_between_polls
"
${
POLL_SLEEP_INTERVAL
}
"
\
--target_tags
=
"
${
MINION_TAG
}
"
\
--allowed
"tcp:80,tcp:8083,tcp:8086,tcp:9200"
;
if
[
$?
-ne
0
]
;
then
echo
"Failed to Setup Firewall for Monitoring"
&&
false
fi
fi
kubectl.sh create
-f
"
${
KUBE_ROOT
}
/examples/monitoring/influx-grafana-pod.json"
>
/dev/null
&&
kubectl.sh create
-f
"
${
KUBE_ROOT
}
/examples/monitoring/influx-grafana-service.json"
>
/dev/null
&&
kubectl.sh create
-f
"
${
KUBE_ROOT
}
/examples/monitoring/heapster-pod.json"
>
/dev/null
if
[
$?
-ne
0
]
;
then
echo
"Failed to Setup Monitoring"
teardown-monitoring
else
dashboardIP
=
"http://
`
kubectl.sh get
-o
json pod influx-grafana |
grep
hostIP |
awk
'{print $2}'
|
sed
's/[,|\"]//g'
`
"
echo
"Grafana dashboard is available at
$dashboardIP
"
echo
"username is 'admin' and password is 'admin'"
dashboardIP
=
"http://admin:admin@
`
kubectl.sh get
-o
json pod influx-grafana |
grep
hostIP |
awk
'{print $2}'
|
sed
's/[,|\"]//g'
`
"
echo
"Grafana dashboard will be available at
$dashboardIP
. Wait for the monitoring dashboard to be online."
fi
fi
}
function
teardown-monitoring
{
kubectl.sh delete pods heapster
||
true
kubectl.sh delete pods influx-grafana
||
true
kubectl.sh delete services influx-master
||
true
}
\ No newline at end of file
if
[
$MONITORING
]
;
then
kubectl.sh delete pods heapster &> /dev/null
||
true
kubectl.sh delete pods influx-grafana &> /dev/null
||
true
kubectl.sh delete services influx-master &> /dev/null
||
true
gcutil deletefirewall
\
--project
"
${
PROJECT
}
"
\
--norespect_terminal_width
\
--sleep_between_polls
"
${
POLL_SLEEP_INTERVAL
}
"
\
--force
\
monitoring-heapster
||
true
>
/dev/null
fi
}
cluster/rackspace/util.sh
View file @
37af9210
...
...
@@ -322,3 +322,7 @@ kube-up() {
echo
" subject to
\"
Man in the middle
\"
type attacks."
echo
}
function
setup-monitoring
{
echo
"TODO"
}
cluster/vagrant/util.sh
View file @
37af9210
...
...
@@ -172,3 +172,7 @@ function ssh-to-node {
function
restart-kube-proxy
{
ssh-to-node
"
$1
"
"sudo systemctl restart kube-proxy"
}
function
setup-monitoring
{
echo
"TODO"
}
cluster/vsphere/util.sh
View file @
37af9210
...
...
@@ -471,3 +471,7 @@ function test-setup {
function
test-teardown
{
echo
"TODO"
}
function
setup-monitoring
{
echo
"TODO"
}
examples/monitoring/influx-grafana-service.json
View file @
37af9210
...
...
@@ -5,6 +5,6 @@
"port"
:
8085
,
"containerPort"
:
8086
,
"provider"
:
"kubernetes-default"
,
"component"
:
"influxdb"
"component"
:
"influxdb"
,
"selector"
:
{
"name"
:
"influxdb"
}
}
\ No newline at end of file
}
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