Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions to run visulizer on remote cluster #13

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 50 additions & 2 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,58 @@ This is a simple visualizer for use with the Kubernetes API.

### Usage:
* First install a Kubernetes or Container Engine Cluster
* ```git clone https://github.com/brendandburns/gcp-live-k8s-visualizer.git```
* ```kubecfg proxy --www=path/to/gcp-live-k8s-visualizer```
* ```git clone https://github.com/saturnism/gcp-live-k8s-visualizer.git```
* ```kubectl proxy --www=path/to/gcp-live-k8s-visualizer```

That's it. The visualizer uses labels to organize the visualization. In particular it expects that

* pods, replicationcontrollers, and services have a ```name``` label, and pods and their associated replication controller share the same ```name```, and
* the pods in your cluster will have a ```uses``` label which contains a comma separated list of services that the pod uses.

### Installation on AWS:

* First install a Kubernetes Cluster
* On EC2 instance running the client (kubectl), install a proxy. We will be using HAProxy listening on port 80 for this guide.
* ```sudo wget http://www.haproxy.org/download/1.6/src/haproxy-1.6.3.tar.gz```
* ```sudo tar -xvf haproxy-1.6.3.tar.gz```
* ```cd ./haproxy-1.6.3```
* ```sudo make TARGET=linux2628 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1```
* Create the following configuration file in /etc/haproxy.cfg:

```
global
daemon
maxconn 256

defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms

frontend http-in
bind :80
default_backend proxy-backend


backend proxy-backend
server proxy 127.0.0.1:8001
```

* Startup the proxy:
```
sudo ./haproxy -f /etc/haproxy.cfg
```
* Startup kubernetes proxy by doing the following:
* Get api server location, username, and password from kubernetes:
```
kubectl config view
```
* Create kubernetes proxy:
```
kubectl proxy --www=path/to/k-visualizer/gcp-live-k8s-visualizer --username=admin --password=<password> --accept-hosts="" --server="<server>" &
```
* Access visualizer via Public IP of EC2 instance on which you created it:
```
http://<public ip>/static/
```
2 changes: 2 additions & 0 deletions examples/nginx.controller.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"metadata":{
"name":"nginx",
"labels":{
"visualize":"true",
"name":"nginx"
}
},
Expand All @@ -15,6 +16,7 @@
"template":{
"metadata":{
"labels":{
"visualize":"true",
"name":"nginx",
"app": "sample",
"version": "0.0.1",
Expand Down
3 changes: 2 additions & 1 deletion examples/nginx.service.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"metadata": {
"name": "nginx",
"labels": {
"visualize":"true",
"name": "nginx",
"app": "sample"
}
Expand All @@ -25,4 +26,4 @@
"name": "frontend"
}
}
}
}
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<div class="navbar-logo">
<img src="logotext.svg" id="nav-logo-img" alt="logo">
</div>
</div>
<div class="nodesbar">
</div>
<div class="demo flowchart-demo" id="sheet">
</div>
Expand Down
22 changes: 10 additions & 12 deletions jsplumb/jsplumb.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,25 +130,23 @@ body {
}

#main {
margin-top: 106px;
position: absolute;
font-size: 80%;
width: 80%;
margin-left:auto;
margin-right: auto;
height: 600px;
text-align: center;
position: relative;
max-width: 1200px;
max-height: 1000px;
top: 0;
left: 0;
bottom: 0;
right: 0;
}

.demo {
position: relative;
width:100%;
position: absolute;
top: 200px;
left: 0;
right: 0;
bottom: 0;
background-color:white;
overflow:auto;
margin-bottom:25px;
height: 600px;
}

.explanation {
Expand Down
Loading