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
63494f6f
Commit
63494f6f
authored
May 11, 2016
by
Andy Zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GCI: Ensure that the right version of kubelet is used
parent
7e7465e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
configure.sh
cluster/gce/trusty/configure.sh
+21
-4
No files found.
cluster/gce/trusty/configure.sh
View file @
63494f6f
...
@@ -122,17 +122,34 @@ install_kube_binary_config() {
...
@@ -122,17 +122,34 @@ install_kube_binary_config() {
# a test cluster.
# a test cluster.
readonly
BIN_PATH
=
"/usr/bin"
readonly
BIN_PATH
=
"/usr/bin"
if
!
which kubelet
>
/dev/null
||
!
which kubectl
>
/dev/null
;
then
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
}
/kubelet"
"
${
BIN_PATH
}
"
cp
"
${
src_dir
}
/kubectl"
"
${
BIN_PATH
}
"
cp
"
${
src_dir
}
/kubectl"
"
${
BIN_PATH
}
"
elif
[
"
${
TEST_CLUSTER
:-}
"
=
"true"
]
;
then
else
kube_bin
=
"
${
kube_home
}
/bin"
# This should be the case of GCI.
readonly
kube_bin
=
"
${
kube_home
}
/bin"
mkdir
-p
"
${
kube_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
}
/kubelet"
"
${
kube_bin
}
"
cp
"
${
src_dir
}
/kubectl"
"
${
kube_bin
}
"
cp
"
${
src_dir
}
/kubectl"
"
${
kube_bin
}
"
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
}
/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
"
${
kube_bin
}
/kubectl"
"
${
BIN_PATH
}
/kubectl"
mount
--bind
-o
remount,ro,^noexec
"
${
BIN_PATH
}
/kubectl"
"
${
BIN_PATH
}
/kubectl"
else
# Remove downloaded binary just to prevent misuse.
rm
-f
"
${
kube_bin
}
/kubelet"
rm
-f
"
${
kube_bin
}
/kubectl"
fi
fi
fi
# Put kube-system pods manifests in /home/kubernetes/kube-manifests/.
# 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