@@ -8,9 +8,6 @@ IDENT=${IDENT:-${HOME}/.ssh/id_rsa}
88SSH_OPTS=${SSH_OPTS:- }
99SELF_HOST_ETCD=${SELF_HOST_ETCD:- false}
1010
11- BOOTKUBE_REPO=${BOOTKUBE_REPO:- quay.io/ coreos/ bootkube}
12- BOOTKUBE_VERSION=${BOOTKUBE_VERSION:- v0.3.13}
13-
1411function usage() {
1512 echo " USAGE:"
1613 echo " $0 : <remote-host>"
@@ -52,11 +49,7 @@ function init_master_node() {
5249 fi
5350
5451 # Render cluster assets
55- /usr/bin/rkt run \
56- --volume home,kind=host,source=/home/core \
57- --mount volume=home,target=/core \
58- --trust-keys-from-https --net=host ${BOOTKUBE_REPO} :${BOOTKUBE_VERSION} --exec \
59- /bootkube -- render --asset-dir=/core/assets --api-servers=https://${COREOS_PUBLIC_IPV4} :443,https://${COREOS_PRIVATE_IPV4} :443 ${etcd_render_flags}
52+ /home/core/bootkube -- render --asset-dir=/home/core/assets --api-servers=https://${COREOS_PUBLIC_IPV4} :443,https://${COREOS_PRIVATE_IPV4} :443 ${etcd_render_flags}
6053
6154 # Move the local kubeconfig into expected location
6255 chown -R core:core /home/core/assets
@@ -68,13 +61,7 @@ function init_master_node() {
6861 systemctl enable kubelet; sudo systemctl start kubelet
6962
7063 # Start bootkube to launch a self-hosted cluster
71- /usr/bin/rkt run \
72- --volume home,kind=host,source=/home/core \
73- --mount volume=home,target=/core \
74- --volume manifests,kind=host,source=/etc/kubernetes/manifests \
75- --mount volume=manifests,target=/etc/kubernetes/manifests \
76- --net=host ${BOOTKUBE_REPO} :${BOOTKUBE_VERSION} --exec \
77- /bootkube -- start --asset-dir=/core/assets ${etcd_start_flags}
64+ /home/core/bootkube -- start --asset-dir=/home/core/assets ${etcd_start_flags}
7865}
7966
8067[ " $# " == 1 ] || usage
@@ -84,16 +71,19 @@ function init_master_node() {
8471 exit 1
8572}
8673
87- # This script can execute on a remote host by copying itself + kubelet service unit to remote host.
74+ # This script can execute on a remote host by copying itself + bootkube binary + kubelet service unit to remote host.
8875# After assets are available on the remote host, the script will execute itself in "local" mode.
8976if [ " ${REMOTE_HOST} " != " local" ]; then
9077 # Set up the kubelet.service on remote host
9178 scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} kubelet.master core@${REMOTE_HOST} :/home/core/kubelet.master
9279 ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} core@${REMOTE_HOST} " sudo mv /home/core/kubelet.master /etc/systemd/system/kubelet.service"
9380
81+ # Copy bootkube binary to remote host.
82+ scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} ../../_output/bin/linux/bootkube core@${REMOTE_HOST} :/home/core/bootkube
83+
9484 # Copy self to remote host so script can be executed in "local" mode
9585 scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} ${BASH_SOURCE[0]} core@${REMOTE_HOST} :/home/core/init-master.sh
96- ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} core@${REMOTE_HOST} " sudo BOOTKUBE_REPO= ${BOOTKUBE_REPO} BOOTKUBE_VERSION= ${BOOTKUBE_VERSION} SELF_HOST_ETCD=${SELF_HOST_ETCD} /home/core/init-master.sh local"
86+ ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} core@${REMOTE_HOST} " sudo SELF_HOST_ETCD=${SELF_HOST_ETCD} /home/core/init-master.sh local"
9787
9888 # Copy assets from remote host to a local directory. These can be used to launch additional nodes & contain TLS assets
9989 mkdir ${CLUSTER_DIR}
0 commit comments