-
Notifications
You must be signed in to change notification settings - Fork 34
/
instructor_automated.sh
executable file
·64 lines (47 loc) · 2.23 KB
/
instructor_automated.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
## CHANGE THIS EVERY TIME!!!
export APPNAME=training
export PUBLICIP=54.224.9.22
export CLUSTER=djannot
export REGION=us-east-1
export clusters=20
export maws=110465657741_Mesosphere-PowerUser
#### Remove all DC/OS Clusters
rm -rf ~/.dcos/clusters
#### SETUP MASTER URL VARIABLE
# NOTE: elb url is not used in this script (yet) TODO
if [[ $1 == "" ]]
then
echo
echo " A master node's URL was not entered. Aborting."
echo
exit 1
fi
MASTER_URL=$1
#### SETUP CLI
./scripts/setup_cli.sh $MASTER_URL
loadbalancer=ext-$CLUSTER
eval $(maws login ${maws})
# The group ID of the AWS Security Group of the DC/OS public nodes
group=$(aws --region=$REGION ec2 describe-instances | jq --raw-output ".Reservations[].Instances[] | select((.Tags | length) > 0) | select(.Tags[].Value | test(\"${CLUSTER}-publicagent\")) | select(.State.Name | test(\"running\")) | .SecurityGroups[] | [.GroupName, .GroupId] | \"\(.[0]) \(.[1])\"" | grep public-agents-lb-firewall | awk '{ print $2 }' | sort -u)
./scripts/create-and-attach-volumes.sh ${maws}
./scripts/create-csi-iam-policy.sh ${maws}
./scripts/update-aws-network-configuration.sh ${clusters} ${loadbalancer} ${group} ${maws}
#dcos package install --yes --cli dcos-enterprise-cli
nodes=$(dcos node --json | jq --raw-output ".[] | select((.type | test(\"agent\")) and (.attributes.public_ip == null)) | .id" | wc -l | awk '{ print $1 }')
sed "s/NODES/${nodes}/g" scripts/options-portworx.json.template > scripts/options-portworx.json
./scripts/deploy-portworx.sh
./scripts/deploy-kubernetes-mke.sh
./scripts/check-kubernetes-mke-status.sh
./scripts/deploy-dcos-monitoring.sh
./create-pool-edgelb-all.sh ${clusters}
./scripts/deploy-edgelb.sh
awk -v clusters=${clusters} 'BEGIN { for (i=1; i<=clusters; i++) printf("%02d\n", i) }' | while read i; do
dcos security org users grant dcos-edgelb dcos:adminrouter:service:edgelb/pools/dklb${i} full
done
./scripts/check-app-status.sh infra/network/dcos-edgelb/pools/all
./scripts/create-dklb-secret.sh
sed "/mesos.lab/d" /etc/hosts > ./hosts
awk -v clusters=${clusters} 'BEGIN { for (i=1; i<=clusters; i++) printf("%02d\n", i) }' | while read i; do
echo "$PUBLICIP ${APPNAME}.prod.k8s.cluster${i}.mesos.lab" >>./hosts
done
sudo mv hosts /etc/hosts