From b9c08613ed60ac5535a44dac4095f21458961a87 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Mon, 22 Apr 2019 03:47:10 -0500 Subject: [PATCH] Add deployment scripts for admin training --- prepare-vms/settings/admin-dmuc.yaml | 28 +++++ prepare-vms/settings/admin-kubenet.yaml | 28 +++++ prepare-vms/settings/admin-kuberouter.yaml | 28 +++++ prepare-vms/settings/admin-test.yaml | 28 +++++ prepare-vms/setup-admin-clusters.sh | 53 +++++++++ prepare-vms/templates/admin.html | 124 +++++++++++++++++++++ 6 files changed, 289 insertions(+) create mode 100644 prepare-vms/settings/admin-dmuc.yaml create mode 100644 prepare-vms/settings/admin-kubenet.yaml create mode 100644 prepare-vms/settings/admin-kuberouter.yaml create mode 100644 prepare-vms/settings/admin-test.yaml create mode 100755 prepare-vms/setup-admin-clusters.sh create mode 100644 prepare-vms/templates/admin.html diff --git a/prepare-vms/settings/admin-dmuc.yaml b/prepare-vms/settings/admin-dmuc.yaml new file mode 100644 index 00000000..70ac6ec6 --- /dev/null +++ b/prepare-vms/settings/admin-dmuc.yaml @@ -0,0 +1,28 @@ +# Number of VMs per cluster +clustersize: 1 + +# The hostname of each node will be clusterprefix + a number +clusterprefix: dmuc + +# Jinja2 template to use to generate ready-to-cut cards +cards_template: admin.html + +# Use "Letter" in the US, and "A4" everywhere else +paper_size: A4 + +# Feel free to reduce this if your printer can handle it +paper_margin: 0.2in + +# Note: paper_size and paper_margin only apply to PDF generated with pdfkit. +# If you print (or generate a PDF) using ips.html, they will be ignored. +# (The equivalent parameters must be set from the browser's print dialog.) + +# This can be "test" or "stable" +engine_version: stable + +# These correspond to the version numbers visible on their respective GitHub release pages +compose_version: 1.21.1 +machine_version: 0.14.0 + +# Password used to connect with the "docker user" +docker_user_password: training diff --git a/prepare-vms/settings/admin-kubenet.yaml b/prepare-vms/settings/admin-kubenet.yaml new file mode 100644 index 00000000..8256fc65 --- /dev/null +++ b/prepare-vms/settings/admin-kubenet.yaml @@ -0,0 +1,28 @@ +# Number of VMs per cluster +clustersize: 3 + +# The hostname of each node will be clusterprefix + a number +clusterprefix: kubenet + +# Jinja2 template to use to generate ready-to-cut cards +cards_template: admin.html + +# Use "Letter" in the US, and "A4" everywhere else +paper_size: A4 + +# Feel free to reduce this if your printer can handle it +paper_margin: 0.2in + +# Note: paper_size and paper_margin only apply to PDF generated with pdfkit. +# If you print (or generate a PDF) using ips.html, they will be ignored. +# (The equivalent parameters must be set from the browser's print dialog.) + +# This can be "test" or "stable" +engine_version: stable + +# These correspond to the version numbers visible on their respective GitHub release pages +compose_version: 1.21.1 +machine_version: 0.14.0 + +# Password used to connect with the "docker user" +docker_user_password: training diff --git a/prepare-vms/settings/admin-kuberouter.yaml b/prepare-vms/settings/admin-kuberouter.yaml new file mode 100644 index 00000000..3f903065 --- /dev/null +++ b/prepare-vms/settings/admin-kuberouter.yaml @@ -0,0 +1,28 @@ +# Number of VMs per cluster +clustersize: 3 + +# The hostname of each node will be clusterprefix + a number +clusterprefix: kuberouter + +# Jinja2 template to use to generate ready-to-cut cards +cards_template: admin.html + +# Use "Letter" in the US, and "A4" everywhere else +paper_size: A4 + +# Feel free to reduce this if your printer can handle it +paper_margin: 0.2in + +# Note: paper_size and paper_margin only apply to PDF generated with pdfkit. +# If you print (or generate a PDF) using ips.html, they will be ignored. +# (The equivalent parameters must be set from the browser's print dialog.) + +# This can be "test" or "stable" +engine_version: stable + +# These correspond to the version numbers visible on their respective GitHub release pages +compose_version: 1.21.1 +machine_version: 0.14.0 + +# Password used to connect with the "docker user" +docker_user_password: training diff --git a/prepare-vms/settings/admin-test.yaml b/prepare-vms/settings/admin-test.yaml new file mode 100644 index 00000000..ac9679be --- /dev/null +++ b/prepare-vms/settings/admin-test.yaml @@ -0,0 +1,28 @@ +# Number of VMs per cluster +clustersize: 3 + +# The hostname of each node will be clusterprefix + a number +clusterprefix: test + +# Jinja2 template to use to generate ready-to-cut cards +cards_template: admin.html + +# Use "Letter" in the US, and "A4" everywhere else +paper_size: A4 + +# Feel free to reduce this if your printer can handle it +paper_margin: 0.2in + +# Note: paper_size and paper_margin only apply to PDF generated with pdfkit. +# If you print (or generate a PDF) using ips.html, they will be ignored. +# (The equivalent parameters must be set from the browser's print dialog.) + +# This can be "test" or "stable" +engine_version: stable + +# These correspond to the version numbers visible on their respective GitHub release pages +compose_version: 1.21.1 +machine_version: 0.14.0 + +# Password used to connect with the "docker user" +docker_user_password: training diff --git a/prepare-vms/setup-admin-clusters.sh b/prepare-vms/setup-admin-clusters.sh new file mode 100755 index 00000000..b93f0da3 --- /dev/null +++ b/prepare-vms/setup-admin-clusters.sh @@ -0,0 +1,53 @@ +#!/bin/sh +set -e + +INFRA=infra/aws-eu-west-3 + +STUDENTS=2 + +TAG=admin-dmuc +./workshopctl start \ + --tag $TAG \ + --infra $INFRA \ + --settings settings/$TAG.yaml \ + --count $STUDENTS + +./workshopctl deploy $TAG +./workshopctl disabledocker $TAG +./workshopctl kubebins $TAG +./workshopctl cards $TAG + +TAG=admin-kubenet +./workshopctl start \ + --tag $TAG \ + --infra $INFRA \ + --settings settings/$TAG.yaml \ + --count $((3*$STUDENTS)) + +./workshopctl deploy $TAG +./workshopctl kubebins $TAG +./workshopctl disableaddrchecks $TAG +./workshopctl cards $TAG + +TAG=admin-kuberouter +./workshopctl start \ + --tag $TAG \ + --infra $INFRA \ + --settings settings/$TAG.yaml \ + --count $((3*$STUDENTS)) + +./workshopctl deploy $TAG +./workshopctl kubebins $TAG +./workshopctl disableaddrchecks $TAG +./workshopctl cards $TAG + +TAG=admin-test +./workshopctl start \ + --tag $TAG \ + --infra $INFRA \ + --settings settings/$TAG.yaml \ + --count $((3*$STUDENTS)) + +./workshopctl deploy $TAG +./workshopctl kube $TAG 1.13.5 +./workshopctl cards $TAG diff --git a/prepare-vms/templates/admin.html b/prepare-vms/templates/admin.html new file mode 100644 index 00000000..9684a55c --- /dev/null +++ b/prepare-vms/templates/admin.html @@ -0,0 +1,124 @@ +{# Feel free to customize or override anything in there! #} +{%- set url = "http://FIXME.container.training" -%} +{%- set pagesize = 9 -%} +{%- if clustersize == 1 -%} + {%- set workshop_name = "Docker workshop" -%} + {%- set cluster_or_machine = "machine virtuelle" -%} + {%- set this_or_each = "cette" -%} + {%- set plural = "" -%} + {%- set image_src = "https://s3-us-west-2.amazonaws.com/www.breadware.com/integrations/docker.png" -%} +{%- else -%} + {%- set workshop_name = "Kubernetes workshop" -%} + {%- set cluster_or_machine = "cluster" -%} + {%- set this_or_each = "chaque" -%} + {%- set plural = "s" -%} + {%- set image_src_swarm = "https://cdn.wp.nginx.com/wp-content/uploads/2016/07/docker-swarm-hero2.png" -%} + {%- set image_src_kube = "https://avatars1.githubusercontent.com/u/13629408" -%} + {%- set image_src = image_src_kube -%} +{%- endif -%} + + + + +{% for cluster in clusters %} + {% if loop.index0>0 and loop.index0%pagesize==0 %} + + {% endif %} +
+ +

+ Voici les informations permettant de se connecter à un + des environnements utilisés pour cette formation. + Vous pouvez vous connecter à {{ this_or_each }} machine + virtuelle avec n'importe quel client SSH. +

+ +

+ + + + + + + + +
cluster:
{{ clusterprefix }}
identifiant:
docker
mot de passe:
{{ docker_user_password }}
+

+ +

+ Adresse{{ plural }} IP : + + + {% for node in cluster %} + + {% endfor %} +
{{ clusterprefix }}{{ loop.index }}:{{ node }}
+

+

Le support de formation est à l'adresse suivante : +

{{ url }}
+

+
+{% endfor %} + +