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
10d9f723
Commit
10d9f723
authored
Mar 11, 2016
by
Andy Zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trusty: fix several bugs
parent
0af90c19
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
20 deletions
+28
-20
configure.sh
cluster/gce/trusty/configure.sh
+23
-10
master.yaml
cluster/gce/trusty/master.yaml
+4
-5
node.yaml
cluster/gce/trusty/node.yaml
+1
-5
No files found.
cluster/gce/trusty/configure.sh
View file @
10d9f723
...
...
@@ -22,7 +22,8 @@
config_hostname
()
{
# Set the hostname to the short version.
short_hostname
=
$(
hostname
-s
)
host_name
=
$(
curl
--silent
"http://metadata.google.internal/computeMetadata/v1/instance/hostname"
-H
"Metadata-Flavor: Google"
)
short_hostname
=
$(
echo
"
${
host_name
}
"
|
cut
-d
.
-f1
)
hostname
"
${
short_hostname
}
"
}
...
...
@@ -121,8 +122,7 @@ install_critical_packages() {
# Install docker and brctl if they are not in the image.
if
!
which docker
>
/dev/null
;
then
echo
"Do not find docker. Install it."
# We should install the latest qualified docker, which is version 1.8.3 at present.
curl
-sSL
https://get.docker.com/ |
DOCKER_VERSION
=
1.8.3 sh
curl
-fsSL
https://get.docker.com/ | sh
fi
if
!
which brctl
>
/dev/null
;
then
echo
"Do not find brctl. Install it."
...
...
@@ -132,18 +132,22 @@ install_critical_packages() {
# Install the packages that are useful but not required by spinning up a cluster.
install_additional_packages
()
{
# Socat and nsenter are not required for spinning up a cluster. We move the
# installation here to be in parallel with the cluster creation.
if
!
which socat
>
/dev/null
;
then
echo
"Do not find socat. Install it."
apt-get
install
--yes
socat
fi
if
!
which nsenter
>
/dev/null
;
then
echo
"Do not find nsenter. Install it."
# Note: this is an easy way to install nsenter, but may not be the fastest
# way. In addition, this may not be a trusted source. So, replace it if
# we have a better solution.
docker run
--rm
-v
/usr/local/bin:/target jpetazzo/nsenter
mkdir
-p
/tmp/nsenter-install
cd
/tmp/nsenter-install
curl https://www.kernel.org/pub/linux/utils/util-linux/v2.24/util-linux-2.24.tar.gz |
tar
-zxf-
apt-get
--yes
install
make
apt-get
--yes
install
gcc
cd
util-linux-2.24
./configure
--without-ncurses
make nsenter
cp
nsenter /usr/local/bin
rm
-rf
/tmp/nsenter-install
fi
}
...
...
@@ -287,10 +291,15 @@ restart_docker_daemon() {
echo
"Sleep 1 second to wait for cbr0"
sleep
1
done
initctl restart docker
# Remove docker0
ifconfig docker0 down
brctl delbr docker0
# Ensure docker daemon is really functional before exiting. Operations afterwards may
# assume it is running.
while
!
docker version
>
/dev/null
;
do
echo
"Sleep 1 second to wait for docker daemon"
sleep
1
done
}
# Create the log file and set its properties.
...
...
@@ -312,10 +321,14 @@ health_monitoring() {
if
!
timeout
10 docker version
>
/dev/null
;
then
echo
"Docker daemon failed!"
pkill docker
# Wait for a while, as we don't want to kill it again before it is really up.
sleep
30
fi
if
!
curl
--insecure
-m
"
${
max_seconds
}
"
-f
-s
https://127.0.0.1:
${
KUBELET_PORT
:-
10250
}
/healthz
>
/dev/null
;
then
echo
"Kubelet is unhealthy!"
pkill kubelet
# Wait for a while, as we don't want to kill it again before it is really up.
sleep
60
fi
sleep
"
${
sleep_seconds
}
"
done
...
...
cluster/gce/trusty/master.yaml
View file @
10d9f723
...
...
@@ -144,7 +144,6 @@ script
--system-cgroups=/system \
--runtime-cgroups=/docker-daemon \
--kubelet-cgroups=/kubelet \
--babysit-daemons=true \
${KUBELET_CMD_FLAGS} 1>>/var/log/kubelet.log 2>&1
end script
...
...
@@ -161,10 +160,7 @@ Content-Disposition: attachment; filename="kube-docker.conf"
description "Restart docker daemon"
# The condition "stopped kube-install-additional-packages" is to avoid
# breaking nsenter installation, which is through a docker container.
# It can be removed if we find a better way to install nsenter.
start on started kubelet and stopped kube-install-additional-packages
start on started kubelet
script
set -o errexit
...
...
@@ -255,6 +251,9 @@ script
set -o errexit
set -o nounset
# Wait for a minute to let docker and kubelet processes finish initialization.
# TODO(andyzheng0831): replace it with a more reliable method if possible.
sleep 60
. /etc/kube-configure.sh
. /etc/kube-env
health_monitoring
...
...
cluster/gce/trusty/node.yaml
View file @
10d9f723
...
...
@@ -143,7 +143,6 @@ script
--system-cgroups=/system \
--runtime-cgroups=/docker-daemon \
--kubelet-cgroups=/kubelet \
--babysit-daemons=true \
${KUBELET_CMD_FLAGS} 1>>/var/log/kubelet.log 2>&1
end script
...
...
@@ -160,10 +159,7 @@ Content-Disposition: attachment; filename="kube-docker.conf"
description "Restart docker daemon"
# The condition "stopped kube-install-additional-packages" is to avoid
# breaking nsenter installation, which is through a docker container.
# It can be removed if we find a better way to install nsenter.
start on started kubelet and stopped kube-install-additional-packages
start on started kubelet
script
set -o errexit
...
...
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