diff --git a/cluster/gce/configure-vm.sh b/cluster/gce/configure-vm.sh index 5ee5a5d6733..353561adacb 100755 --- a/cluster/gce/configure-vm.sh +++ b/cluster/gce/configure-vm.sh @@ -288,7 +288,11 @@ manifest_url_header: '$(echo "$MANIFEST_URL_HEADER" | sed -e "s/'/''/g")' num_nodes: $(echo "${NUM_NODES}") e2e_storage_test_environment: '$(echo "$E2E_STORAGE_TEST_ENVIRONMENT" | sed -e "s/'/''/g")' EOF - + if [ -n "${KUBELET_PORT:-}" ]; then + cat <>/srv/salt-overlay/pillar/cluster-params.sls +kubelet_port: '$(echo "$KUBELET_PORT" | sed -e "s/'/''/g")' +EOF + fi if [ -n "${APISERVER_TEST_ARGS:-}" ]; then cat <>/srv/salt-overlay/pillar/cluster-params.sls apiserver_test_args: '$(echo "$APISERVER_TEST_ARGS" | sed -e "s/'/''/g")' diff --git a/cluster/gce/trusty/node.yaml b/cluster/gce/trusty/node.yaml index fde84c1e5b5..e57e609e59c 100644 --- a/cluster/gce/trusty/node.yaml +++ b/cluster/gce/trusty/node.yaml @@ -262,7 +262,8 @@ script echo "Docker daemon failed!" pkill docker fi - if ! curl --insecure -m ${max_seconds} -f -s https://127.0.0.1:10250/healthz > /dev/null; then + . /etc/kube-env + 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 fi diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 42b356ce98c..4bfc56bc0de 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -1303,6 +1303,11 @@ OPENCONTRAIL_KUBERNETES_TAG: $(yaml-quote ${OPENCONTRAIL_KUBERNETES_TAG:-}) OPENCONTRAIL_PUBLIC_SUBNET: $(yaml-quote ${OPENCONTRAIL_PUBLIC_SUBNET:-}) E2E_STORAGE_TEST_ENVIRONMENT: $(yaml-quote ${E2E_STORAGE_TEST_ENVIRONMENT:-}) EOF + if [ -n "${KUBELET_PORT:-}" ]; then + cat >>$file <>$file < /dev/null; then + if ! curl --insecure -m ${max_seconds} -f -s https://127.0.0.1:{{kubelet_port}}/healthz > /dev/null; then echo "kubelet failed!" exit 2 fi diff --git a/cmd/kubelet/app/server.go b/cmd/kubelet/app/server.go index 69408ab6ac0..69858076b7e 100644 --- a/cmd/kubelet/app/server.go +++ b/cmd/kubelet/app/server.go @@ -273,7 +273,7 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&s.ManifestURLHeader, "manifest-url-header", s.ManifestURLHeader, "HTTP header to use when accessing the manifest URL, with the key separated from the value with a ':', as in 'key:value'") fs.BoolVar(&s.EnableServer, "enable-server", s.EnableServer, "Enable the Kubelet's server") fs.IPVar(&s.Address, "address", s.Address, "The IP address for the Kubelet to serve on (set to 0.0.0.0 for all interfaces)") - fs.UintVar(&s.Port, "port", s.Port, "The port for the Kubelet to serve on. Note that \"kubectl logs\" will not work if you set this flag.") // see #9325 + fs.UintVar(&s.Port, "port", s.Port, "The port for the Kubelet to serve on.") fs.UintVar(&s.ReadOnlyPort, "read-only-port", s.ReadOnlyPort, "The read-only port for the Kubelet to serve on with no authentication/authorization (set to 0 to disable)") fs.StringVar(&s.TLSCertFile, "tls-cert-file", s.TLSCertFile, ""+ "File containing x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert). "+ diff --git a/docs/admin/kubelet.md b/docs/admin/kubelet.md index 6ccfc324819..69262a1ac01 100644 --- a/docs/admin/kubelet.md +++ b/docs/admin/kubelet.md @@ -118,7 +118,7 @@ kubelet --oom-score-adj=-999: The oom-score-adj value for kubelet process. Values must be within the range [-1000, 1000] --pod-cidr="": The CIDR to use for pod IP addresses, only used in standalone mode. In cluster mode, this is obtained from the master. --pod-infra-container-image="gcr.io/google_containers/pause:2.0": The image whose network/ipc namespaces containers in each pod will use. - --port=10250: The port for the Kubelet to serve on. Note that "kubectl logs" will not work if you set this flag. + --port=10250: The port for the Kubelet to serve on. --read-only-port=10255: The read-only port for the Kubelet to serve on with no authentication/authorization (set to 0 to disable) --really-crash-for-testing[=false]: If true, when panics occur crash. Intended for testing. --reconcile-cidr[=true]: Reconcile node CIDR with the CIDR specified by the API server. No-op if register-node or configure-cbr0 is false. [default=true] @@ -140,7 +140,7 @@ kubelet --tls-private-key-file="": File containing x509 private key matching --tls-cert-file. ``` -###### Auto generated by spf13/cobra on 24-Nov-2015 +###### Auto generated by spf13/cobra on 4-Dec-2015