This repository was archived by the owner on Jul 30, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-17
lines changed
Expand file tree Collapse file tree 2 files changed +18
-17
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22set -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+
412function 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
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -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+
410function 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
2934function 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}' ) "
5150if [ -z " ${MASTER} " ]; then
5251 echo " Could not extract master host from kubeconfig"
5352 exit 1
You can’t perform that action at this time.
0 commit comments