mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Add an option for enabling monitoring in gce/config-default.sh and disable it
for tests. Updated heapster readme.
This commit is contained in:
		@@ -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.
 | 
					# Increase the sleep interval value if concerned about API rate limits. 3, in seconds, is the default.
 | 
				
			||||||
POLL_SLEEP_INTERVAL=3
 | 
					POLL_SLEEP_INTERVAL=3
 | 
				
			||||||
PORTAL_NET="10.0.0.0/16"
 | 
					PORTAL_NET="10.0.0.0/16"
 | 
				
			||||||
 | 
					# When set to true, heapster will be setup as part of the cluster bring up.
 | 
				
			||||||
 | 
					MONITORING=true
 | 
				
			||||||
@@ -35,3 +35,4 @@ MINION_SCOPES=""
 | 
				
			|||||||
# Increase the sleep interval value if concerned about API rate limits. 3, in seconds, is the default.
 | 
					# Increase the sleep interval value if concerned about API rate limits. 3, in seconds, is the default.
 | 
				
			||||||
POLL_SLEEP_INTERVAL=3
 | 
					POLL_SLEEP_INTERVAL=3
 | 
				
			||||||
PORTAL_NET="10.0.0.0/16"
 | 
					PORTAL_NET="10.0.0.0/16"
 | 
				
			||||||
 | 
					MONITORING=false
 | 
				
			||||||
@@ -575,10 +575,7 @@ function restart-kube-proxy {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Setup monitoring using heapster and InfluxDB
 | 
					# Setup monitoring using heapster and InfluxDB
 | 
				
			||||||
function setup-monitoring {
 | 
					function setup-monitoring {
 | 
				
			||||||
    read -p "Setup monitoring of the cluster using heapster (https://github.com/GoogleCloudPlatform/heapster) [Y|N]? " -n 1 -r
 | 
					    if [ $MONITORING ]; then
 | 
				
			||||||
    echo
 | 
					 | 
				
			||||||
    if [[ $REPLY =~ ^[Yy]$ ]]
 | 
					 | 
				
			||||||
    then
 | 
					 | 
				
			||||||
	teardown-monitoring
 | 
						teardown-monitoring
 | 
				
			||||||
	kubectl.sh create -f "${KUBE_ROOT}/examples/monitoring/influx-grafana-pod.json" && 
 | 
						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/influx-grafana-service.json" &&
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,52 +1,3 @@
 | 
				
			|||||||
Heapster
 | 
					# Heapster
 | 
				
			||||||
===========
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
Heapster enables monitoring of Kubernetes Clusters using [cAdvisor](https://github.com/google/cadvisor). It currently works only on GCE.
 | 
					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).
 | 
				
			||||||
 | 
					 | 
				
			||||||
#####Run Heapster in a Kubernetes cluster with an Influxdb backend and [Grafana](http://grafana.org/docs/features/influxdb)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Step 1: Setup Kube cluster**
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Fork the Kubernetes repository and [turn up a Kubernetes cluster](https://github.com/GoogleCloudPlatform/kubernetes-new#contents), if you haven't already. Make sure kubectl.sh is exported.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Step 2: Start a Pod with Influxdb, grafana and elasticsearch**
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```shell
 | 
					 | 
				
			||||||
$ kubectl.sh create -f deploy/influx-grafana-pod.json
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Step 3: Start Influxdb service**
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```shell
 | 
					 | 
				
			||||||
$ kubectl.sh create -f deploy/influx-grafana-service.json
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Step 4: Update firewall rules**
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Open up ports tcp:80,8083,8086,9200.
 | 
					 | 
				
			||||||
```shell
 | 
					 | 
				
			||||||
$ gcutil addfirewall --allowed=tcp:80,tcp:8083,tcp:8086,tcp:9200 --target_tags=kubernetes-minion heapster
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Step 5: Start Heapster Pod**
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```shell
 | 
					 | 
				
			||||||
$ kubectl.sh create -f deploy/heapster-pod.json
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Verify that all the pods and services are up and running:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```shell
 | 
					 | 
				
			||||||
$ kubectl.sh get pods
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
```shell
 | 
					 | 
				
			||||||
$ kubectl.sh get services
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
To start monitoring the cluster using grafana, find out the the external IP of the minion where the 'influx-grafana' Pod is running from the output of `kubectl.sh get pods`, and visit `http://<minion-ip>:80`. 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
To access the Influxdb UI visit  `http://<minion-ip>:8083`.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#####Hints
 | 
					 | 
				
			||||||
* Grafana's default username and password is 'admin'. You can change that by modifying the grafana container [here](influx-grafana/deploy/grafana-influxdb-pod.json)
 | 
					 | 
				
			||||||
* To enable memory and swap accounting on the minions follow the instructions [here](https://docs.docker.com/installation/ubuntulinux/#memory-and-swap-accounting)
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user