Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Created by .ignore support plugin (hsz.mobi)
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM akkerman/rpi-nginx
RUN apt-get update && apt-get install -y \
wget \
curl \
dnsutils
COPY jquery*.js script.js style.css logotext.svg index.html /usr/share/nginx/html/
COPY jsplumb/* /usr/share/nginx/html/jsplumb/
COPY nginx.conf /etc/nginx/
8 changes: 8 additions & 0 deletions Dockerfile-x86
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM nginx:stable
RUN apt-get update && apt-get install -y \
wget \
curl \
dnsutils
COPY jquery*.js script.js style.css logotext.svg index.html /usr/share/nginx/html/
COPY jsplumb/* /usr/share/nginx/html/jsplumb/
COPY nginx.conf /etc/nginx/
48 changes: 48 additions & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,51 @@ That's it. The visualizer uses labels to organize the visualization. In partic

* 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
1 change: 1 addition & 0 deletions 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 Down
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
-->
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script src="jquery-1.9.0.min.js"></script>
<script src="jquery-ui-1.9.2.min.js"></script>
<script src="jsplumb/jquery.jsPlumb-1.6.4.js"></script>
<link rel="stylesheet" href="jsplumb/jsplumb.css">
<link rel="stylesheet" href="jsplumb/flowchart-style.css">

<script src="script.js"></script>
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image/png" href="kubernetes-logo.png">
</head>
<body>
<div id="main">
Expand Down
4 changes: 4 additions & 0 deletions jquery-1.9.0.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions jquery-ui-1.9.2.min.js

Large diffs are not rendered by default.

Binary file added kubernetes-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions nginx-dev.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
worker_processes 1;

events { worker_connections 1024; }

http {
include mime.types;
index index.html index.htm index.php;
sendfile on;

gzip on;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_types text/plain text/xml text/css
text/comma-separated-values
text/javascript
application/x-javascript
application/atom+xml;

# List of application servers
upstream backend {
server 10.150.42.191:8080;
}

# Configuration for the server
server {

# Running port
listen 80;

root /usr/share/nginx/html;
access_log /var/log/nginx/localhost.access.log;

# Proxying the connections connections
location /api {
proxy_pass http://backend;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;

}
}
}
46 changes: 46 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
worker_processes 1;

events { worker_connections 1024; }

http {
include mime.types;
index index.html index.htm index.php;
sendfile on;

gzip on;
gzip_http_version 1.0;
gzip_proxied any;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.";
gzip_types text/plain text/xml text/css
text/comma-separated-values
text/javascript
application/x-javascript
application/atom+xml;

# List of application servers
upstream backend {
server 172.20.10.4:8002;
}

# Configuration for the server
server {

# Running port
listen 80;

root /usr/share/nginx/html;
access_log /var/log/nginx/localhost.access.log;

# Proxying the connections connections
location /api {
proxy_pass http://backend;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;

}
}
}
Loading