From 450227104ad100d492ad144b08838e8d8d42422d Mon Sep 17 00:00:00 2001 From: ysicing Date: Tue, 16 Oct 2018 10:01:05 +0800 Subject: [PATCH] [REV] Component memory is not restricted --- install/salt/install/files/conf/all.yaml | 13 ------------- install/salt/install/files/conf/monitor.yaml | 2 -- install/salt/install/files/init/bin/grclis | 9 +++++++-- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/install/salt/install/files/conf/all.yaml b/install/salt/install/files/conf/all.yaml index a362541..388992a 100644 --- a/install/salt/install/files/conf/all.yaml +++ b/install/salt/install/files/conf/all.yaml @@ -18,7 +18,6 @@ services: start: >- docker run --name rbd-hub --network host - --memory 1024M -v /grdata/services/registry/:/var/lib/registry -i {{ pillar['private-image-domain'] }}/{{ pillar['rainbond-modules']['rbd-registry']['image'] }}:{{ pillar['rainbond-modules']['rbd-registry']['version'] }} stop: docker stop rbd-hub @@ -63,7 +62,6 @@ services: start: >- docker run --name rbd-entrance --network host - --memory 1024M -e DEFAULT_HTTP_PORT=80 -e DEFAULT_HTTPS_PORT=443 -v {{ pillar['rbd-path'] }}/etc/kubernetes/kubecfg:/opt/rainbond/etc/kubernetes/kubecfg @@ -94,7 +92,6 @@ services: start: >- docker run --name rbd-api --network host - --memory 1024M -e LicenseSwitch="off" -e EX_DOMAIN={{ pillar['domain'] }} -v /grdata:/grdata @@ -133,7 +130,6 @@ services: start: >- docker run --name rbd-chaos --network host - --memory 2048M -e SOURCE_DIR="/cache/source" -e CACHE_DIR="/cache" -v /logs:/logs @@ -163,7 +159,6 @@ services: start: >- docker run --name rbd-mq --network host - --memory 1024M -i {{ pillar['private-image-domain'] }}/{{ pillar['rainbond-modules']['rbd-mq']['image'] }}:{{ pillar['rainbond-modules']['rbd-mq']['version'] }} --log-level=debug --etcd-endpoints=${ETCD_ENDPOINTS} stop: docker stop rbd-mq @@ -186,7 +181,6 @@ services: start: >- docker run --name rbd-webcli --network host - --memory 1024M -v /usr/local/bin/kubectl:/usr/bin/kubectl -v /root/.kube:/root/.kube -i {{ pillar['private-image-domain'] }}/{{ pillar['rainbond-modules']['rbd-webcli']['image'] }}:{{ pillar['rainbond-modules']['rbd-webcli']['version'] }} @@ -211,7 +205,6 @@ services: start: >- docker run --name rbd-worker --network host - --memory 1024M -e K8S_MASTER=http://127.0.0.1:8181 -e CUR_NET=calico -e EX_DOMAIN={{ pillar['domain'] }} @@ -242,7 +235,6 @@ services: start: >- docker run --name rbd-monitor --network host - --memory 2048M -v {{ pillar['rbd-path'] }}/data/prom:/prometheusdata -i {{ pillar['private-image-domain'] }}/{{ pillar['rainbond-modules']['rbd-monitor']['image'] }}:{{ pillar['rainbond-modules']['rbd-monitor']['version'] }} --etcd-endpoints=${ETCD_ENDPOINTS} --advertise-addr={{ grains['mip'][0] }}:9999 --web.listen-address=0.0.0.0:9999 --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/prometheusdata --storage.tsdb.no-lockfile --storage.tsdb.retention=7d --log.level=info @@ -266,7 +258,6 @@ services: start: >- docker run --name rbd-eventlog --network host - --memory 1024M -e K8S_MASTER=http://127.0.0.1:8181 -v {{ pillar['rbd-path'] }}/logs/rbd-eventlog:/var/log -v {{ pillar['rbd-path'] }}/etc/rbd-node/node_host_uuid.conf:/opt/rainbond/etc/node/node_host_uuid.conf @@ -293,7 +284,6 @@ services: start: >- docker run --name rbd-app-ui --network host - --memory 1024M -e MANAGE_SECRET_KEY={{ pillar['secretkey'] }} -e MYSQL_HOST={{ pillar['database']['mysql']['host'] }} -e MYSQL_PORT={{ pillar['database']['mysql']['port'] }} @@ -453,7 +443,6 @@ services: start: >- docker run --name rbd-db --network host - --memory 1024M -e MYSQL_ALLOW_EMPTY_PASSWORD="true" -v {{ pillar['rbd-path'] }}/data/rbd-db:/data -v {{ pillar['rbd-path'] }}/etc/rbd-db:/etc/mysql @@ -675,7 +664,6 @@ services: start: >- docker run --name rbd-lb --network host - --memory 1024M -e HTTP_SUFFIX_URL={{ pillar['domain'] }} -e DEFAULT_PORT=80 -v {{ pillar['rbd-path'] }}/etc/rbd-lb/dynamics:/usr/local/openresty/nginx/conf/dynamics @@ -730,7 +718,6 @@ services: start: >- docker run --name rbd-dns --network host - --memory 1024M -e VERBOSE=true -v {{ pillar['rbd-path'] }}/etc/kubernetes/kubecfg:/opt/rainbond/etc/kubernetes/kubecfg -i {{ pillar['private-image-domain'] }}/{{ pillar['rainbond-modules']['rbd-dns']['image'] }}:{{ pillar['rainbond-modules']['rbd-dns']['version'] }} diff --git a/install/salt/install/files/conf/monitor.yaml b/install/salt/install/files/conf/monitor.yaml index 24f522a..2788193 100644 --- a/install/salt/install/files/conf/monitor.yaml +++ b/install/salt/install/files/conf/monitor.yaml @@ -16,7 +16,6 @@ docker run --name rbd-grafana --network host - --memory 1024M --user 0 -e GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource -e GF_SECURITY_ADMIN_PASSWORD={{ pillar['secretkey'] }} @@ -39,7 +38,6 @@ docker run --name rbd-alert --network host - --memory 1024M -v {{ pillar['rbd-path'] }}/etc/rbd-monitor:/etc/alertmanager -i goodrain.me/rbd-alert:{{ pillar['rainbond-modules']['rbd-alert']['version'] }} stop: docker stop rbd-alert diff --git a/install/salt/install/files/init/bin/grclis b/install/salt/install/files/init/bin/grclis index 888c07e..7ec4b14 100644 --- a/install/salt/install/files/init/bin/grclis +++ b/install/salt/install/files/init/bin/grclis @@ -75,14 +75,19 @@ reset(){ rm -rf /srv/ echo "remove /opt/rainbond " rm -rf /opt/rainbond/ + echo "rm /grdata" + df -h | grep grdata >/dev/null + [ "$?" -eq 0 ] && ( + umount /grdata + #num=$(cat -n /etc/fstab | grep grdata | awk '{print $1}') + sed -i '/grdata/d' /etc/fstab + ) echo "disable & remove systemd" for service in ${ALL_SERVICES[@]} do [ -f "/etc/systemd/system/$service.service" ] && ( systemctl disable $service [ "$?" -eq 0 ] && rm -rf /etc/systemd/system/$service.service - ) || ( - echo "not found $service service" ) done }