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 +20
-3
lines changed
Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,19 @@ if [ ${un} == 'Darwin' ]; then
99 local_os=" darwin"
1010fi
1111
12+ SELF_HOST_ETCD=${SELF_HOST_ETCD:- false}
13+ if [ ${SELF_HOST_ETCD} = " true" ]; then
14+ echo " WARNING: THIS IS NOT YET FULLY WORKING - merely here to make ongoing testing easier"
15+ etcd_render_flags=" --experimental-self-hosted-etcd"
16+ etcd_start_flags=" --etcd-server=http://172.17.4.100:12379 --experimental-self-hosted-etcd"
17+ else
18+ etcd_render_flags=" "
19+ etcd_start_flags=" "
20+ fi
21+
1222# Render assets
1323if [ ! -d " cluster" ]; then
14- ../../_output/bin/${local_os} /bootkube render --asset-dir=cluster --api-servers=https://172.17.4.100:443
24+ ../../_output/bin/${local_os} /bootkube render --asset-dir=cluster --api-servers=https://172.17.4.100:443 ${etcd_render_flags}
1525 cp user-data.sample cluster/user-data
1626fi
1727
@@ -24,7 +34,7 @@ scp -q -F ssh_config -r cluster core@default:/home/core/cluster
2434scp -q -F ssh_config ../../_output/bin/linux/bootkube core@default:/home/core
2535
2636# Run bootkube
27- ssh -q -F ssh_config core@default " sudo GLOG_v=${GLOG_v} /home/core/bootkube start --asset-dir=/home/core/cluster 2>> /home/core/bootkube.log"
37+ ssh -q -F ssh_config core@default " sudo GLOG_v=${GLOG_v} /home/core/bootkube start --asset-dir=/home/core/cluster ${etcd_start_flags} 2>> /home/core/bootkube.log"
2838
2939echo
3040echo " Bootstrap complete. Access your kubernetes cluster using:"
Original file line number Diff line number Diff line change @@ -6,14 +6,21 @@ import (
66 "net/http"
77 "time"
88
9+ "os"
10+ "path/filepath"
11+
912 "github.com/golang/glog"
1013)
1114
1215const bootEtcdFilePath = "/etc/kubernetes/manifests/boot-etcd.yaml"
1316
1417func StartEtcd (endpoint string ) error {
18+ dir := filepath .Dir (bootEtcdFilePath )
19+ if err := os .MkdirAll (dir , 0700 ); err != nil {
20+ return fmt .Errorf ("failed to create directory '%s': %v" , dir , err )
21+ }
1522 if err := ioutil .WriteFile (bootEtcdFilePath , []byte (etcdPodYaml ), 0600 ); err != nil {
16- return fmt .Errorf ("fail to write file '/etc/kubernetes/manifests/boot-etcd.yaml ': %v" , err )
23+ return fmt .Errorf ("failed to write file '%s ': %v" , bootEtcdFilePath , err )
1724 }
1825 glog .Info ("etcd server has been defined to run by kubelet. Please wait..." )
1926 return waitEtcdUp (endpoint )
You can’t perform that action at this time.
0 commit comments