You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
610 B

#!/bin/bash
nodes=""
i=1
for nodeip in `cat /root/nodes` ; do
i=$(( $i+1 ))
nodes+=" node${i}[ansible_ssh_host=${nodeip},ip=${nodeip}]"
done
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..."
kargo deploy -y --ansible-opts="-e kargo/custom.yaml"
deploy_res=$?
if [ "$deploy_res" -eq "0" ]; then
echo "Setting up kubedns..."
kpm deploy kube-system/kubedns --namespace=kube-system
fi