coins-demo/contrib/firstboot.sh

26 lines
517 B
Bash
Raw Normal View History

#!/bin/bash
2020-07-31 13:32:43 +00:00
bootflag='/.manufactured'
2020-07-31 11:33:22 +00:00
groot='/opt/coins-demo'
k8sDemoWA () {
2020-07-31 15:04:12 +00:00
printf "\033c"
2020-07-31 11:33:22 +00:00
echo 'Disabling swap space...'
sync && swapoff -a && sed -i '/ swap / s/^/#/' /etc/fstab
2020-07-31 15:04:12 +00:00
export KUBECONFIG=/root/.kube/config
2020-07-31 11:33:22 +00:00
}
2020-07-31 14:44:43 +00:00
k8sDeploy () {
2020-07-31 11:33:22 +00:00
echo 'Installing K8s...'
cd ${groot}/contrib/ansible && \
ansible-playbook bootstrap-node.yml && \
ansible-playbook init-cluster.yml
}
2020-07-31 14:53:50 +00:00
#InstallIngress () {
#
#}
2020-07-31 13:32:43 +00:00
if [ ! -f ${bootflag} ]; then
touch ${bootflag}
k8sDemoWA;
2020-07-31 14:44:43 +00:00
k8sDeploy;
2020-07-31 13:32:43 +00:00
fi