Change:
https://k8s- https://k8s- https://k8s- https://k8s- https://k8s- ... A lot of them /cc
/assign
Still see this failure after is merged, although less frequently: https://k8s- https://k8s- Reopen.
Looks like the client doesn't differentiate between 500 and 503 here: It should. Will open a fix shortly
opened
fix merged, will monitor https://k8s-
Thanks! :)
haven't seen this in the 12 hours since the fix merged, was seeing it every 2-3 hours before. /close

Discussion:
location.Scheme = "https" rloc, err := r.serviceResolver.ResolveEndpoint(handlingInfo.serviceNamespace, handlingInfo.serviceName) if err != nil { <del> http.Error(w, fmt.Sprintf("missing route (%s)", err.Error()), http.StatusInternalServerError) </del> <ins> glog.Errorf("error resolving %s/%s: %v", handlingInfo.serviceNamespace, handlingInfo.serviceName, err) http.Error(w, "service unavailable", http.StatusServiceUnavailable) </ins> return } location.Host = rloc.Host

import ( "crypto/tls" <ins> "fmt" </ins> "io/ioutil" "net/http" "net/http/httptest"

type mockedRouter struct { destinationHost string <ins> err             error </ins> } func (r *mockedRouter) ResolveEndpoint(namespace, name string) (*url.URL, error) { <del> return &url.URL{ Scheme: "https", Host:   r.destinationHost, }, nil </del> <ins> return &url.URL{Scheme: "https", Host: r.destinationHost}, r.err </ins> } func TestProxyHandler(t *testing.T) {

path       string apiService *apiregistration.APIService <ins> serviceResolver ServiceResolver </ins> expectedStatusCode int expectedBody       string expectedCalled     bool

}, expectedStatusCode: http.StatusServiceUnavailable, }, <ins> "service unresolveable": { user: &user.DefaultInfo{ Name:   "username", Groups: []string{"one", "two"}, }, path:            "/request/path", serviceResolver: &mockedRouter{err: fmt.Errorf("unresolveable")}, apiService: &apiregistration.APIService{ ObjectMeta: metav1.ObjectMeta{Name: "v1.foo"}, Spec: apiregistration.APIServiceSpec{ Service:  &apiregistration.ServiceReference{Name: "bad-service", Namespace: "test-ns"}, Group:    "foo", Version:  "v1", CABundle: testCACrt, }, Status: apiregistration.APIServiceStatus{ Conditions: []apiregistration.APIServiceCondition{ {Type: apiregistration.Available, Status: apiregistration.ConditionTrue}, }, }, }, expectedStatusCode: http.StatusServiceUnavailable, }, </ins> "fail on bad serving cert": { user: &user.DefaultInfo{ Name:   "username",

target.Reset() func() { <ins> serviceResolver := tc.serviceResolver if serviceResolver == nil { serviceResolver = &mockedRouter{destinationHost: targetServer.Listener.Addr().String()} } </ins> handler := &proxyHandler{ localDelegate:   http.NewServeMux(), <del> serviceResolver: &mockedRouter{destinationHost: targetServer.Listener.Addr().String()}, </del> <ins> serviceResolver: serviceResolver, </ins> proxyTransport:  &http.Transport{}, } handler.contextMapper = &fakeRequestContextMapper{user: tc.user}

}) framework.ExpectNoError(err, "creating role binding %s:sample-apiserver to access configMap", namespace) <ins> // Wait for the extension apiserver to be up and healthy // kubectl get deployments -n <aggregated-api-namespace> && status == Running // NOTE: aggregated apis should generally be set up in there own namespace (<aggregated-api-namespace>). As the test framework // is setting up a new namespace, we are just using that. err = framework.WaitForDeploymentComplete(client, deployment) framework.ExpectNoError(err, "deploying extension apiserver in namespace %s", namespace) </ins> // kubectl create -f apiservice.yaml _, err = aggrclient.ApiregistrationV1beta1().APIServices().Create(&apiregistrationv1beta1.APIService{ ObjectMeta: metav1.ObjectMeta{Name: "v1alpha1.wardle.k8s.io"},

}) framework.ExpectNoError(err, "creating apiservice %s with namespace %s", "v1alpha1.wardle.k8s.io", namespace) <del> // Wait for the extension apiserver to be up and healthy // kubectl get deployments -n <aggregated-api-namespace> && status == Running // NOTE: aggregated apis should generally be set up in there own namespace (<aggregated-api-namespace>). As the test framework // is setting up a new namespace, we are just using that. err = framework.WaitForDeploymentComplete(client, deployment) </del> err = wait.Poll(100*time.Millisecond, 30*time.Second, func() (bool, error) { request := restClient.Get().AbsPath("/apis/wardle.k8s.io/v1alpha1/namespaces/default/flunders") request.SetHeader("Accept", "application/json")

if apierrs.IsMethodNotSupported(err) || apierrs.IsNotFound(err) || apierrs.IsForbidden(err) { continue } <ins> // skip unavailable servers if apierrs.IsServiceUnavailable(err) { continue } </ins> return false, err } unstructuredList, ok := obj.(*unstructured.UnstructuredList)