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
a68f4fa1
Commit
a68f4fa1
authored
Mar 31, 2015
by
Victor Marmol
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6200 from ArtfulCoder/retry_addon_creation
Retry kube-addons creation if kube-addons creation fails.
parents
d11189f4
541219db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
initd
cluster/saltbase/salt/kube-addons/initd
+21
-2
No files found.
cluster/saltbase/salt/kube-addons/initd
View file @
a68f4fa1
...
@@ -26,14 +26,32 @@ KUBECTL=/usr/local/bin/kubectl
...
@@ -26,14 +26,32 @@ KUBECTL=/usr/local/bin/kubectl
# and status_of_proc is working.
# and status_of_proc is working.
.
/lib/lsb/init-functions
.
/lib/lsb/init-functions
# $1 addon to start.
# $2 count of tries to start the addon.
# $3 delay in seconds between two consecutive tries
function
start_addon
()
{
addon
=
$1
;
tries
=
$2
;
delay
=
$3
;
while
[
${
tries
}
-gt
0
]
;
do
${
KUBECTL
}
create
-f
${
addon
}
&&
\
echo
"== Successfully started
${
addon
}
at
$(
date
-Is
)
"
&&
\
return
0
;
let
tries
=
tries-1
;
echo
"== Failed to start
${
addon
}
at
$(
date
-Is
)
.
${
tries
}
tries remaining. =="
sleep
${
delay
}
;
done
return
1
;
}
function
addon_manager_async
()
{
function
addon_manager_async
()
{
# The business logic for whether a given object should be created
# The business logic for whether a given object should be created
# was already enforced by salt, and /etc/kubernetes/addons is the
# was already enforced by salt, and /etc/kubernetes/addons is the
# managed result is of that. Start everything below that directory.
# managed result is of that. Start everything below that directory.
echo
"== Kubernetes addon manager started at
$(
date
-Is
)
=="
echo
"== Kubernetes addon manager started at
$(
date
-Is
)
=="
for
obj
in
$(
find /etc/kubernetes/addons
-name
\*
.yaml
)
;
do
for
obj
in
$(
find /etc/kubernetes/addons
-name
\*
.yaml
)
;
do
${
KUBECTL
}
create
-f
${
obj
}
&
start_addon
${
obj
}
100 10
&
echo
"++ addon
${
obj
}
started
in pid
$!
++"
echo
"++ addon
${
obj
}
starting
in pid
$!
++"
done
done
noerrors
=
"true"
noerrors
=
"true"
for
pid
in
$(
jobs
-p
)
;
do
for
pid
in
$(
jobs
-p
)
;
do
...
@@ -52,6 +70,7 @@ function addon_manager_async() {
...
@@ -52,6 +70,7 @@ function addon_manager_async() {
sleep
infinity
sleep
infinity
}
}
#
#
# Function that starts the daemon/service
# Function that starts the daemon/service
#
#
...
...
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