c12s-kubespray/deploy-k8s.kargo.sh

26 lines
611 B
Bash
Raw Normal View History

#!/bin/bash
2016-06-16 10:19:27 +00:00
custom_opts='--ansible-opts=\"-e kargo/custom.yaml\"'
nodes=""
i=0
for nodeip in `cat /root/nodes` ; do
i=$(( $i+1 ))
nodes+=" node${i}[ansible_ssh_host=${nodeip},ip=${nodeip}]"
done
2016-06-16 10:19:27 +00:00
if [ -f kargo/inventory/inventory.cfg ] ; then
echo "kargo/inventory/inventory.cfg already exists, if you want to recreate, pls remove it and re-run this script"
else
echo "Preparing inventory..."
kargo prepare -y --nodes $nodes
fi
echo "Running deployment..."
deploy_res=$?
if [ "$deploy_res" -eq "0" ]; then
echo "Setting up kubedns..."
kpm deploy kube-system/kubedns --namespace=kube-system
fi