From b48cc8ffe9f5a8b87d2ba95394f1627ec78327a1 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 18 Feb 2019 18:37:58 +0800 Subject: [PATCH] add initial script for rancher-server --- 3party/teamcity-agent/Dockerfile | 2 + SETUP.md | 2 +- site/README.md | 4 + site/docker-compose.yml | 48 ++++++++++ site/install-rancher.sh | 8 ++ site/prod/TML-KHHW/docker-compose.yml | 57 +++++++++++ site/prod/TML-KHHW/rancher-compose.yml | 83 ++++++++++++++++ site/prod/TML-TXGW/docker-compose.yml | 57 +++++++++++ site/prod/TML-TXGW/rancher-compose.yml | 82 ++++++++++++++++ site/prod/create-stacks.sh | 6 ++ .../uat/Management-Backend/docker-compose.yml | 73 ++++++++++++++ .../Management-Backend/rancher-compose.yml | 94 +++++++++++++++++++ site/uat/TML-TXGW/docker-compose.yml | 43 +++++++++ site/uat/TML-TXGW/rancher-compose.yml | 34 +++++++ site/uat/WHL-KHHW/docker-compose.yml | 47 ++++++++++ site/uat/WHL-KHHW/rancher-compose.yml | 34 +++++++ site/uat/create-stacks.sh | 15 +++ 17 files changed, 688 insertions(+), 1 deletion(-) create mode 100644 3party/teamcity-agent/Dockerfile create mode 100644 site/README.md create mode 100644 site/docker-compose.yml create mode 100644 site/install-rancher.sh create mode 100644 site/prod/TML-KHHW/docker-compose.yml create mode 100644 site/prod/TML-KHHW/rancher-compose.yml create mode 100644 site/prod/TML-TXGW/docker-compose.yml create mode 100644 site/prod/TML-TXGW/rancher-compose.yml create mode 100644 site/prod/create-stacks.sh create mode 100644 site/uat/Management-Backend/docker-compose.yml create mode 100644 site/uat/Management-Backend/rancher-compose.yml create mode 100644 site/uat/TML-TXGW/docker-compose.yml create mode 100644 site/uat/TML-TXGW/rancher-compose.yml create mode 100644 site/uat/WHL-KHHW/docker-compose.yml create mode 100644 site/uat/WHL-KHHW/rancher-compose.yml create mode 100644 site/uat/create-stacks.sh diff --git a/3party/teamcity-agent/Dockerfile b/3party/teamcity-agent/Dockerfile new file mode 100644 index 0000000..3a9e648 --- /dev/null +++ b/3party/teamcity-agent/Dockerfile @@ -0,0 +1,2 @@ +FROM jetbrains/teamcity-agent:latest +RUN curl -LkSs https://github.com/rancher/cli/releases/download/v0.6.11/rancher-linux-amd64-v0.6.11.tar.gz | tar -xz && mv -f ./rancher-v0.6.11/rancher /bin/rancher && rm -rf ./rancher-v0.6.11 \ No newline at end of file diff --git a/SETUP.md b/SETUP.md index eba4887..b39ad6f 100644 --- a/SETUP.md +++ b/SETUP.md @@ -35,7 +35,7 @@ Redhat RHEL 7 ### 安裝Rancher CLI ```bash -curl -LkSs https://github.com/rancher/cli/releases/download/v0.6.11/rancher-linux-amd64-v0.6.11.tar.gz | tar -xz && mv ./rancher-v0.6.11/rancher /bin/rancher && rm -rf ./rancher-v0.6.11 +curl -LkSs https://github.com/rancher/cli/releases/download/v0.6.11/rancher-linux-amd64-v0.6.11.tar.gz | tar -xz && mv -f ./rancher-v0.6.11/rancher /bin/rancher && rm -rf ./rancher-v0.6.11 ``` ### 由Private register移除Docker Image (未驗證) diff --git a/site/README.md b/site/README.md new file mode 100644 index 0000000..a251f50 --- /dev/null +++ b/site/README.md @@ -0,0 +1,4 @@ + +1. Create Stacks +2. Add Hosts +3. Add Registry \ No newline at end of file diff --git a/site/docker-compose.yml b/site/docker-compose.yml new file mode 100644 index 0000000..945c83b --- /dev/null +++ b/site/docker-compose.yml @@ -0,0 +1,48 @@ +version: '3' +services: + mysql: + container_name: mysql + image: "mysql:5.7" + restart: unless-stopped + environment: + MYSQL_ROOT_PASSWORD: example + MYSQL_USER: cattle + MYSQL_PASSWORD: cattle + MYSQL_DATABASE: cattle + volumes: + - /docker/mysql:/var/lib/mysql + mysql-admin: + container_name: mysql-admin + image: "phpmyadmin/phpmyadmin" + restart: unless-stopped + ports: + - 8222:80 + environment: + PMA_HOST: db + PMA_PORT: 3306 + depends_on: + - "mysql" + links: + - mysql:db + fluent-log: + container_name: fluent-log + image: "fluent/fluentd" + ports: + - 24224:24224 + - 24224:24224/udp + volumes: + - /docker/log:/fluentd/log + rancher-server: + container_name: rancher-server + image: "rancher/server" + restart: unless-stopped + command: --db-host db + depends_on: + - "mysql" + ports: + - 8888:8080 + environment: + DB_HOST: db + links: + - mysql:db + diff --git a/site/install-rancher.sh b/site/install-rancher.sh new file mode 100644 index 0000000..85d6e83 --- /dev/null +++ b/site/install-rancher.sh @@ -0,0 +1,8 @@ +export RANCHER_URL=http://localhost:8888 +#Create necessary folders for volume mounting +mkdir -p -m 777 /docker/mysql +mkdir -p -m 777 /docker/log +chmod -R 777 /docker/* +# install rancher cli +curl -LkSs https://github.com/rancher/cli/releases/download/v0.6.11/rancher-linux-amd64-v0.6.11.tar.gz | tar -xz && mv -f ./rancher-v0.6.11/rancher /bin/rancher && rm -rf ./rancher-v0.6.11 +docker-compose up -d \ No newline at end of file diff --git a/site/prod/TML-KHHW/docker-compose.yml b/site/prod/TML-KHHW/docker-compose.yml new file mode 100644 index 0000000..d1785ad --- /dev/null +++ b/site/prod/TML-KHHW/docker-compose.yml @@ -0,0 +1,57 @@ +version: '2' +services: + TML-WS: + image: khhwtml02t.wanhai.com:8182/wanhai/tml/khhw/uat/tml-ws:latest + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=khhw + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + LB: + image: rancher/lb-service-haproxy:v0.9.3 + ports: + - 80:80/tcp + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=khhw,com.wanhai.tml.lb_host=true + io.rancher.container.agent.role: environmentAdmin,agent + io.rancher.container.agent_service.drain_provider: 'true' + io.rancher.container.create_agent: 'true' + TML-CY: + mem_limit: 1073741824 + image: khhwtml02t.wanhai.com:8182/wanhai/tml/khhw/prod/tml-cy:latest + environment: + JAVA_OPTS: -Xms1024m -Xmx1024m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dcom.wanhai.tml.yard.current=khhw -Dcom.wanhai.tml.config.env=uat -Dsentry.dsn=http://d5756310a31a47909989df81461b1da1:bfb176b900fb498c8e3b60d31d12c23f@khhwtml02t.wanhai.com:9000/2 -Dsentry.stacktrace.app.packages=com.wanhai.tml -Dsentry.release=0.1.0 -Dsentry.environment=uat + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=khhw + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + TML-MENU: + mem_limit: 805306368 + image: khhwtml02t.wanhai.com:8182/wanhai/tml/khhw/prod/tml-menu:latest + environment: + JAVA_OPTS: -Xms512m -Xmx750m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -XX:+UseG1GC -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dcom.wanhai.tml.yard.current=khhw -Dcom.wanhai.tml.config.env=uat -Dsentry.dsn=http://d5756310a31a47909989df81461b1da1:bfb176b900fb498c8e3b60d31d12c23f@khhwtml02t.wanhai.com:9000/2 -Dsentry.stacktrace.app.packages=com.wanhai.tml -Dsentry.release=0.1.0 -Dsentry.environment=uat + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=khhw + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + TML-STATIC: + image: khhwtml02t.wanhai.com:8182/wanhai/tml/khhw/uat/tml-static:latest + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=khhw + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + OTT: + image: khhwtml02t.wanhai.com:8182/wanhai/tml/khhw/uat/ott:latest + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=khhw + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always diff --git a/site/prod/TML-KHHW/rancher-compose.yml b/site/prod/TML-KHHW/rancher-compose.yml new file mode 100644 index 0000000..f9e0baf --- /dev/null +++ b/site/prod/TML-KHHW/rancher-compose.yml @@ -0,0 +1,83 @@ +version: '2' +services: + TML-WS: + scale: 1 + start_on_create: true + LB: + scale: 2 + start_on_create: true + lb_config: + certs: [] + config: "defaults\noption forwardfor\n\nlisten stats \nbind 0.0.0.0:9123\nmode\ + \ http\nstats enable\nstats hide-version\nstats realm Haproxy\\ Statistics\n\ + stats uri /haproxy_stats" + port_rules: + - hostname: khhwtml.wanhai.com + path: /collab/ott + priority: 1 + protocol: http + service: OTT + source_port: 80 + target_port: 8080 + - hostname: khhwtml.wanhai.com + path: /wanhai/tml/static + priority: 2 + protocol: http + service: TML-STATIC + source_port: 80 + target_port: 8080 + - hostname: khhwtml.wanhai.com + path: /wanhai/tml/menu + priority: 3 + protocol: http + service: TML-MENU + source_port: 80 + target_port: 8080 + - hostname: khhwtml.wanhai.com + path: /wanhai/tml/cy + priority: 4 + protocol: http + service: TML-CY + source_port: 80 + target_port: 8080 + - hostname: khhwtml.wanhai.com + path: /wanhai/tml/services + priority: 5 + protocol: http + service: TML-WS + source_port: 80 + target_port: 8080 + - hostname: khhwtml.wanhai.com + path: /haproxy_stats + priority: 6 + protocol: http + service: LB + source_port: 80 + target_port: 9123 + stickiness_policy: + cookie: JSESSIONID + indirect: true + mode: prefix + nocache: true + postonly: false + health_check: + healthy_threshold: 2 + response_timeout: 2000 + port: 42 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 2000 + reinitializing_timeout: 60000 + TML-CY: + scale: 2 + start_on_create: true + TML-MENU: + retain_ip: true + scale: 1 + start_on_create: true + TML-STATIC: + scale: 1 + start_on_create: true + OTT: + scale: 1 + start_on_create: true diff --git a/site/prod/TML-TXGW/docker-compose.yml b/site/prod/TML-TXGW/docker-compose.yml new file mode 100644 index 0000000..c49633c --- /dev/null +++ b/site/prod/TML-TXGW/docker-compose.yml @@ -0,0 +1,57 @@ +version: '2' +services: + TML-WS: + image: khhwtml02t.wanhai.com:8182/wanhai/tml/txgw/uat/tml-ws:latest + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=txgw + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + LB: + image: rancher/lb-service-haproxy:v0.9.3 + ports: + - 80:80/tcp + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=txgw,com.wanhai.tml.lb_host=true + io.rancher.container.agent.role: environmentAdmin,agent + io.rancher.container.agent_service.drain_provider: 'true' + io.rancher.container.create_agent: 'true' + TML-CY: + mem_limit: 1073741824 + image: khhwtml02t.wanhai.com:8182/wanhai/tml/txgw/prod/tml-cy:latest + environment: + JAVA_OPTS: -Xms1024m -Xmx1024m -XX:MetaspaceSize=96M -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxMetaspaceSize=256m -XX:+UseG1GC -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dcom.wanhai.tml.yard.current=txgw -Dcom.wanhai.tml.config.env=uat -Dsentry.dsn=http://d5756310a31a47909989df81461b1da1:bfb176b900fb498c8e3b60d31d12c23f@khhwtml02t.wanhai.com:9000/2 -Dsentry.stacktrace.app.packages=com.wanhai.tml -Dsentry.release=0.1.0 -Dsentry.environment=uat + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=txgw + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + TML-MENU: + mem_limit: 805306368 + image: khhwtml02t.wanhai.com:8182/wanhai/tml/txgw/prod/tml-menu:latest + environment: + JAVA_OPTS: -Xms512m -Xmx750m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -XX:+UseG1GC -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dcom.wanhai.tml.yard.current=txgw -Dcom.wanhai.tml.config.env=uat -Dsentry.dsn=http://d5756310a31a47909989df81461b1da1:bfb176b900fb498c8e3b60d31d12c23f@khhwtml02t.wanhai.com:9000/2 -Dsentry.stacktrace.app.packages=com.wanhai.tml -Dsentry.release=0.1.0 -Dsentry.environment=uat + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=txgw + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + TML-STATIC: + image: khhwtml02t.wanhai.com:8182/wanhai/tml/txgw/uat/tml-static:latest + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=txgw + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + OTT: + image: khhwtml02t.wanhai.com:8182/wanhai/tml/txgw/uat/ott:latest + stdin_open: true + tty: true + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.env=txgw + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always diff --git a/site/prod/TML-TXGW/rancher-compose.yml b/site/prod/TML-TXGW/rancher-compose.yml new file mode 100644 index 0000000..37969f6 --- /dev/null +++ b/site/prod/TML-TXGW/rancher-compose.yml @@ -0,0 +1,82 @@ +version: '2' +services: + TML-WS: + scale: 1 + start_on_create: true + LB: + scale: 2 + start_on_create: true + lb_config: + certs: [] + config: "defaults\noption forwardfor\n\nlisten stats \nbind 0.0.0.0:9123\nmode\ + \ http\nstats enable\nstats hide-version\nstats realm Haproxy\\ Statistics\n\ + stats uri /haproxy_stats" + port_rules: + - hostname: txgwtml.wanhai.com + path: /collab/ott + priority: 1 + protocol: http + service: OTT + source_port: 80 + target_port: 8080 + - hostname: txgwtml.wanhai.com + path: /wanhai/tml/static + priority: 2 + protocol: http + service: TML-STATIC + source_port: 80 + target_port: 8080 + - hostname: txgwtml.wanhai.com + path: /wanhai/tml/menu + priority: 3 + protocol: http + service: TML-MENU + source_port: 80 + target_port: 8080 + - hostname: txgwtml.wanhai.com + path: /wanhai/tml/cy + priority: 4 + protocol: http + service: TML-CY + source_port: 80 + target_port: 8080 + - hostname: txgwtml.wanhai.com + path: /wanhai/tml/services + priority: 5 + protocol: http + service: TML-WS + source_port: 80 + target_port: 8080 + - hostname: txgwtml.wanhai.com + path: /haproxy_stats + priority: 7 + protocol: http + service: LB + source_port: 80 + target_port: 9123 + stickiness_policy: + cookie: JSESSIONID + indirect: true + mode: prefix + nocache: true + postonly: false + health_check: + healthy_threshold: 2 + response_timeout: 2000 + port: 42 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 2000 + reinitializing_timeout: 60000 + TML-CY: + scale: 2 + start_on_create: true + TML-MENU: + scale: 1 + start_on_create: true + TML-STATIC: + scale: 1 + start_on_create: true + OTT: + scale: 1 + start_on_create: false diff --git a/site/prod/create-stacks.sh b/site/prod/create-stacks.sh new file mode 100644 index 0000000..b44af15 --- /dev/null +++ b/site/prod/create-stacks.sh @@ -0,0 +1,6 @@ +export RANCHER_URL=http://localhost:8888 +#Create Rancher Environment +rancher env create PROD +#Create Application Stacks +rancher --wait-state active --env PROD stack create TML-KHHW -f ./WHL-KHHW/docker-compose.yml -r ./WHL-KHHW/rancher-compose.yml +rancher --wait-state active --env PROD stack create TML-TXGW -f ./WHL-TXGW/docker-compose.yml -r ./WHL-TXGW/rancher-compose.yml \ No newline at end of file diff --git a/site/uat/Management-Backend/docker-compose.yml b/site/uat/Management-Backend/docker-compose.yml new file mode 100644 index 0000000..3b525c1 --- /dev/null +++ b/site/uat/Management-Backend/docker-compose.yml @@ -0,0 +1,73 @@ +version: '2' +services: + Global-LB: + image: rancher/lb-service-haproxy:v0.9.6 + ports: + - 80:80/tcp + labels: + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.lb_host=true + io.rancher.container.agent.role: environmentAdmin,agent + io.rancher.container.agent_service.drain_provider: 'true' + io.rancher.container.create_agent: 'true' + TeamCity-Agent-Alpha: + privileged: true + image: khhwtml02t.wanhai.com:8182/jetbrains/teamcity-agent:latest + environment: + SERVER_URL: http://khhwtml02t.wanhai.com:8111 + AGENT_NAME: Agent-Alpha1 + RANCHER_URL: http://khhwtml01t.wanhai.com:8888 + RANCHER_ACCESS_KEY: 5E7731B2CB115A1B007C + RANCHER_SECRET_KEY: VR3DGmfivwHjMPxnhVL4QLv2VEYKcnUHDuTcoWgD + stdin_open: true + volumes: + - /var/run/docker.sock:/var/run/docker.sock + tty: true + labels: + io.rancher.container.pull_image: always + TeamCity-Agent-Beta: + privileged: true + image: khhwtml02t.wanhai.com:8182/jetbrains/teamcity-agent:latest + environment: + SERVER_URL: http://khhwtml02t.wanhai.com:8111 + AGENT_NAME: Agent-Beta1 + RANCHER_URL: http://khhwtml01t.wanhai.com:8888 + RANCHER_ACCESS_KEY: 5E7731B2CB115A1B007C + RANCHER_SECRET_KEY: VR3DGmfivwHjMPxnhVL4QLv2VEYKcnUHDuTcoWgD + stdin_open: true + volumes: + - /var/run/docker.sock:/var/run/docker.sock + tty: true + labels: + io.rancher.container.pull_image: always + io.rancher.container.hostname_override: container_name + TML-Docker-Registry: + image: sonatype/nexus3:latest + environment: + TZ: Asia/Taipei + stdin_open: true + network_mode: bridge + volumes: + - /docker/nexus3/nexus-data:/nexus-data + tty: true + ports: + - 8181:8081 + - 8182:8182 + labels: + io.rancher.container.pull_image: always + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.main_host=true + io.rancher.container.hostname_override: container_name + TeamCity-Server: + image: jetbrains/teamcity-server:latest + environment: + TZ: Asia/Taipei + stdin_open: true + volumes: + - /docker/teamcity/data:/data/teamcity_server/datadir + - /docker/teamcity/logs:/opt/teamcity/logs + tty: true + ports: + - 8111:8111 + labels: + io.rancher.container.pull_image: always + io.rancher.scheduler.affinity:host_label: com.wanhai.tml.main_host=true + io.rancher.container.hostname_override: container_name diff --git a/site/uat/Management-Backend/rancher-compose.yml b/site/uat/Management-Backend/rancher-compose.yml new file mode 100644 index 0000000..1e76fad --- /dev/null +++ b/site/uat/Management-Backend/rancher-compose.yml @@ -0,0 +1,94 @@ +version: '2' +services: + Global-LB: + scale: 1 + start_on_create: false + lb_config: + certs: [] + config: "defaults\noption forwardfor\n\nlisten stats \nbind 0.0.0.0:9123\nmode\ + \ http\nstats enable\nstats hide-version\nstats realm Haproxy\\ Statistics\n\ + stats uri /haproxy_stats" + port_rules: + - hostname: khhwtml01t.wanhai.com + path: /collab/ott + priority: 1 + protocol: http + service: TML-KHHW/OTT + source_port: 80 + target_port: 8080 + - hostname: khhwtml01t.wanhai.com + path: /wanhai/tml/static + priority: 2 + protocol: http + service: TML-KHHW/TML-STATIC + source_port: 80 + target_port: 8080 + - hostname: khhwtml01t.wanhai.com + path: /wanhai/tml/menu + priority: 3 + protocol: http + service: TML-KHHW/TML-MENU + source_port: 80 + target_port: 8080 + - hostname: khhwtml01t.wanhai.com + path: /wanhai/tml/cy + priority: 4 + protocol: http + service: TML-KHHW/TML-CY + source_port: 80 + target_port: 8080 + - hostname: txgwtml01t.wanhai.com + path: /wanhai/tml/static + priority: 5 + protocol: http + service: TML-TXGW/TML-STATIC + source_port: 80 + target_port: 8080 + - hostname: txgwtml01t.wanhai.com + path: /collab/ott + priority: 6 + protocol: http + service: TML-TXGW/OTT + source_port: 80 + target_port: 8080 + - hostname: txgwtml01t.wanhai.com + path: /wanhai/tml/menu + priority: 7 + protocol: http + service: TML-TXGW/TML-MENU + source_port: 80 + target_port: 8080 + - hostname: txgwtml01t.wanhai.com + path: /wanhai/tml/cy + priority: 8 + protocol: http + service: TML-TXGW/TML-CY + source_port: 80 + target_port: 8080 + stickiness_policy: + cookie: JSESSIONID + domain: '' + indirect: true + mode: prefix + nocache: true + postonly: false + health_check: + healthy_threshold: 2 + response_timeout: 2000 + port: 42 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 2000 + reinitializing_timeout: 60000 + TeamCity-Agent-Alpha: + scale: 1 + start_on_create: false + TML-Docker-Registry: + scale: 1 + start_on_create: false + TeamCity-Agent-Beta: + scale: 1 + start_on_create: false + TeamCity-Server: + scale: 1 + start_on_create: false diff --git a/site/uat/TML-TXGW/docker-compose.yml b/site/uat/TML-TXGW/docker-compose.yml new file mode 100644 index 0000000..a048b58 --- /dev/null +++ b/site/uat/TML-TXGW/docker-compose.yml @@ -0,0 +1,43 @@ +version: '2' +services: + TML-CY: + mem_limit: 1073741824 + image: khhwtml02t.wanhai.com:8182/wanhai/tml/txgw/uat/tml-cy:latest + environment: + JAVA_OPTS: "-Xms1024m -Xmx1024m -XX:MetaspaceSize=96M -XX:+UnlockExperimentalVMOptions\ + \ -XX:+UseCGroupMemoryLimitForHeap -XX:MaxMetaspaceSize=256m -XX:+UseG1GC\ + \ -XX:NativeMemoryTracking=summary -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true\ + \ -Dcom.wanhai.tml.yard.current=txgw -Dcom.wanhai.tml.config.env=uat -Dsentry.dsn=http://d5756310a31a47909989df81461b1da1:bfb176b900fb498c8e3b60d31d12c23f@khhwtml02t.wanhai.com:9000/2\ + \ -Dsentry.stacktrace.app.packages=com.wanhai.tml -Dsentry.release=0.1.0 -Dsentry.environment=uat\ + \ \n-Dsentry.compression=true" + stdin_open: true + tty: true + labels: + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + io.rancher.scheduler.affinity:host_label_soft: com.wanhai.tml.env=* + TML-MENU: + mem_limit: 1073741824 + image: khhwtml02t.wanhai.com:8182/wanhai/tml/txgw/uat/tml-menu:latest + environment: + JAVA_OPTS: -Xms1024m -Xmx1024m -XX:MetaspaceSize=96M -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxMetaspaceSize=256m -XX:+UseG1GC -XX:NativeMemoryTracking=summary -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dcom.wanhai.tml.yard.current=txgw -Dcom.wanhai.tml.config.env=uat -Dsentry.dsn=http://d5756310a31a47909989df81461b1da1:bfb176b900fb498c8e3b60d31d12c23f@khhwtml02t.wanhai.com:9000/2 -Dsentry.stacktrace.app.packages=com.wanhai.tml -Dsentry.release=0.1.0 -Dsentry.environment=uat + stdin_open: true + tty: true + labels: + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + io.rancher.scheduler.affinity:host_label_soft: com.wanhai.tml.env=* + TML-STATIC: + image: khhwtml02t.wanhai.com:8182/wanhai/tml/txgw/uat/tml-static:latest + stdin_open: true + tty: true + labels: + io.rancher.container.pull_image: always + io.rancher.container.hostname_override: container_name + OTT: + image: khhwtml02t.wanhai.com:8182/wanhai/tml/txgw/uat/ott:latest + stdin_open: true + tty: true + labels: + io.rancher.container.pull_image: always + io.rancher.container.hostname_override: container_name diff --git a/site/uat/TML-TXGW/rancher-compose.yml b/site/uat/TML-TXGW/rancher-compose.yml new file mode 100644 index 0000000..caebd97 --- /dev/null +++ b/site/uat/TML-TXGW/rancher-compose.yml @@ -0,0 +1,34 @@ +version: '2' +services: + TML-CY: + scale: 1 + start_on_create: false + health_check: + healthy_threshold: 2 + response_timeout: 5000 + port: 8080 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 30000 + strategy: recreate + request_line: GET "/" "HTTP/1.0" + reinitializing_timeout: 60000 + TML-MENU: + scale: 1 + start_on_create: false + health_check: + healthy_threshold: 2 + response_timeout: 5000 + port: 8080 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 30000 + strategy: recreate + request_line: GET "/" "HTTP/1.0" + reinitializing_timeout: 60000 + TML-STATIC: + scale: 1 + start_on_create: false + OTT: + scale: 1 + start_on_create: false diff --git a/site/uat/WHL-KHHW/docker-compose.yml b/site/uat/WHL-KHHW/docker-compose.yml new file mode 100644 index 0000000..805f17d --- /dev/null +++ b/site/uat/WHL-KHHW/docker-compose.yml @@ -0,0 +1,47 @@ +version: '2' +services: + TML-CY: + mem_limit: 1073741824 + image: khhwtml02t.wanhai.com:8182/wanhai/tml/khhw/uat/tml-cy:latest + environment: + JAVA_OPTS: "-Xms1024m -Xmx1024m -XX:MetaspaceSize=96M -XX:+UnlockExperimentalVMOptions\ + \ -XX:+UseCGroupMemoryLimitForHeap -XX:MaxMetaspaceSize=256m -XX:+UseG1GC\ + \ -XX:NativeMemoryTracking=summary -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true\ + \ -Dcom.wanhai.tml.yard.current=khhw \n-Dcom.wanhai.tml.config.env=uat -Dsentry.dsn=http://d5756310a31a47909989df81461b1da1:bfb176b900fb498c8e3b60d31d12c23f@khhwtml02t.wanhai.com:9000/2\ + \ -Dsentry.stacktrace.app.packages=com.wanhai.tml -Dsentry.release=0.1.0 -Dsentry.environment=uat\ + \ \n-Dsentry.compression=true" + stdin_open: true + tty: true + labels: + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + io.rancher.scheduler.affinity:host_label_soft: com.wanhai.tml.env=* + TML-MENU: + mem_limit: 1073741824 + image: khhwtml02t.wanhai.com:8182/wanhai/tml/khhw/uat/tml-menu:latest + environment: + JAVA_OPTS: "-Xms1024m -Xmx1024m -XX:MetaspaceSize=96M -XX:+UnlockExperimentalVMOptions\ + \ -XX:+UseCGroupMemoryLimitForHeap -XX:MaxMetaspaceSize=256m -XX:+UseG1GC\ + \ -XX:NativeMemoryTracking=summary -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true\ + \ -Dcom.wanhai.tml.yard.current=khhw \n-Dcom.wanhai.tml.config.env=uat -Dsentry.dsn=http://d5756310a31a47909989df81461b1da1:bfb176b900fb498c8e3b60d31d12c23f@khhwtml02t.wanhai.com:9000/2\ + \ -Dsentry.stacktrace.app.packages=com.wanhai.tml -Dsentry.release=0.1.0 -Dsentry.environment=uat" + stdin_open: true + tty: true + labels: + io.rancher.container.hostname_override: container_name + io.rancher.container.pull_image: always + io.rancher.scheduler.affinity:host_label_soft: com.wanhai.tml.env=* + TML-STATIC: + image: khhwtml02t.wanhai.com:8182/wanhai/tml/khhw/uat/tml-static:latest + stdin_open: true + tty: true + labels: + io.rancher.container.pull_image: always + io.rancher.container.hostname_override: container_name + OTT: + image: khhwtml02t.wanhai.com:8182/wanhai/tml/khhw/uat/ott:latest + stdin_open: true + tty: true + labels: + io.rancher.container.pull_image: always + io.rancher.container.hostname_override: container_name diff --git a/site/uat/WHL-KHHW/rancher-compose.yml b/site/uat/WHL-KHHW/rancher-compose.yml new file mode 100644 index 0000000..caebd97 --- /dev/null +++ b/site/uat/WHL-KHHW/rancher-compose.yml @@ -0,0 +1,34 @@ +version: '2' +services: + TML-CY: + scale: 1 + start_on_create: false + health_check: + healthy_threshold: 2 + response_timeout: 5000 + port: 8080 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 30000 + strategy: recreate + request_line: GET "/" "HTTP/1.0" + reinitializing_timeout: 60000 + TML-MENU: + scale: 1 + start_on_create: false + health_check: + healthy_threshold: 2 + response_timeout: 5000 + port: 8080 + unhealthy_threshold: 3 + initializing_timeout: 60000 + interval: 30000 + strategy: recreate + request_line: GET "/" "HTTP/1.0" + reinitializing_timeout: 60000 + TML-STATIC: + scale: 1 + start_on_create: false + OTT: + scale: 1 + start_on_create: false diff --git a/site/uat/create-stacks.sh b/site/uat/create-stacks.sh new file mode 100644 index 0000000..d0e039b --- /dev/null +++ b/site/uat/create-stacks.sh @@ -0,0 +1,15 @@ +export RANCHER_URL=http://localhost:8888 +export IPADDRESS=$(hostname -i) + +#Create Rancher Environment +rancher env create UAT +#Create Application Stacks +rancher --wait-state active --env UAT stack create TML-KHHW -f ./WHL-KHHW/docker-compose.yml -r ./WHL-KHHW/rancher-compose.yml +rancher --wait-state active --env UAT stack create TML-TXGW -f ./WHL-TXGW/docker-compose.yml -r ./WHL-TXGW/rancher-compose.yml +#Create Management Stacks +#Create necessary folders for volume mounting +mkdir -p -m 777 /docker/nexus3/nexus-data +mkdir -p -m 777 /docker/teamcity/data +mkdir -p -m 777 /docker/teamcity/logs +chmod -R 777 /docker/* +rancher --wait-state active --env UAT stack create Management-Backend -f ./Management-Backend/docker-compose.yml -r ./Management-Backend/rancher-compose.yml \ No newline at end of file