Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
881cf801
Commit
881cf801
authored
Sep 29, 2014
by
Joe Beda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vagrant now using pre-built binaries.
parent
69a14a03
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
178 additions
and
80 deletions
+178
-80
Vagrantfile
Vagrantfile
+55
-27
Dockerfile
build/build-image/Dockerfile
+6
-4
common.sh
build/common.sh
+10
-4
kube-util.sh
cluster/kube-util.sh
+1
-1
cluster-params.sls
cluster/saltbase/pillar/cluster-params.sls
+4
-0
default
cluster/saltbase/salt/apiserver/default
+5
-1
config-default.sh
cluster/vagrant/config-default.sh
+0
-1
provision-master.sh
cluster/vagrant/provision-master.sh
+57
-15
util.sh
cluster/vagrant/util.sh
+40
-27
No files found.
Vagrantfile
View file @
881cf801
...
@@ -7,45 +7,73 @@ VAGRANTFILE_API_VERSION = "2"
...
@@ -7,45 +7,73 @@ VAGRANTFILE_API_VERSION = "2"
# Require a recent version of vagrant otherwise some have reported errors setting host names on boxes
# Require a recent version of vagrant otherwise some have reported errors setting host names on boxes
Vagrant
.
require_version
">= 1.6.2"
Vagrant
.
require_version
">= 1.6.2"
Vagrant
.
configure
(
VAGRANTFILE_API_VERSION
)
do
|
config
|
# The number of minions to provision
$num_minion
=
(
ENV
[
'KUBERNETES_NUM_MINIONS'
]
||
3
).
to_i
# The number of minions to provision
num_minion
=
(
ENV
[
'KUBERNETES_NUM_MINIONS'
]
||
3
).
to_i
# ip configuration
# ip configuration
master_ip
=
"10.245.1.2"
$
master_ip
=
"10.245.1.2"
minion_ip_base
=
"10.245.2."
$
minion_ip_base
=
"10.245.2."
minion_ips
=
num_minion
.
times
.
collect
{
|
n
|
minion_ip_base
+
"
#{
n
+
2
}
"
}
$minion_ips
=
$num_minion
.
times
.
collect
{
|
n
|
$
minion_ip_base
+
"
#{
n
+
2
}
"
}
minion_ips_str
=
minion_ips
.
join
(
","
)
$minion_ips_str
=
$
minion_ips
.
join
(
","
)
# Determine the OS platform to use
# Determine the OS platform to use
kube_os
=
ENV
[
'KUBERNETES_OS'
]
||
"fedora"
$
kube_os
=
ENV
[
'KUBERNETES_OS'
]
||
"fedora"
# OS platform to box information
# OS platform to box information
kube_box
=
{
$kube_box
=
{
"fedora"
=>
{
"fedora"
=>
{
"name"
=>
"fedora20"
,
"name"
=>
"fedora20"
,
"box_url"
=>
"http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-20_chef-provisionerless.box"
"box_url"
=>
"http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-20_chef-provisionerless.box"
}
}
}
}
# This stuff is cargo-culted from http://www.stefanwrobel.com/how-to-make-vagrant-performance-not-suck
# Give access to all cpu cores on the host
host
=
RbConfig
::
CONFIG
[
'host_os'
]
if
host
=~
/darwin/
$vm_cpus
=
`sysctl -n hw.ncpu`
.
to_i
elsif
host
=~
/linux/
$vm_cpus
=
`nproc`
.
to_i
else
# sorry Windows folks, I can't help you
$vm_cpus
=
2
end
# Give VM 1024 of RAM
$vm_mem
=
1024
Vagrant
.
configure
(
VAGRANTFILE_API_VERSION
)
do
|
config
|
def
customize_vm
(
config
)
config
.
vm
.
box
=
$kube_box
[
$kube_os
][
"name"
]
config
.
vm
.
box_url
=
$kube_box
[
$kube_os
][
"box_url"
]
config
.
vm
.
provider
:virtualbox
do
|
v
|
v
.
customize
[
"modifyvm"
,
:id
,
"--memory"
,
$vm_mem
]
v
.
customize
[
"modifyvm"
,
:id
,
"--cpus"
,
$vm_cpus
]
# Use faster paravirtualized networking
v
.
customize
[
"modifyvm"
,
:id
,
"--nictype1"
,
"virtio"
]
v
.
customize
[
"modifyvm"
,
:id
,
"--nictype2"
,
"virtio"
]
end
end
# Kubernetes master
# Kubernetes master
config
.
vm
.
define
"master"
do
|
config
|
config
.
vm
.
define
"master"
do
|
config
|
c
onfig
.
vm
.
box
=
kube_box
[
kube_os
][
"name"
]
c
ustomize_vm
config
config
.
vm
.
box_url
=
kube_box
[
kube_os
][
"box_url"
]
config
.
vm
.
provision
"shell"
,
inline:
"/vagrant/cluster/vagrant/provision-master.sh
#{
master_ip
}
#{
num_minion
}
#{
minion_ips_str
}
"
config
.
vm
.
provision
"shell"
,
inline:
"/vagrant/cluster/vagrant/provision-master.sh
#{
$master_ip
}
#{
$num_minion
}
#{
$
minion_ips_str
}
"
config
.
vm
.
network
"private_network"
,
ip:
"
#{
master_ip
}
"
config
.
vm
.
network
"private_network"
,
ip:
"
#{
$
master_ip
}
"
config
.
vm
.
hostname
=
"kubernetes-master"
config
.
vm
.
hostname
=
"kubernetes-master"
end
end
# Kubernetes minion
# Kubernetes minion
num_minion
.
times
do
|
n
|
$
num_minion
.
times
do
|
n
|
config
.
vm
.
define
"minion-
#{
n
+
1
}
"
do
|
minion
|
config
.
vm
.
define
"minion-
#{
n
+
1
}
"
do
|
minion
|
customize_vm
minion
minion_index
=
n
+
1
minion_index
=
n
+
1
minion_ip
=
minion_ips
[
n
]
minion_ip
=
$minion_ips
[
n
]
minion
.
vm
.
box
=
kube_box
[
kube_os
][
"name"
]
minion
.
vm
.
provision
"shell"
,
inline:
"/vagrant/cluster/vagrant/provision-minion.sh
#{
$master_ip
}
#{
$num_minion
}
#{
$minion_ips_str
}
#{
minion_ip
}
#{
minion_index
}
"
minion
.
vm
.
box_url
=
kube_box
[
kube_os
][
"box_url"
]
minion
.
vm
.
provision
"shell"
,
inline:
"/vagrant/cluster/vagrant/provision-minion.sh
#{
master_ip
}
#{
num_minion
}
#{
minion_ips_str
}
#{
minion_ip
}
#{
minion_index
}
"
minion
.
vm
.
network
"private_network"
,
ip:
"
#{
minion_ip
}
"
minion
.
vm
.
network
"private_network"
,
ip:
"
#{
minion_ip
}
"
minion
.
vm
.
hostname
=
"kubernetes-minion-
#{
minion_index
}
"
minion
.
vm
.
hostname
=
"kubernetes-minion-
#{
minion_index
}
"
end
end
...
...
build/build-image/Dockerfile
View file @
881cf801
...
@@ -28,10 +28,12 @@ ENV GOARCH amd64
...
@@ -28,10 +28,12 @@ ENV GOARCH amd64
# Get the code coverage tool and godep
# Get the code coverage tool and godep
RUN
go get code.google.com/p/go.tools/cmd/cover github.com/tools/godep
RUN
go get code.google.com/p/go.tools/cmd/cover github.com/tools/godep
RUN
mkdir
-p
/go/src/github.com/coreos/etcd
&&
\
# Download and symlink etcd. We need this for our integration tests.
cd
/go/src/github.com/coreos/etcd
&&
\
RUN
mkdir
-p
/usr/local/src/etcd
&&
\
git clone https://github.com/coreos/etcd.git
.
-b
v0.4.6
--depth
=
1
&&
\
cd
/usr/local/src/etcd
&&
\
go
install
github.com/coreos/etcd
curl
-L
-O
-s
https://github.com/coreos/etcd/releases/download/v0.4.6/etcd-v0.4.6-linux-amd64.tar.gz
&&
\
tar
xzf etcd-v0.4.6-linux-amd64.tar.gz
&&
\
ln
-s
../src/etcd/etcd-v0.4.6-linux-amd64/etcd /usr/local/bin/
# Mark this as a kube-build container
# Mark this as a kube-build container
RUN
touch
/kube-build-image
RUN
touch
/kube-build-image
...
...
build/common.sh
View file @
881cf801
...
@@ -152,7 +152,8 @@ function kube::build::build_image() {
...
@@ -152,7 +152,8 @@ function kube::build::build_image() {
build
build
cmd
cmd
examples
examples
Godeps
Godeps/Godeps.json
Godeps/_workspace/src
hack
hack
LICENSE
LICENSE
pkg
pkg
...
@@ -203,8 +204,9 @@ function kube::build::docker_build() {
...
@@ -203,8 +204,9 @@ function kube::build::docker_build() {
echo
"+++ Building Docker image
${
image
}
. This can take a while."
echo
"+++ Building Docker image
${
image
}
. This can take a while."
set
+e
# We are handling the error here manually
set
+e
# We are handling the error here manually
local
-r
docker_output
=
"
$(${
build_cmd
}
2>&1
)
"
local
-r
docker_output
if
[
$?
-ne
0
]
;
then
docker_output
=
$(${
build_cmd
}
2>&1
)
if
[[
$?
-ne
0
]]
;
then
set
-e
set
-e
echo
"+++ Docker build command failed for
${
image
}
"
>
&2
echo
"+++ Docker build command failed for
${
image
}
"
>
&2
echo
>
&2
echo
>
&2
...
@@ -245,7 +247,7 @@ function kube::build::clean_images() {
...
@@ -245,7 +247,7 @@ function kube::build::clean_images() {
function
kube::build::run_build_command
()
{
function
kube::build::run_build_command
()
{
[[
-n
"
$@
"
]]
||
{
echo
"Invalid input."
>
&2
;
return
4
;
}
[[
-n
"
$@
"
]]
||
{
echo
"Invalid input."
>
&2
;
return
4
;
}
local
-r
docker
=
"docker run --name=
${
DOCKER_CONTAINER_NAME
}
-
it
${
DOCKER_MOUNT
}
${
KUBE_BUILD_IMAGE
}
"
local
-r
docker
=
"docker run --name=
${
DOCKER_CONTAINER_NAME
}
-
-attach=stdout --attach=stderr --attach=stdin --tty
${
DOCKER_MOUNT
}
${
KUBE_BUILD_IMAGE
}
"
# Remove the container if it is left over from some previous aborted run
# Remove the container if it is left over from some previous aborted run
docker
rm
${
DOCKER_CONTAINER_NAME
}
>
/dev/null 2>&1
||
true
docker
rm
${
DOCKER_CONTAINER_NAME
}
>
/dev/null 2>&1
||
true
...
@@ -393,9 +395,13 @@ function kube::release::package_full_tarball() {
...
@@ -393,9 +395,13 @@ function kube::release::package_full_tarball() {
cp
"
${
RELEASE_DIR
}
/kubernetes-salt.tar.gz"
"
${
release_stage
}
/server/"
cp
"
${
RELEASE_DIR
}
/kubernetes-salt.tar.gz"
"
${
release_stage
}
/server/"
cp
"
${
RELEASE_DIR
}
"
/kubernetes-server-
*
.tar.gz
"
${
release_stage
}
/server/"
cp
"
${
RELEASE_DIR
}
"
/kubernetes-server-
*
.tar.gz
"
${
release_stage
}
/server/"
mkdir
-p
"
${
release_stage
}
/third_party"
cp
-R
"
${
KUBE_REPO_ROOT
}
/third_party/htpasswd"
"
${
release_stage
}
/third_party/htpasswd"
cp
-R
"
${
KUBE_REPO_ROOT
}
/examples"
"
${
release_stage
}
/"
cp
-R
"
${
KUBE_REPO_ROOT
}
/examples"
"
${
release_stage
}
/"
cp
"
${
KUBE_REPO_ROOT
}
/README.md"
"
${
release_stage
}
/"
cp
"
${
KUBE_REPO_ROOT
}
/README.md"
"
${
release_stage
}
/"
cp
"
${
KUBE_REPO_ROOT
}
/LICENSE"
"
${
release_stage
}
/"
cp
"
${
KUBE_REPO_ROOT
}
/LICENSE"
"
${
release_stage
}
/"
cp
"
${
KUBE_REPO_ROOT
}
/Vagrantfile"
"
${
release_stage
}
/"
local
package_name
=
"
${
RELEASE_DIR
}
/kubernetes.tar.gz"
local
package_name
=
"
${
RELEASE_DIR
}
/kubernetes.tar.gz"
tar
czf
"
${
package_name
}
"
-C
"
${
release_stage
}
/.."
.
tar
czf
"
${
package_name
}
"
-C
"
${
release_stage
}
/.."
.
...
...
cluster/kube-util.sh
View file @
881cf801
...
@@ -62,7 +62,7 @@ function test-teardown {
...
@@ -62,7 +62,7 @@ function test-teardown {
echo
"TODO"
echo
"TODO"
}
}
# Set the {
user} and {password
} environment values required to interact with provider
# Set the {
KUBE_USER} and {KUBE_PASSWORD
} environment values required to interact with provider
function
get-password
{
function
get-password
{
echo
"TODO"
echo
"TODO"
}
}
cluster/saltbase/pillar/cluster-params.sls
0 → 100644
View file @
881cf801
# This file is meant to be replaced with cluster specific parameters if necessary.
# Examples:
# node_instance_prefix: <base of regex for -minion_regexp to apiserver>
cluster/saltbase/salt/apiserver/default
View file @
881cf801
...
@@ -5,13 +5,17 @@
...
@@ -5,13 +5,17 @@
{% set machines = ""%}
{% set machines = ""%}
{% set cloud_provider = "" %}
{% set cloud_provider = "" %}
{% set minion_regexp = "-minion_regexp=.*" %}
{% if grains.cloud_provider is defined %}
{% if grains.cloud_provider is defined %}
{% set cloud_provider = "-cloud_provider=" + grains.cloud_provider %}
{% set cloud_provider = "-cloud_provider=" + grains.cloud_provider %}
{% endif %}
{% endif %}
{% set minion_regexp = "-minion_regexp='" + pillar['node_instance_prefix'] + ".*'" %}
{% set address = "-address=127.0.0.1" %}
{% set address = "-address=127.0.0.1" %}
{% if pillar['node_instance_prefix'] is defined %}
{% set minion_regexp = "-minion_regexp='" + pillar['node_instance_prefix'] + ".*'" %}
{% endif %}
{% if grains.etcd_servers is defined %}
{% if grains.etcd_servers is defined %}
{% set etcd_servers = "-etcd_servers=http://" + grains.etcd_servers + ":4001" %}
{% set etcd_servers = "-etcd_servers=http://" + grains.etcd_servers + ":4001" %}
{% else %}
{% else %}
...
...
cluster/vagrant/config-default.sh
View file @
881cf801
...
@@ -21,7 +21,6 @@ NUM_MINIONS=${KUBERNETES_NUM_MINIONS-"3"}
...
@@ -21,7 +21,6 @@ NUM_MINIONS=${KUBERNETES_NUM_MINIONS-"3"}
# IP LOCATIONS FOR INTERACTING WITH THE MASTER
# IP LOCATIONS FOR INTERACTING WITH THE MASTER
export
KUBE_MASTER_IP
=
"10.245.1.2"
export
KUBE_MASTER_IP
=
"10.245.1.2"
export
KUBERNETES_MASTER
=
"https://10.245.1.2"
INSTANCE_PREFIX
=
kubernetes
INSTANCE_PREFIX
=
kubernetes
MASTER_NAME
=
"
${
INSTANCE_PREFIX
}
-master"
MASTER_NAME
=
"
${
INSTANCE_PREFIX
}
-master"
...
...
cluster/vagrant/provision-master.sh
View file @
881cf801
...
@@ -18,6 +18,57 @@
...
@@ -18,6 +18,57 @@
set
-e
set
-e
source
$(
dirname
$0
)
/provision-config.sh
source
$(
dirname
$0
)
/provision-config.sh
# # Install Docker on master to run the build. This is a necessary chunk of
# # bootstrapping.
# yum install -y docker-io
# SYSTEMD_LOG_LEVEL=notice systemctl enable docker
# systemctl start docker
# # Build release
# echo "Building release"
# pushd /vagrant
# bash -x ./build/release.sh
# popd
function
release_not_found
()
{
echo
"It looks as if you don't have a compiled version of Kubernetes. If you"
>
&2
echo
"are running from a clone of the git repo, please run ./build/release.sh."
>
&2
echo
"Note that this requires having Docker installed. If you are running "
>
&2
echo
"from a release tarball, something is wrong. Look at "
>
&2
echo
"http://kubernetes.io/ for information on how to contact the development team for help."
>
&2
exit
1
}
# Look for our precompiled binary releases. When running from a source repo,
# these are generated under _output. When running from an release tarball these
# are under ./server.
server_binary_tar
=
"/vagrant/server/kubernetes-server-linux-amd64.tar.gz"
if
[[
!
-f
"
$server_binary_tar
"
]]
;
then
server_binary_tar
=
"/vagrant/_output/release-tars/kubernetes-server-linux-amd64.tar.gz"
fi
if
[[
!
-f
"
$server_binary_tar
"
]]
;
then
release_not_found
fi
salt_tar
=
"/vagrant/server/kubernetes-salt.tar.gz"
if
[[
!
-f
"
$salt_tar
"
]]
;
then
salt_tar
=
"/vagrant/_output/release-tars/kubernetes-salt.tar.gz"
fi
if
[[
!
-f
"
$salt_tar
"
]]
;
then
release_not_found
fi
echo
"Running release install script"
rm
-rf
/kube-install
mkdir
-p
/kube-install
pushd
/kube-install
tar
xzf
"
$salt_tar
"
cp
"
$server_binary_tar
"
.
./kubernetes/saltbase/install.sh
"
${
server_binary_tar
##*/
}
"
popd
# Setup hosts file to support ping by hostname to each minion in the cluster from apiserver
# Setup hosts file to support ping by hostname to each minion in the cluster from apiserver
minion_ip_array
=(
${
MINION_IPS
//,/
}
)
minion_ip_array
=(
${
MINION_IPS
//,/
}
)
for
((
i
=
0
;
i<
${#
MINION_NAMES
[@]
}
;
i++
))
;
do
for
((
i
=
0
;
i<
${#
MINION_NAMES
[@]
}
;
i++
))
;
do
...
@@ -103,19 +154,10 @@ EOF
...
@@ -103,19 +154,10 @@ EOF
SYSTEMD_LOG_LEVEL
=
notice systemctl
enable
salt-api
SYSTEMD_LOG_LEVEL
=
notice systemctl
enable
salt-api
systemctl start salt-api
systemctl start salt-api
else
# Only run highstate when updating the config. In the first-run case, Salt is
# set up to run highstate as new minions join for the first time.
echo
"Executing configuration"
salt
'*'
mine.update
salt
--force-color
'*'
state.highstate
fi
fi
# Build release
echo
"Building release"
pushd
/vagrant
./release/build-release.sh kubernetes
popd
echo
"Running release install script"
pushd
/vagrant/_output/release/master-release/src/scripts
./master-release-install.sh
popd
echo
"Executing configuration"
salt
'*'
mine.update
salt
--force-color
'*'
state.highstate
cluster/vagrant/util.sh
View file @
881cf801
...
@@ -19,8 +19,7 @@
...
@@ -19,8 +19,7 @@
source
$(
dirname
${
BASH_SOURCE
})
/
${
KUBE_CONFIG_FILE
-
"config-default.sh"
}
source
$(
dirname
${
BASH_SOURCE
})
/
${
KUBE_CONFIG_FILE
-
"config-default.sh"
}
function
detect-master
()
{
function
detect-master
()
{
echo
"KUBE_MASTER_IP:
$KUBE_MASTER_IP
"
echo
"KUBE_MASTER_IP:
${
KUBE_MASTER_IP
}
"
echo
"KUBE_MASTER:
$KUBE_MASTER
"
}
}
# Get minion IP addresses and store in KUBE_MINION_IP_ADDRESSES[]
# Get minion IP addresses and store in KUBE_MINION_IP_ADDRESSES[]
...
@@ -31,7 +30,7 @@ function detect-minions {
...
@@ -31,7 +30,7 @@ function detect-minions {
# Verify prereqs on host machine
# Verify prereqs on host machine
function
verify-prereqs
{
function
verify-prereqs
{
for
x
in
vagrant virtualbox
;
do
for
x
in
vagrant virtualbox
;
do
if
[
"
$(
which
$x
)
"
==
""
]
;
then
if
!
which
"
$x
"
>
/dev/null
;
then
echo
"Can't find
$x
in PATH, please fix and retry."
echo
"Can't find
$x
in PATH, please fix and retry."
exit
1
exit
1
fi
fi
...
@@ -40,7 +39,6 @@ function verify-prereqs {
...
@@ -40,7 +39,6 @@ function verify-prereqs {
# Instantiate a kubernetes cluster
# Instantiate a kubernetes cluster
function
kube-up
{
function
kube-up
{
get-password
get-password
vagrant up
vagrant up
...
@@ -51,26 +49,37 @@ function kube-up {
...
@@ -51,26 +49,37 @@ function kube-up {
# verify master has all required daemons
# verify master has all required daemons
echo
"Validating master"
echo
"Validating master"
MACHINE
=
"master"
local
machine
=
"master"
REQUIRED_DAEMON
=(
"salt-master"
"salt-minion"
"apiserver"
"nginx"
"controller-manager"
"scheduler"
)
local
-a
required_daemon
=(
"salt-master"
"salt-minion"
"apiserver"
"nginx"
"controller-manager"
"scheduler"
)
VALIDATED
=
"1"
local
validated
=
"1"
until
[
"
$VALIDATED
"
-eq
"0"
]
;
do
until
[[
"
$validated
"
==
"0"
]]
;
do
VALIDATED
=
"0"
validated
=
"0"
for
daemon
in
${
REQUIRED_DAEMON
[@]
}
;
do
local
daemon
vagrant ssh
$MACHINE
-c
"which
$daemon
"
>
/dev/null 2>&1
||
{
printf
"."
;
VALIDATED
=
"1"
;
sleep
2
;
}
for
daemon
in
"
${
required_daemon
[@]
}
"
;
do
vagrant ssh
"
$machine
"
-c
"which '
${
daemon
}
'"
>
/dev/null 2>&1
||
{
printf
"."
validated
=
"1"
sleep
2
}
done
done
done
done
# verify each minion has all required daemons
# verify each minion has all required daemons
local
i
for
((
i
=
0
;
i<
${#
MINION_NAMES
[@]
}
;
i++
))
;
do
for
((
i
=
0
;
i<
${#
MINION_NAMES
[@]
}
;
i++
))
;
do
echo
"Validating
${
VAGRANT_MINION_NAMES
[
$i
]
}
"
echo
"Validating
${
VAGRANT_MINION_NAMES
[
$i
]
}
"
MACHINE
=
${
VAGRANT_MINION_NAMES
[
$i
]
}
local
machine
=
${
VAGRANT_MINION_NAMES
[
$i
]
}
REQUIRED_DAEMON
=(
"salt-minion"
"kubelet"
"docker"
)
local
-a
required_daemon
=(
"salt-minion"
"kubelet"
"docker"
)
VALIDATED
=
"1"
local
validated
=
"1"
until
[
"
$VALIDATED
"
-eq
"0"
]
;
do
until
[[
"
$validated
"
==
"0"
]]
;
do
VALIDATED
=
"0"
validated
=
"0"
for
daemon
in
${
REQUIRED_DAEMON
[@]
}
;
do
local
daemon
vagrant ssh
$MACHINE
-c
"which
$daemon
"
>
/dev/null 2>&1
||
{
printf
"."
;
VALIDATED
=
"1"
;
sleep
2
;
}
for
daemon
in
"
${
required_daemon
[@]
}
"
;
do
vagrant ssh
"
$machine
"
-c
"which
$daemon
"
>
/dev/null 2>&1
||
{
printf
"."
validated
=
"1"
sleep
2
}
done
done
done
done
done
done
...
@@ -78,11 +87,16 @@ function kube-up {
...
@@ -78,11 +87,16 @@ function kube-up {
echo
echo
echo
"Waiting for each minion to be registered with cloud provider"
echo
"Waiting for each minion to be registered with cloud provider"
for
((
i
=
0
;
i<
${#
MINION_NAMES
[@]
}
;
i++
))
;
do
for
((
i
=
0
;
i<
${#
MINION_NAMES
[@]
}
;
i++
))
;
do
MACHINE
=
"
${
MINION_NAMES
[
$i
]
}
"
local
machine
=
"
${
MINION_NAMES
[
$i
]
}
"
COUNT
=
"0"
local
count
=
"0"
until
[
"
$COUNT
"
-eq
"1"
]
;
do
until
[[
"
$count
"
==
"1"
]]
;
do
$(
dirname
$0
)
/kubecfg.sh
-template
'{{range.Items}}{{.ID}}:{{end}}'
list minions
>
/tmp/minions
local
minions
COUNT
=
$(
grep
-c
${
MINION_NAMES
[i]
}
/tmp/minions
)
||
{
printf
"."
;
sleep
2
;
COUNT
=
"0"
;
}
minions
=
$(
"
$(
dirname
$0
)
/cluster/kubecfg.sh"
-template
'{{range.Items}}{{.ID}}:{{end}}'
list minions
)
count
=
$(
echo
$minions
|
grep
-c
"
${
MINION_NAMES
[i]
}
"
)
||
{
printf
"."
sleep
2
count
=
"0"
}
done
done
done
done
...
@@ -124,8 +138,7 @@ function test-teardown {
...
@@ -124,8 +138,7 @@ function test-teardown {
# Set the {user} and {password} environment values required to interact with provider
# Set the {user} and {password} environment values required to interact with provider
function
get-password
{
function
get-password
{
export
user
=
vagrant
export
KUBE_USER
=
vagrant
export
passwd
=
vagrant
export
KUBE_PASSWORD
=
vagrant
echo
"Using credentials:
$
user
:
$passwd
"
echo
"Using credentials:
$
KUBE_USER
:
$KUBE_PASSWORD
"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment