Trusty: Add debug supports for docker and kubelet
This commit is contained in:
		@@ -181,10 +181,14 @@ assemble_kubelet_flags() {
 | 
			
		||||
  fi
 | 
			
		||||
  # 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}"
 | 
			
		||||
  echo "KUBELET_OPTS=\"${KUBELET_CMD_FLAGS}\"" > /etc/default/kubelet
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
  # Make sure the network interface cbr0 is created before restarting docker daemon
 | 
			
		||||
  while ! [ -L /sys/class/net/cbr0 ]; do
 | 
			
		||||
 
 | 
			
		||||
@@ -16,11 +16,9 @@
 | 
			
		||||
 | 
			
		||||
# A library of helper functions and constant for ubuntu os distro
 | 
			
		||||
 | 
			
		||||
# The code and configuration is for running node instances on Ubuntu images.
 | 
			
		||||
# The master is still on Debian. In addition, the configuration is based on
 | 
			
		||||
# upstart, which is in Ubuntu up to 14.04 LTS (Trusty). Ubuntu 15.04 and above
 | 
			
		||||
# replaced upstart with systemd as the init system. Consequently, the
 | 
			
		||||
# configuration cannot work on these images.
 | 
			
		||||
# The configuration is based on upstart, which is in Ubuntu up to 14.04 LTS (Trusty).
 | 
			
		||||
# Ubuntu 15.04 and above replaced upstart with systemd as the init system.
 | 
			
		||||
# Consequently, the configuration cannot work on these images.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# $1: template name (required)
 | 
			
		||||
 
 | 
			
		||||
@@ -61,6 +61,9 @@ script
 | 
			
		||||
	create_master_auth
 | 
			
		||||
	echo "Creating master instance kubelet auth file"
 | 
			
		||||
	create_master_kubelet_auth
 | 
			
		||||
	echo "Assemble kubelet command line"
 | 
			
		||||
	# Kubelet command flags will be written in /etc/default/kubelet
 | 
			
		||||
	assemble_kubelet_flags
 | 
			
		||||
end script
 | 
			
		||||
 | 
			
		||||
--====================================
 | 
			
		||||
@@ -122,12 +125,8 @@ script
 | 
			
		||||
	set -o nounset
 | 
			
		||||
 | 
			
		||||
	echo "Start kubelet upstart job"
 | 
			
		||||
	. /etc/kube-configure-helper.sh
 | 
			
		||||
	. /etc/kube-env
 | 
			
		||||
	# 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
 | 
			
		||||
	. /etc/default/kubelet
 | 
			
		||||
	/usr/bin/kubelet ${KUBELET_OPTS} 1>>/var/log/kubelet.log 2>&1
 | 
			
		||||
end script
 | 
			
		||||
 | 
			
		||||
# Wait for 10s to start kubelet again.
 | 
			
		||||
 
 | 
			
		||||
@@ -59,6 +59,9 @@ script
 | 
			
		||||
	create_kubelet_kubeconfig
 | 
			
		||||
	echo "Creating kube-proxy kubeconfig file"
 | 
			
		||||
	create_kubeproxy_kubeconfig
 | 
			
		||||
	echo "Assemble kubelet command line"
 | 
			
		||||
	# Kubelet command flags will be in /etc/default/kubelet
 | 
			
		||||
	assemble_kubelet_flags
 | 
			
		||||
end script
 | 
			
		||||
 | 
			
		||||
--====================================
 | 
			
		||||
@@ -120,12 +123,8 @@ script
 | 
			
		||||
	set -o nounset
 | 
			
		||||
 | 
			
		||||
	echo "Start kubelet upstart job"
 | 
			
		||||
	. /etc/kube-configure-helper.sh
 | 
			
		||||
	. /etc/kube-env
 | 
			
		||||
	# 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
 | 
			
		||||
	. /etc/default/kubelet
 | 
			
		||||
	/usr/bin/kubelet ${KUBELET_OPTS} 1>>/var/log/kubelet.log 2>&1
 | 
			
		||||
end script
 | 
			
		||||
 | 
			
		||||
# Wait for 10s to start kubelet again.
 | 
			
		||||
@@ -232,8 +231,7 @@ script
 | 
			
		||||
	start_fluentd
 | 
			
		||||
	# Kube-registry-proxy
 | 
			
		||||
	if [ "${ENABLE_CLUSTER_REGISTRY:-}" = "true" ]; then
 | 
			
		||||
		cp /home/kubernetes/kube-manifests/kubernetes/kube-registry-proxy.yaml \
 | 
			
		||||
       /etc/kubernetes/manifests/
 | 
			
		||||
		cp /home/kubernetes/kube-manifests/kubernetes/kube-registry-proxy.yaml /etc/kubernetes/manifests/
 | 
			
		||||
	fi
 | 
			
		||||
end script
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user