From a94271c14c17624e0f9179980bfc6f9055763221 Mon Sep 17 00:00:00 2001 From: Bridget Kromhout Date: Fri, 28 Sep 2018 16:09:10 -0500 Subject: [PATCH 1/3] Slight modifications to current docs/scripts --- prepare-vms/README.md | 17 +++++++++++------ prepare-vms/lib/commands.sh | 2 +- prepare-vms/lib/infra/generic.sh | 1 + 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/prepare-vms/README.md b/prepare-vms/README.md index 83d3c3b6..f325946b 100644 --- a/prepare-vms/README.md +++ b/prepare-vms/README.md @@ -23,7 +23,7 @@ And if you want to generate printable cards: ## General Workflow - fork/clone repo -- create an infrastructure configuration in the `infra` sdirectory +- create an infrastructure configuration in the `prepare-vms/infra` directory (using one of the example files in that directory) - create your own setting file from `settings/example.yaml` - if necessary, increase allowed open files: `ulimit -Sn 10000` @@ -134,7 +134,7 @@ wrap Run this program in a container ### Example Steps to Launch Azure Instances -- Install the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) and authenticate with a valid account +- Install the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) and authenticate with a valid account (`az login`) - Customize `azuredeploy.parameters.json` - Required: - Provide the SSH public key you plan to use for instance configuration @@ -180,11 +180,16 @@ az group delete --resource-group workshop ### Example Steps to Configure Instances from a non-AWS Source - Copy `infra/example.generic` to `infra/generic` -- Run `./workshopctl --infra infra/generic --settings settings/...yaml` +- Run `./workshopctl start --infra infra/generic --settings settings/...yaml` +- Note the `prepare-vms/tags/TAG/` path that has been auto-created. - Launch instances via your preferred method. You'll need to get the instance IPs and be able to SSH into them. -- Create the file `prepare-vms/tags/TAG/ips.txt`, it should list the IP addresses of the VMs (one per line, without any comments or other info) -- Continue deployment with `./workshopctl deploy TAG` - (all subsequent commands are the same as with VMs created with another method) +- Edit the file `prepare-vms/tags/TAG/ips.txt`, it should list the IP addresses of the VMs (one per line, without any comments or other info) +- Continue deployment of cluster configuration with `./workshopctl deploy TAG` +- Optionally, configure Kubernetes clusters of the size in the settings: workshopctl kube `TAG` +- Optionally, test your Kubernetes clusters. They may take a little time to become ready: workshopctl kubetest `TAG` +- Generate cards to print and hand out: workshopctl cards `TAG` +- Print the cards file: prepare-vms/tags/`TAG`/ips.html + ## Even More Details diff --git a/prepare-vms/lib/commands.sh b/prepare-vms/lib/commands.sh index bac7f9ef..567bcfde 100644 --- a/prepare-vms/lib/commands.sh +++ b/prepare-vms/lib/commands.sh @@ -35,7 +35,7 @@ _cmd_cards() { info "Cards created. You can view them with:" info "xdg-open tags/$TAG/ips.html tags/$TAG/ips.pdf (on Linux)" - info "open tags/$TAG/ips.html tags/$TAG/ips.pdf (on MacOS)" + info "open tags/$TAG/ips.html (on macOS)" } _cmd deploy "Install Docker on a bunch of running VMs" diff --git a/prepare-vms/lib/infra/generic.sh b/prepare-vms/lib/infra/generic.sh index e44ab076..ded6069c 100644 --- a/prepare-vms/lib/infra/generic.sh +++ b/prepare-vms/lib/infra/generic.sh @@ -1,6 +1,7 @@ infra_start() { COUNT=$1 info "You should now run your provisioning commands for $COUNT machines." + info "Note: no machines have been automatically created!" info "Once done, put the list of IP addresses in tags/$TAG/ips.txt" info "(one IP address per line, without any comments or extra lines)." touch tags/$TAG/ips.txt From 720f2fc86e77bcb25e762cfd0b2611c4b094df02 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Fri, 28 Sep 2018 18:18:05 -0500 Subject: [PATCH 2/3] Actually modify the prompt --- prepare-vms/lib/commands.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prepare-vms/lib/commands.sh b/prepare-vms/lib/commands.sh index 567bcfde..39fc91b5 100644 --- a/prepare-vms/lib/commands.sh +++ b/prepare-vms/lib/commands.sh @@ -150,7 +150,7 @@ _cmd_kube() { sudo ln -sf /home/ubuntu/kubectx/kubens /usr/local/bin/kns && sudo cp /home/ubuntu/kubectx/completion/*.bash /etc/bash_completion.d && [ -d kube-ps1 ] || git clone https://github.com/jonmosco/kube-ps1 && - sudo -u docker sed s/docker-prompt/kube_ps1/ /home/docker/.bashrc && + sudo -u docker sed -i s/docker-prompt/kube_ps1/ /home/docker/.bashrc && sudo -u docker tee -a /home/docker/.bashrc < Date: Fri, 28 Sep 2018 18:24:14 -0500 Subject: [PATCH 3/3] Bump up EBS size to 20G for Portworx --- prepare-vms/lib/infra/aws.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/prepare-vms/lib/infra/aws.sh b/prepare-vms/lib/infra/aws.sh index 44f8d781..3cdff859 100644 --- a/prepare-vms/lib/infra/aws.sh +++ b/prepare-vms/lib/infra/aws.sh @@ -43,6 +43,7 @@ infra_start() { --count $COUNT \ --instance-type ${AWS_INSTANCE_TYPE-t2.medium} \ --client-token $TAG \ + --block-device-mapping 'DeviceName=/dev/sda1,Ebs={VolumeSize=20}' \ --image-id $AMI) reservation_id=$(echo "$result" | head -1 | awk '{print $2}') info "Reservation ID: $reservation_id"