Allow bootstrap token and master_ip to be customizable

This change will allow the create_stack.sh script to be called to init
the k8s cluster with a user generated bootstrap token and a pre-defined
master_ip. This will allow us to automate initial deployment of cluster
with a known list of IPs

Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
This commit is contained in:
Ganesh Maharaj Mahalingam
2019-07-31 15:21:50 -07:00
committed by Nitin at Intel
parent ef0c39c39d
commit 2b2506439f
+6
View File
@@ -29,6 +29,12 @@ function finish() {
trap finish EXIT
function cluster_init() {
if ! [ -z ${TOKEN} ]; then
sed -i "/InitConfiguration/a bootstrapTokens:\\n- token: ${TOKEN}" ./kubeadm.yaml
fi
if ! [ -z ${MASTER_IP} ]; then
sed -i "/InitConfiguration/a localAPIEndpoint:\\n advertiseAddress: ${MASTER_IP}" ./kubeadm.yaml
fi
#This only works with kubernetes 1.12+. The kubeadm.yaml is setup
#to enable the RuntimeClass featuregate
if [[ -d /var/lib/etcd ]]; then