diff --git a/instance-creation.sh b/instance-creation.sh index 51f8cd5..3d83d0f 100644 --- a/instance-creation.sh +++ b/instance-creation.sh @@ -21,4 +21,37 @@ sed -i '/k8s_master_fips/c\k8s_master_fips =["'$IP'"]' cluster.tfvars && bash terraform_init.sh && bash terraform_apply.sh && +# Sleeping for 30 seconds just for instances to start +sleep 30 && +cd ../../ && +# installing Ansible +pip3 install -r requirements.txt && +eval $(ssh-agent -s) && +ssh-add ~/.ssh/id_rsa && +# This will avoid the yes/no prompt when doing SSH connection to the machines +echo 'StrictHostKeyChecking no' &>> /etc/ssh/ssh_config && +# Run the ansible playbooks to install kubernetes +cd ../terra && +cp ../jetstream_kubespray/inventory/$CLUSTER/hosts hosts && +ansible-playbook -i hosts users.yml && +ansible-playbook -i hosts install-k8s.yml && +sleep 30 && +ansible-playbook -i hosts master.yml && +sleep 30 && +ansible-playbook -i hosts workers.yml && +ssh ubuntu@$IP && +git clone https://github.com/airavata-courses/terra.git && +cd terra && +git checkout ansible-kub-setup && +cd Kubernetes\ files/ && +kubectl apply -f MySQLConfigMap.yaml && +kubectl apply -f MySQLService.yaml && +sleep 30 && +kubectl apply -f rabbitmq.yaml && +sleep 30 && +kubectl apply -f data-retrieval.yaml && +kubectl apply -f api-gateway.yaml && +kubectl apply -f weatherForecast.yaml && +kubectl apply -f user-managment.yaml && +kubectl apply -f userinterface.yaml && \ No newline at end of file