mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 06:43:54 +00:00
Trusty: Add debug supports for docker and kubelet
This commit is contained in:
parent
a0e4a80eb4
commit
b8fd9e1a8d
@ -181,10 +181,14 @@ assemble_kubelet_flags() {
|
|||||||
fi
|
fi
|
||||||
# Add the unconditional flags
|
# Add the unconditional flags
|
||||||
KUBELET_CMD_FLAGS="${KUBELET_CMD_FLAGS} --cloud-provider=gce --allow-privileged=true --cgroup-root=/ --system-cgroups=/system --kubelet-cgroups=/kubelet --babysit-daemons=true --config=/etc/kubernetes/manifests --cluster-dns=${DNS_SERVER_IP} --cluster-domain=${DNS_DOMAIN}"
|
KUBELET_CMD_FLAGS="${KUBELET_CMD_FLAGS} --cloud-provider=gce --allow-privileged=true --cgroup-root=/ --system-cgroups=/system --kubelet-cgroups=/kubelet --babysit-daemons=true --config=/etc/kubernetes/manifests --cluster-dns=${DNS_SERVER_IP} --cluster-domain=${DNS_DOMAIN}"
|
||||||
|
echo "KUBELET_OPTS=\"${KUBELET_CMD_FLAGS}\"" > /etc/default/kubelet
|
||||||
}
|
}
|
||||||
|
|
||||||
restart_docker_daemon() {
|
restart_docker_daemon() {
|
||||||
readonly DOCKER_OPTS="-p /var/run/docker.pid --bridge=cbr0 --iptables=false --ip-masq=false"
|
DOCKER_OPTS="-p /var/run/docker.pid --bridge=cbr0 --iptables=false --ip-masq=false"
|
||||||
|
if [ "${TEST_CLUSTER:-}" = "true" ]; then
|
||||||
|
DOCKER_OPTS="${DOCKER_OPTS} --debug"
|
||||||
|
fi
|
||||||
echo "DOCKER_OPTS=\"${DOCKER_OPTS} ${EXTRA_DOCKER_OPTS:-}\"" > /etc/default/docker
|
echo "DOCKER_OPTS=\"${DOCKER_OPTS} ${EXTRA_DOCKER_OPTS:-}\"" > /etc/default/docker
|
||||||
# Make sure the network interface cbr0 is created before restarting docker daemon
|
# Make sure the network interface cbr0 is created before restarting docker daemon
|
||||||
while ! [ -L /sys/class/net/cbr0 ]; do
|
while ! [ -L /sys/class/net/cbr0 ]; do
|
||||||
|
@ -16,11 +16,9 @@
|
|||||||
|
|
||||||
# A library of helper functions and constant for ubuntu os distro
|
# A library of helper functions and constant for ubuntu os distro
|
||||||
|
|
||||||
# The code and configuration is for running node instances on Ubuntu images.
|
# The configuration is based on upstart, which is in Ubuntu up to 14.04 LTS (Trusty).
|
||||||
# The master is still on Debian. In addition, the configuration is based on
|
# Ubuntu 15.04 and above replaced upstart with systemd as the init system.
|
||||||
# upstart, which is in Ubuntu up to 14.04 LTS (Trusty). Ubuntu 15.04 and above
|
# Consequently, the configuration cannot work on these images.
|
||||||
# replaced upstart with systemd as the init system. Consequently, the
|
|
||||||
# configuration cannot work on these images.
|
|
||||||
|
|
||||||
|
|
||||||
# $1: template name (required)
|
# $1: template name (required)
|
||||||
|
@ -60,7 +60,10 @@ script
|
|||||||
echo "Creating kubernetes master auth file"
|
echo "Creating kubernetes master auth file"
|
||||||
create_master_auth
|
create_master_auth
|
||||||
echo "Creating master instance kubelet auth file"
|
echo "Creating master instance kubelet auth file"
|
||||||
create_master_kubelet_auth
|
create_master_kubelet_auth
|
||||||
|
echo "Assemble kubelet command line"
|
||||||
|
# Kubelet command flags will be written in /etc/default/kubelet
|
||||||
|
assemble_kubelet_flags
|
||||||
end script
|
end script
|
||||||
|
|
||||||
--====================================
|
--====================================
|
||||||
@ -122,12 +125,8 @@ script
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
echo "Start kubelet upstart job"
|
echo "Start kubelet upstart job"
|
||||||
. /etc/kube-configure-helper.sh
|
. /etc/default/kubelet
|
||||||
. /etc/kube-env
|
/usr/bin/kubelet ${KUBELET_OPTS} 1>>/var/log/kubelet.log 2>&1
|
||||||
# Assemble command line flags based on env variables, which will put the string
|
|
||||||
# of flags in variable KUBELET_CMD_FLAGS
|
|
||||||
assemble_kubelet_flags
|
|
||||||
/usr/bin/kubelet ${KUBELET_CMD_FLAGS} 1>>/var/log/kubelet.log 2>&1
|
|
||||||
end script
|
end script
|
||||||
|
|
||||||
# Wait for 10s to start kubelet again.
|
# Wait for 10s to start kubelet again.
|
||||||
|
@ -59,6 +59,9 @@ script
|
|||||||
create_kubelet_kubeconfig
|
create_kubelet_kubeconfig
|
||||||
echo "Creating kube-proxy kubeconfig file"
|
echo "Creating kube-proxy kubeconfig file"
|
||||||
create_kubeproxy_kubeconfig
|
create_kubeproxy_kubeconfig
|
||||||
|
echo "Assemble kubelet command line"
|
||||||
|
# Kubelet command flags will be in /etc/default/kubelet
|
||||||
|
assemble_kubelet_flags
|
||||||
end script
|
end script
|
||||||
|
|
||||||
--====================================
|
--====================================
|
||||||
@ -120,12 +123,8 @@ script
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
echo "Start kubelet upstart job"
|
echo "Start kubelet upstart job"
|
||||||
. /etc/kube-configure-helper.sh
|
. /etc/default/kubelet
|
||||||
. /etc/kube-env
|
/usr/bin/kubelet ${KUBELET_OPTS} 1>>/var/log/kubelet.log 2>&1
|
||||||
# Assemble command line flags based on env variables, which will put the string
|
|
||||||
# of flags in variable KUBELET_CMD_FLAGS.
|
|
||||||
assemble_kubelet_flags
|
|
||||||
/usr/bin/kubelet ${KUBELET_CMD_FLAGS} 1>>/var/log/kubelet.log 2>&1
|
|
||||||
end script
|
end script
|
||||||
|
|
||||||
# Wait for 10s to start kubelet again.
|
# Wait for 10s to start kubelet again.
|
||||||
@ -232,8 +231,7 @@ script
|
|||||||
start_fluentd
|
start_fluentd
|
||||||
# Kube-registry-proxy
|
# Kube-registry-proxy
|
||||||
if [ "${ENABLE_CLUSTER_REGISTRY:-}" = "true" ]; then
|
if [ "${ENABLE_CLUSTER_REGISTRY:-}" = "true" ]; then
|
||||||
cp /home/kubernetes/kube-manifests/kubernetes/kube-registry-proxy.yaml \
|
cp /home/kubernetes/kube-manifests/kubernetes/kube-registry-proxy.yaml /etc/kubernetes/manifests/
|
||||||
/etc/kubernetes/manifests/
|
|
||||||
fi
|
fi
|
||||||
end script
|
end script
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user