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
7ce6f226
Commit
7ce6f226
authored
Feb 27, 2015
by
Lénaïc Huard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make kube-up wait for the libvirt-coreos cluster to be ready
so that validate-cluster passes.
parent
a25f2ad2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
util.sh
cluster/libvirt-coreos/util.sh
+28
-0
validate-cluster.sh
cluster/validate-cluster.sh
+7
-2
No files found.
cluster/libvirt-coreos/util.sh
View file @
7ce6f226
...
...
@@ -156,6 +156,25 @@ function render-template {
eval
"echo
\"
$(
cat
$1
)
\"
"
}
function
wait-cluster-readiness
{
echo
"Wait for cluster readiness"
local
kubectl
=
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
local timeout
=
50
while
[[
$timeout
-ne
0
]]
;
do
nb_ready_minions
=
$(
"
${
kubectl
}
"
get minions
-o
template
-t
"{{range.items}}{{range.status.conditions}}{{.kind}}{{end}}:{{end}}"
2>/dev/null |
tr
':'
'\n'
|
grep
-c
Ready
||
true
)
echo
"Nb ready minions:
$nb_ready_minions
/
$NUM_MINIONS
"
if
[[
"
$nb_ready_minions
"
-eq
"
$NUM_MINIONS
"
]]
;
then
return
0
fi
timeout
=
$((
$timeout
-
1
))
sleep
.5
done
return
1
}
# Instantiate a kubernetes cluster
function
kube-up
{
detect-master
...
...
@@ -194,6 +213,15 @@ function kube-up {
virsh create
$domain_xml
rm
$domain_xml
done
wait-cluster-readiness
echo
"Kubernetes cluster is running. The master is running at:"
echo
echo
" http://
${
KUBE_MASTER_IP
}
:8080"
echo
echo
"You can control the Kubernetes cluster with: 'cluster/kubectl.sh'"
echo
"You can connect on the master with: 'ssh core@
${
KUBE_MASTER_IP
}
'"
}
# Delete a kubernetes cluster
...
...
cluster/validate-cluster.sh
View file @
7ce6f226
...
...
@@ -69,7 +69,7 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
fi
name
=
"
${
MINION_NAMES
[
$i
]
}
"
if
[
"
$KUBERNETES_PROVIDER
"
!=
"vsphere"
]
&&
[
"
$KUBERNETES_PROVIDER
"
!=
"vagrant"
]
;
then
if
[
"
$KUBERNETES_PROVIDER
"
!=
"vsphere"
]
&&
[
"
$KUBERNETES_PROVIDER
"
!=
"vagrant"
]
&&
[
"
$KUBERNETES_PROVIDER
"
!=
"libvirt-coreos"
]
;
then
# Grab fully qualified name
name
=
$(
grep
"
${
MINION_NAMES
[
$i
]
}
\.
"
"
${
MINIONS_FILE
}
"
)
fi
...
...
@@ -79,8 +79,13 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
attempt
=
0
while
true
;
do
echo
-n
"Attempt
$((
attempt+1
))
at checking Kubelet installation on node
${
MINION_NAMES
[
$i
]
}
..."
curl_output
=
$(
curl
-s
--insecure
--user
"
${
KUBE_USER
}
:
${
KUBE_PASSWORD
}
"
\
if
[
"
$KUBERNETES_PROVIDER
"
!=
"libvirt-coreos"
]
;
then
curl_output
=
$(
curl
-s
--insecure
--user
"
${
KUBE_USER
}
:
${
KUBE_PASSWORD
}
"
\
"https://
${
KUBE_MASTER_IP
}
/api/v1beta1/proxy/minions/
${
name
}
/healthz"
)
else
curl_output
=
$(
curl
-s
\
"http://
${
KUBE_MASTER_IP
}
:8080/api/v1beta1/proxy/minions/
${
name
}
/healthz"
)
fi
if
[[
"
${
curl_output
}
"
!=
"ok"
]]
;
then
if
((
attempt
>
5
))
;
then
echo
...
...
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