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
01cf9869
Commit
01cf9869
authored
May 18, 2016
by
Daniel Smith
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #25504 from andyzheng0831/binary
GCI: Ensure that the right version of kubelet is used
parents
6dc14370
63494f6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
configure.sh
cluster/gce/trusty/configure.sh
+23
-6
No files found.
cluster/gce/trusty/configure.sh
View file @
01cf9869
...
...
@@ -122,17 +122,34 @@ install_kube_binary_config() {
# a test cluster.
readonly
BIN_PATH
=
"/usr/bin"
if
!
which kubelet
>
/dev/null
||
!
which kubectl
>
/dev/null
;
then
# This should be the case of trusty.
cp
"
${
src_dir
}
/kubelet"
"
${
BIN_PATH
}
"
cp
"
${
src_dir
}
/kubectl"
"
${
BIN_PATH
}
"
elif
[
"
${
TEST_CLUSTER
:-}
"
=
"true"
]
;
then
kube_bin
=
"
${
kube_home
}
/bin"
else
# This should be the case of GCI.
readonly
kube_bin
=
"
${
kube_home
}
/bin"
mkdir
-p
"
${
kube_bin
}
"
mount
--bind
"
${
kube_bin
}
"
"
${
kube_bin
}
"
mount
-o
remount,rw,exec
"
${
kube_bin
}
"
cp
"
${
src_dir
}
/kubelet"
"
${
kube_bin
}
"
cp
"
${
src_dir
}
/kubectl"
"
${
kube_bin
}
"
mount
--bind
"
${
kube_bin
}
/kubelet"
"
${
BIN_PATH
}
/kubelet"
mount
--bind
-o
remount,ro,^noexec
"
${
BIN_PATH
}
/kubelet"
"
${
BIN_PATH
}
/kubelet"
mount
--bind
"
${
kube_bin
}
/kubectl"
"
${
BIN_PATH
}
/kubectl"
mount
--bind
-o
remount,ro,^noexec
"
${
BIN_PATH
}
/kubectl"
"
${
BIN_PATH
}
/kubectl"
chmod
544
"
${
kube_bin
}
/kubelet"
chmod
544
"
${
kube_bin
}
/kubectl"
# If the built-in binary version is different from the expected version, we use
# the downloaded binary. The simplest implementation is to always use the downloaded
# binary without checking the version. But we have another version guardian in GKE.
# So, we compare the versions to ensure this run-time binary replacement is only
# applied for OSS kubernetes.
readonly
builtin_version
=
"
$(
/usr/bin/kubelet
--version
=
true
|
cut
-f2
-d
" "
)
"
readonly
required_version
=
"
$(
/home/kubernetes/bin/kubelet
--version
=
true
|
cut
-f2
-d
" "
)
"
if
[
"
${
TEST_CLUSTER
:-}
"
=
"true"
]
||
[
"
${
builtin_version
}
"
!=
"
${
required_version
}
"
]
;
then
mount
--bind
"
${
kube_bin
}
/kubelet"
"
${
BIN_PATH
}
/kubelet"
mount
--bind
"
${
kube_bin
}
/kubectl"
"
${
BIN_PATH
}
/kubectl"
else
# Remove downloaded binary just to prevent misuse.
rm
-f
"
${
kube_bin
}
/kubelet"
rm
-f
"
${
kube_bin
}
/kubectl"
fi
fi
# Put kube-system pods manifests in /home/kubernetes/kube-manifests/.
...
...
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