Skip to content
This repository was archived by the owner on Dec 5, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions deployment/docker-swarm.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,11 @@ Using any IP from the command: `terraform output`

<!-- deploy-doc-hidden run-tests

cat > /root/boot.sh <<-EOF
#!/usr/bin/env bash
docker service create -\-constraint='node.role == manager' -\-network=dockerswarm_default -\-name healthcheck weaveworksdemos/healthcheck:snapshot -s user,catalogue,carts,shipping,payment,orders -r 5
sleep 60
ID=\$(docker ps -a | grep healthcheck | awk '{print \$1}' | head -n1)
docker logs -f \$ID
EOF

master_ip=$(terraform output -json | jq -r '.master_address.value' )
scp -i ~/.ssh/docker-swarm.pem /root/boot.sh ubuntu@$master_ip:/home/ubuntu/
ssh -i ~/.ssh/docker-swarm.pem ubuntu@$master_ip "chmod +x boot.sh; ./boot.sh"
ssh -i ~/.ssh/docker-swarm.pem ubuntu@$master_ip "docker service create -\-constraint='node.role == manager' -\-network=dockerswarm_default -\-name healthcheck weaveworksdemos/healthcheck:snapshot -s user,catalogue,carts,shipping,payment,orders -r 5"
sleep 60
ID=$(ssh -i ~/.ssh/docker-swarm.pem ubuntu@$master_ip sh -c "docker ps -a | grep healthcheck | awk '{print $1}' | head -n1")
ssh -i ~/.ssh/docker-swarm.pem ubuntu@$master_ip sh -c "docker logs -f $ID"

if [ $? -ne 0 ]; then
exit 1;
Expand Down
10 changes: 6 additions & 4 deletions deployment/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ Our master node makes use of some of the files in this repo so lets securely cop

master_ip=$(terraform output -json | jq -r '.master_address.value')
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip sudo kubeadm init > k8s-init.log
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip "sudo cp /etc/kubernetes/admin.conf /home/ubuntu/"
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip "sudo chown \$(id -u):\$(id -g) \$HOME/admin.conf"
grep -e --token k8s-init.log > join.cmd
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip kubectl apply -f https://git.io/weave-kube
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip KUBECONFIG=\$HOME/admin.conf kubectl apply -f https://git.io/weave-kube-1.6

<!-- deploy-doc-end -->

Expand All @@ -107,7 +109,7 @@ There are two options for running Weave Scope, either you can run the UI locally
<!-- deploy-doc-start create-infrastructure -->

master_ip=$(terraform output -json | jq -r '.master_address.value')
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip kubectl apply -f 'https://cloud.weave.works/launch/k8s/weavescope.yaml'
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip KUBECONFIG=\$HOME/admin.conf kubectl apply -f 'https://cloud.weave.works/launch/k8s/weavescope.yaml'

<!-- deploy-doc-end -->

Expand Down Expand Up @@ -139,7 +141,7 @@ You may optionally choose to configure Weave Flux which allows automatic deploym
<!-- deploy-doc-start create-infrastructure -->

master_ip=$(terraform output -json | jq -r '.master_address.value')
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip kubectl apply -f /tmp/manifests/sock-shop-ns.yaml -f /tmp/manifests/zipkin-ns.yaml -f /tmp/manifests
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip KUBECONFIG=\$HOME/admin.conf kubectl apply -f /tmp/manifests/sock-shop-ns.yaml -f /tmp/manifests/zipkin-ns.yaml -f /tmp/manifests

<!-- deploy-doc-end -->

Expand Down Expand Up @@ -194,7 +196,7 @@ This will send some traffic to the application, which will form the connection g
docker run --rm weaveworksdemos/load-test -d 300 -h $elb_url -c 2 -r 100

master_ip=$(terraform output -json | jq -r '.master_address.value')
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip "kubectl run -i -t -\-namespace=sock-shop healthcheck -\-restart=Never -\-image=weaveworksdemos/healthcheck:snapshot -- -s orders,carts,payment,user,catalogue,shipping,queue-master -d 60 -r 5"
ssh -i ~/.ssh/deploy-docs-k8s.pem ubuntu@$master_ip "KUBECONFIG=\$HOME/admin.conf kubectl run -i -t -\-namespace=sock-shop healthcheck -\-restart=Never -\-image=weaveworksdemos/healthcheck:snapshot -- -s orders,carts,payment,user,catalogue,shipping,queue-master -d 60 -r 5"

set +e

Expand Down