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
ec246adb
Commit
ec246adb
authored
Nov 07, 2014
by
Daniel Smith
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2208 from vishh/monitoring
Use Heapster as an in-built monitoring solution for Kubernetes in GCE.
parents
6a1e5d63
37af9210
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
124 additions
and
0 deletions
+124
-0
config-default.sh
cluster/gce/config-default.sh
+2
-0
config-test.sh
cluster/gce/config-test.sh
+1
-0
util.sh
cluster/gce/util.sh
+43
-0
kube-up.sh
cluster/kube-up.sh
+1
-0
util.sh
cluster/rackspace/util.sh
+4
-0
util.sh
cluster/vagrant/util.sh
+4
-0
util.sh
cluster/vsphere/util.sh
+4
-0
README.md
examples/monitoring/README.md
+3
-0
heapster-pod.json
examples/monitoring/heapster-pod.json
+18
-0
influx-grafana-pod.json
examples/monitoring/influx-grafana-pod.json
+34
-0
influx-grafana-service.json
examples/monitoring/influx-grafana-service.json
+10
-0
No files found.
cluster/gce/config-default.sh
View file @
ec246adb
...
...
@@ -35,3 +35,5 @@ MINION_SCOPES="compute-rw"
# 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"
# When set to true, heapster will be setup as part of the cluster bring up.
MONITORING
=
true
cluster/gce/config-test.sh
View file @
ec246adb
...
...
@@ -35,3 +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
cluster/gce/util.sh
View file @
ec246adb
...
...
@@ -569,3 +569,46 @@ function ssh-to-node {
function
restart-kube-proxy
{
ssh-to-node
"
$1
"
"sudo /etc/init.d/kube-proxy restart"
}
# Setup monitoring using heapster and InfluxDB
function
setup-monitoring
{
if
[
$MONITORING
]
;
then
teardown-monitoring
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://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
{
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/kube-up.sh
View file @
ec246adb
...
...
@@ -34,5 +34,6 @@ verify-prereqs
kube-up
"
${
KUBE_ROOT
}
/cluster/validate-cluster.sh"
setup-monitoring
echo
"Done"
cluster/rackspace/util.sh
View file @
ec246adb
...
...
@@ -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 @
ec246adb
...
...
@@ -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 @
ec246adb
...
...
@@ -471,3 +471,7 @@ function test-setup {
function
test-teardown
{
echo
"TODO"
}
function
setup-monitoring
{
echo
"TODO"
}
examples/monitoring/README.md
0 → 100644
View file @
ec246adb
# Heapster
Heapster enables monitoring of Kubernetes Clusters using
[
cAdvisor
](
https://github.com/google/cadvisor
)
. Detailed information about heapster can be found
[
here
](
https://github.com/GoogleCloudPlatform/heapster
)
.
examples/monitoring/heapster-pod.json
0 → 100644
View file @
ec246adb
{
"id"
:
"heapster"
,
"kind"
:
"Pod"
,
"apiVersion"
:
"v1beta1"
,
"desiredState"
:
{
"manifest"
:
{
"version"
:
"v1beta1"
,
"id"
:
"heapster"
,
"containers"
:
[{
"name"
:
"heapster"
,
"image"
:
"kubernetes/heapster"
,
}]
}
},
"labels"
:
{
"name"
:
"heapster"
,
}
}
examples/monitoring/influx-grafana-pod.json
0 → 100644
View file @
ec246adb
{
"id"
:
"influx-grafana"
,
"kind"
:
"Pod"
,
"apiVersion"
:
"v1beta1"
,
"desiredState"
:
{
"manifest"
:
{
"version"
:
"v1beta1"
,
"id"
:
"influx-grafana"
,
"containers"
:
[{
"name"
:
"influxdb"
,
"image"
:
"kubernetes/heapster_influxdb"
,
"ports"
:
[
{
"containerPort"
:
8083
,
"hostPort"
:
8083
},
{
"containerPort"
:
8086
,
"hostPort"
:
8086
},
{
"containerPort"
:
8090
,
"hostPort"
:
8090
},
{
"containerPort"
:
8099
,
"hostPort"
:
8099
}]
},
{
"name"
:
"grafana"
,
"image"
:
"kubernetes/heapster_grafana"
,
"ports"
:
[{
"containerPort"
:
80
,
"hostPort"
:
80
}],
"env"
:
[{
"name"
:
HTTP_USER
,
"value"
:
admin
},
{
"name"
:
HTTP_PASS
,
"value"
:
admin
}],
},
{
"name"
:
"elasticsearch"
,
"image"
:
"dockerfile/elasticsearch"
,
"ports"
:
[{
"containerPort"
:
9200
,
"hostPort"
:
9200
},
{
"containerPort"
:
9300
}],
}]
},
},
"labels"
:
{
"name"
:
"influxdb"
,
}
}
examples/monitoring/influx-grafana-service.json
0 → 100644
View file @
ec246adb
{
"id"
:
"influx-master"
,
"kind"
:
"Service"
,
"apiVersion"
:
"v1beta1"
,
"port"
:
8085
,
"containerPort"
:
8086
,
"provider"
:
"kubernetes-default"
,
"component"
:
"influxdb"
,
"selector"
:
{
"name"
:
"influxdb"
}
}
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