From 91557165065b1d1b1457edad1473a8def94b2589 Mon Sep 17 00:00:00 2001 From: zeus Date: Fri, 4 Mar 2022 14:12:14 +0200 Subject: [PATCH] add cloud info --- CloudComputing_Lab/modules/ROOT/nav.adoc | 1 + .../modules/ROOT/pages/docker-compose.adoc | 181 ++++++++++++++++++ .../modules/ROOT/pages/index.adoc | 1 + 3 files changed, 183 insertions(+) create mode 100644 CloudComputing_Lab/modules/ROOT/pages/docker-compose.adoc diff --git a/CloudComputing_Lab/modules/ROOT/nav.adoc b/CloudComputing_Lab/modules/ROOT/nav.adoc index c1d19da..4cb6b56 100644 --- a/CloudComputing_Lab/modules/ROOT/nav.adoc +++ b/CloudComputing_Lab/modules/ROOT/nav.adoc @@ -6,4 +6,5 @@ * xref:e.adoc[Storage II] * xref:f.adoc[Docker Swarm] * xref:docker-build.adoc[DigitalSkills-dockerbuild] +* xref:docker-compose.adoc[DigitalSkills-deploy] * xref:tech-list.adoc[Getting_started] diff --git a/CloudComputing_Lab/modules/ROOT/pages/docker-compose.adoc b/CloudComputing_Lab/modules/ROOT/pages/docker-compose.adoc new file mode 100644 index 0000000..9918e3e --- /dev/null +++ b/CloudComputing_Lab/modules/ROOT/pages/docker-compose.adoc @@ -0,0 +1,181 @@ += Deploy + +== Create Yaml file + +.docker-compose +[source,yaml] +---- +services: + minio1: //<1> + image: minio/minio:RELEASE.2020-04-10T03-34-42Z //<2> + hostname: minio1 + volumes: + - minio1-data:/export //<3> + ports: + - "9001:9000" //<4> + networks: + - minio_distributed //<5> + deploy: + restart_policy: + delay: 10s + max_attempts: 10 + window: 60s + placement: + constraints: + - node.labels.minio1==true //<6> + command: server http://minio{1...4}/export //<7> + secrets: //<8> + - secret_key + - access_key + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] //<9> + interval: 30s + timeout: 20s + retries: 3 + + minio2: //<10> + image: minio/minio:RELEASE.2020-04-10T03-34-42Z + hostname: minio2 //<10> + volumes: + - minio2-data:/export //<11> + ports: + - "9002:9000" //<12> + networks: + - minio_distributed //<5> + deploy: + restart_policy: + delay: 10s + max_attempts: 10 + window: 60s + placement: + constraints: + - node.labels.minio2==true //<13> + command: server http://minio{1...4}/export + secrets: + - secret_key + - access_key + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + + minio3: + image: minio/minio:RELEASE.2020-04-10T03-34-42Z + hostname: minio3 + volumes: + - minio3-data:/export + ports: + - "9003:9000" + networks: + - minio_distributed //<5> + deploy: + restart_policy: + delay: 10s + max_attempts: 10 + window: 60s + placement: + constraints: + - node.labels.minio3==true + command: server http://minio{1...4}/export + secrets: + - secret_key + - access_key + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + + minio4: + image: minio/minio:RELEASE.2020-04-10T03-34-42Z + hostname: minio4 + volumes: + - minio4-data:/export + ports: + - "9004:9000" + networks: + - minio_distributed //<5> + deploy: + restart_policy: + delay: 10s + max_attempts: 10 + window: 60s + placement: + constraints: + - node.labels.minio4==true + command: server http://minio{1...4}/export + secrets: + - secret_key + - access_key + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + + web: + image: nginx:1.17.9-alpine + deploy: + mode: replicated + restart_policy: + delay: 10s + max_attempts: 10 + window: 60s + replicas: 2 + placement: + max_replicas_per_node: 1 + constraints: + - node.labels.group==minio //<14> + ports: + - "8080:80" + - "9443:443" + volumes: //<15> + - /PATH_to_FILE/minio.conf:/etc/nginx/conf.d/default.conf //<16> + - /PATH_to_FILE/public.crt:/etc/nginx/public.crt //<17> + - /PATH_to_FILE/private.key:/etc/nginx/private.key //<17> + networks: + - minio_distributed //<5> + + +volumes: + minio1-data: + + minio2-data: + + minio3-data: + + minio4-data: + + +networks: + minio_distributed: //<5> + driver: overlay + +secrets: + secret_key: + external: true + access_key: + external: true + +---- +<1> Service name +<2> Image name +<3> Volume to Use +<4> Expose port +<5> Network to Use +<6> Node Placement +<7> Start server +<8> insert secrets +<9> health check command +<10> *NEW* Service name +<11> *NEW* Volume +<12> *NEW* Port +<13> *NEW* Label +<14> Node Placement (Proxy) +<15> Bind mount config files +<16> Nginx config file +<17> ssl keys + + + diff --git a/CloudComputing_Lab/modules/ROOT/pages/index.adoc b/CloudComputing_Lab/modules/ROOT/pages/index.adoc index ddda7a6..dacd044 100644 --- a/CloudComputing_Lab/modules/ROOT/pages/index.adoc +++ b/CloudComputing_Lab/modules/ROOT/pages/index.adoc @@ -31,6 +31,7 @@ === Digital skills * xref:ROOT:docker-build.adoc[docker build --> a simple Node.js application] +* xref:ROOT:docker-compose.adoc[Deploy service] == Intro