From a0387fce443b8a838645b563392bf836ea31b0af Mon Sep 17 00:00:00 2001 From: Firmlyzhu Date: Sun, 16 Jul 2017 12:24:58 +0800 Subject: [PATCH] remove proxy & fix some bugs on config.html --- prepare.sh | 7 +++++-- src/vclustermgr.py | 1 + web/templates/config.html | 35 +++-------------------------------- web/web.py | 8 ++++---- 4 files changed, 13 insertions(+), 38 deletions(-) diff --git a/prepare.sh b/prepare.sh index 6e2bd99..e8cf36d 100755 --- a/prepare.sh +++ b/prepare.sh @@ -14,7 +14,7 @@ fi # install packages that docklet needs (in ubuntu) # some packages' name maybe different in debian -apt-get install -y cgmanager lxc lxcfs lxc-templates lvm2 bridge-utils curl exim4 openssh-server openvswitch-switch +apt-get install -y cgmanager lxc lxcfs lxc-templates lvm2 bridge-utils curl exim4 openssh-server openvswitch-switch apt-get install -y python3 python3-netifaces python3-flask python3-flask-sqlalchemy python3-pampy python3-httplib2 apt-get install -y python3-psutil apt-get install -y python3-lxc @@ -24,6 +24,10 @@ apt-get install -y etcd apt-get install -y glusterfs-client apt-get install -y nginx +#add ip forward +echo "net.ipv4.ip_forward=1" >>/etc/sysctl.conf +sysctl -p + # check cgroup control which cgm &> /dev/null || { echo "FAILED : cgmanager is required, please install cgmanager" && exit 1; } cpucontrol=$(cgm listkeys cpu) @@ -75,4 +79,3 @@ echo "" echo "Then start docklet as described in README.md" - diff --git a/src/vclustermgr.py b/src/vclustermgr.py index 402746c..8383e37 100755 --- a/src/vclustermgr.py +++ b/src/vclustermgr.py @@ -161,6 +161,7 @@ class VclusterMgr(object): info['proxy_url'] = proxy_url info['proxy_server_ip'] = proxy_server_ip info['proxy_public_ip'] = proxy_public_ip + info['port_mapping'] = [] clusterfile.write(json.dumps(info)) clusterfile.close() return [True, info] diff --git a/web/templates/config.html b/web/templates/config.html index bbc6956..36ff9de 100755 --- a/web/templates/config.html +++ b/web/templates/config.html @@ -44,7 +44,7 @@ - - - -
-
-
-
-

SERVICE

-
{{ clusterinfo['proxy_url'] }}
- -
- - -
-
-
-
- {% if 'proxy_ip' in clusterinfo %} -

ip:port: - -

- {% else %} -

ip:port: - -

- {% endif %} -
-
-
-
+
@@ -330,6 +300,7 @@
+ diff --git a/web/web.py b/web/web.py index 6c496d0..e52b52d 100755 --- a/web/web.py +++ b/web/web.py @@ -212,21 +212,21 @@ def saveImage_force(clustername,containername,masterip): saveImageView.description = request.form['description'] return saveImageView.as_view() -@app.route("/addproxy///", methods=['POST']) +'''@app.route("/addproxy///", methods=['POST']) @login_required def addproxy(clustername,masterip): addproxyView.clustername = clustername addproxyView.masterip = masterip addproxyView.ip = request.form['proxy_ip'] addproxyView.port = request.form['proxy_port'] - return addproxyView.as_view() + return addproxyView.as_view()''' -@app.route("/deleteproxy///", methods=['GET']) +'''@app.route("/deleteproxy///", methods=['GET']) @login_required def deleteproxy(clustername,masterip): deleteproxyView.clustername = clustername deleteproxyView.masterip = masterip - return deleteproxyView.as_view() + return deleteproxyView.as_view()''' @app.route("/port_mapping/add//", methods=['POST']) @login_required