Skip to content

Commit

Permalink
Merge pull request kubernetes#1884 from lavalamp/fix4
Browse files Browse the repository at this point in the history
Get rid of old minion proxy code in favor of new, better proxy code
  • Loading branch information
thockin committed Oct 20, 2014
2 parents 7c9ac6a + bf942e8 commit c5388e9
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 316 deletions.
12 changes: 9 additions & 3 deletions cluster/validate-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ detect-master > /dev/null
detect-minions > /dev/null

MINIONS_FILE=/tmp/minions
"${KUBE_ROOT}/cluster/kubecfg.sh" -template '{{range.Items}}{{.ID}}:{{end}}' list minions > ${MINIONS_FILE}
"${KUBE_ROOT}/cluster/kubecfg.sh" -template $'{{range.Items}}{{.ID}}\n{{end}}' list minions > ${MINIONS_FILE}

# On vSphere, use minion IPs as their names
if [ "$KUBERNETES_PROVIDER" == "vsphere" ]; then
Expand All @@ -46,13 +46,19 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
# Grep returns an exit status of 1 when line is not found, so we need the : to always return a 0 exit status
count=$(grep -c ${MINION_NAMES[i]} ${MINIONS_FILE}) || :
if [[ "$count" == "0" ]]; then
echo "Failed to find ${MINION_NAMES[i]}, cluster is probably broken."
echo "Failed to find ${MINION_NAMES[$i]}, cluster is probably broken."
exit 1
fi

NAME=${MINION_NAMES[i]}
if [ "$KUBERNETES_PROVIDER" != "vsphere" ]; then
# Grab fully qualified name
NAME=$(grep "${MINION_NAMES[i]}" ${MINIONS_FILE})
fi

# Make sure the kubelet is healthy
curl_output=$(curl -s --insecure --user "${KUBE_USER}:${KUBE_PASSWORD}" \
"https://${KUBE_MASTER_IP}/proxy/minion/${MINION_NAMES[$i]}/healthz")
"https://${KUBE_MASTER_IP}/api/v1beta1/proxy/minions/${NAME}/healthz")
if [[ "${curl_output}" != "ok" ]]; then
echo "Kubelet failed to install on ${MINION_NAMES[$i]}. Your cluster is unlikely to work correctly."
echo "Please run ./cluster/kube-down.sh and re-create the cluster. (sorry!)"
Expand Down
4 changes: 2 additions & 2 deletions cmd/controller-manager/controller-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/controller"
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/healthz"
masterPkg "github.com/GoogleCloudPlatform/kubernetes/pkg/master"
"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
"github.com/GoogleCloudPlatform/kubernetes/pkg/service"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
"github.com/golang/glog"
)

var (
port = flag.Int("port", masterPkg.ControllerManagerPort, "The port that the controller-manager's http service runs on")
port = flag.Int("port", ports.ControllerManagerPort, "The port that the controller-manager's http service runs on")
address = util.IP(net.ParseIP("127.0.0.1"))
clientConfig = &client.Config{}
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubelet/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/healthz"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet"
kconfig "github.com/GoogleCloudPlatform/kubernetes/pkg/kubelet/config"
"github.com/GoogleCloudPlatform/kubernetes/pkg/master"
"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
"github.com/coreos/go-etcd/etcd"
Expand All @@ -55,7 +55,7 @@ var (
manifestURL = flag.String("manifest_url", "", "URL for accessing the container manifest")
enableServer = flag.Bool("enable_server", true, "Enable the info server")
address = util.IP(net.ParseIP("127.0.0.1"))
port = flag.Uint("port", master.KubeletPort, "The port for the info server to serve on")
port = flag.Uint("port", ports.KubeletPort, "The port for the info server to serve on")
hostnameOverride = flag.String("hostname_override", "", "If non-empty, will use this string as identification instead of the actual hostname.")
networkContainerImage = flag.String("network_container_image", kubelet.NetworkContainerImage, "The image that network containers in each pod will use.")
dockerEndpoint = flag.String("docker_endpoint", "", "If non-empty, use this for the docker endpoint to communicate with")
Expand Down
1 change: 0 additions & 1 deletion pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func (g *APIGroup) InstallREST(mux mux, paths ...string) {
// InstallSupport registers the APIServer support functions into a mux.
func InstallSupport(mux mux) {
healthz.InstallHandler(mux)
mux.Handle("/proxy/minion/", http.StripPrefix("/proxy/minion", http.HandlerFunc(handleProxyMinion)))
mux.HandleFunc("/version", handleVersion)
mux.HandleFunc("/", handleIndex)
}
Expand Down
157 changes: 0 additions & 157 deletions pkg/apiserver/minionproxy.go

This file was deleted.

144 changes: 0 additions & 144 deletions pkg/apiserver/minionproxy_test.go

This file was deleted.

19 changes: 19 additions & 0 deletions pkg/master/ports/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package ports defines ports used by various pieces of the kubernetes
// infrastructure.
package ports
Loading

0 comments on commit c5388e9

Please sign in to comment.