Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 4dad7e0

Browse files
authored
Merge pull request #68 from aaronlevy/quickstart-tweaks
hack/quickstart: minor install tweaks
2 parents f9949bf + 2012cc7 commit 4dad7e0

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

hack/quickstart/init-master.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/bin/bash
22
set -euo pipefail
33

4+
REMOTE_HOST=$1
5+
REMOTE_PORT=${REMOTE_PORT:-22}
6+
CLUSTER_DIR=${CLUSTER_DIR:-cluster}
7+
IDENT=${IDENT:-${HOME}/.ssh/id_rsa}
8+
9+
BOOTKUBE_REPO=quay.io/coreos/bootkube
10+
BOOTKUBE_VERSION=v0.1.0
11+
412
function usage() {
513
echo "USAGE:"
614
echo "$0: <remote-host>"
@@ -60,9 +68,8 @@ function init_master_node() {
6068
systemctl enable etcd2; sudo systemctl start etcd2
6169
configure_network
6270

63-
# Start flannel then kubelet
71+
# Start flannel
6472
systemctl enable flanneld; sudo systemctl start flanneld
65-
systemctl enable kubelet; sudo systemctl start kubelet
6673

6774
# Render cluster assets
6875
/usr/bin/rkt run \
@@ -76,6 +83,9 @@ function init_master_node() {
7683
mkdir -p /etc/kubernetes
7784
cp /home/core/assets/auth/kubeconfig /etc/kubernetes/
7885

86+
# Start the kubelet
87+
systemctl enable kubelet; sudo systemctl start kubelet
88+
7989
# Start bootkube to launch a self-hosted cluster
8090
/usr/bin/rkt run \
8191
--volume home,kind=host,source=/home/core \
@@ -86,14 +96,6 @@ function init_master_node() {
8696

8797
[ "$#" == 1 ] || usage
8898

89-
REMOTE_HOST=$1
90-
REMOTE_PORT=${REMOTE_PORT:-22}
91-
CLUSTER_DIR=${CLUSTER_DIR:-cluster}
92-
IDENT=${IDENT:-${HOME}/.ssh/id_rsa}
93-
94-
BOOTKUBE_REPO=quay.io/coreos/bootkube
95-
BOOTKUBE_VERSION=v0.1.0
96-
9799
[ -d "${CLUSTER_DIR}" ] && {
98100
echo "Error: CLUSTER_DIR=${CLUSTER_DIR} already exists"
99101
exit 1

hack/quickstart/init-worker.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/bash
22
set -euo pipefail
33

4+
REMOTE_HOST=$1
5+
KUBECONFIG=$2
6+
REMOTE_PORT=${REMOTE_PORT:-22}
7+
IDENT=${IDENT:-${HOME}/.ssh/id_rsa}
8+
MASTER="$(awk '/server:/ {print $2}' ${KUBECONFIG} | awk -F/ '{print $3}' | awk -F: '{print $1}')"
9+
410
function usage() {
511
echo "USAGE:"
612
echo "$0: <remote-host> <kube-config>"
@@ -24,7 +30,6 @@ function configure_flannel() {
2430
}
2531
}
2632

27-
2833
# Initialize a worker node
2934
function init_worker_node() {
3035
configure_flannel
@@ -42,12 +47,6 @@ function init_worker_node() {
4247

4348
[ "$#" == 2 ] || usage
4449

45-
REMOTE_HOST=$1
46-
KUBECONFIG=$2
47-
REMOTE_PORT=${REMOTE_PORT:-22}
48-
IDENT=${IDENT:-${HOME}/.ssh/id_rsa}
49-
50-
MASTER="$(awk '/server:/ {print $2}' ${KUBECONFIG} | awk -F/ '{print $3}' | awk -F: '{print $1}')"
5150
if [ -z "${MASTER}" ]; then
5251
echo "Could not extract master host from kubeconfig"
5352
exit 1

0 commit comments

Comments
 (0)