feat(deploy): add deployment script with pre-checks and ansible-playbook execution
Signed-off-by: 孙振宇 <>
This commit is contained in:
parent
051b6e4ae5
commit
81b849dd0f
23
cluster/ansible/deploy.sh
Normal file
23
cluster/ansible/deploy.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
# Check if `init.sh` has not run
|
||||
if [ ! -d venv ]; then
|
||||
echo "Please run init.sh first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if kubespray has not been cloned and its empty
|
||||
if [ ! -d ../../3rd/kubespray ]; then
|
||||
echo "Please run 'git submoudle --init --recursive' first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if `inventory.ini` has not been created
|
||||
if [ ! -f ../../cluster/ansible/manifests/inventory.ini ]; then
|
||||
echo "Please create your own inventory.ini first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ../../3rd/kubespray && ansible-playbook -i ../../cluster/ansible/manifests/inventory.ini ./cluster.yml -kK
|
||||
@ -26,7 +26,7 @@ local_release_dir: "/tmp/releases"
|
||||
retry_stagger: 5
|
||||
|
||||
# This is the user that owns tha cluster installation.
|
||||
kube_owner: kube
|
||||
kube_owner: root
|
||||
|
||||
# This is the group that the cert creation scripts chgrp the
|
||||
# cert files to. Not really changeable...
|
||||
|
||||
Loading…
Reference in New Issue
Block a user