From 14ae787b404fe11f7af93cb19e9d3d4eda5f7720 Mon Sep 17 00:00:00 2001 From: Giancarlo Rubio Date: Tue, 10 Jan 2017 11:48:25 +0100 Subject: [PATCH 1/7] FIX: ingress was not creating the endpoint when target port is string --- core/pkg/ingress/controller/controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pkg/ingress/controller/controller.go b/core/pkg/ingress/controller/controller.go index 46679ee99..d2184eb1b 100644 --- a/core/pkg/ingress/controller/controller.go +++ b/core/pkg/ingress/controller/controller.go @@ -975,7 +975,7 @@ func (ic *GenericController) getEndpoints( port, err := service.GetPortMapping(servicePort.StrVal, s) if err == nil { targetPort = port - continue + break } glog.Warningf("error mapping service port: %v", err) From 4cc24bd2164c139611c5691237505563744cad7e Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Thu, 2 Feb 2017 08:11:19 -0300 Subject: [PATCH 2/7] Fix nil HTTP field --- .../ingress/controller/annotations_test.go | 26 +++++++++---------- core/pkg/ingress/controller/controller.go | 3 +-- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/core/pkg/ingress/controller/annotations_test.go b/core/pkg/ingress/controller/annotations_test.go index f577920db..58b0d8093 100644 --- a/core/pkg/ingress/controller/annotations_test.go +++ b/core/pkg/ingress/controller/annotations_test.go @@ -28,10 +28,10 @@ import ( ) const ( - annotation_secureUpstream = "ingress.kubernetes.io/secure-backends" - annotation_upsMaxFails = "ingress.kubernetes.io/upstream-max-fails" - annotation_upsFailTimeout = "ingress.kubernetes.io/upstream-fail-timeout" - annotation_passthrough = "ingress.kubernetes.io/ssl-passthrough" + annotationSecureUpstream = "ingress.kubernetes.io/secure-backends" + annotationUpsMaxFails = "ingress.kubernetes.io/upstream-max-fails" + annotationUpsFailTimeout = "ingress.kubernetes.io/upstream-fail-timeout" + annotationPassthrough = "ingress.kubernetes.io/ssl-passthrough" ) type mockCfg struct { @@ -106,9 +106,9 @@ func TestSecureUpstream(t *testing.T) { annotations map[string]string er bool }{ - {map[string]string{annotation_secureUpstream: "true"}, true}, - {map[string]string{annotation_secureUpstream: "false"}, false}, - {map[string]string{annotation_secureUpstream + "_no": "true"}, false}, + {map[string]string{annotationSecureUpstream: "true"}, true}, + {map[string]string{annotationSecureUpstream: "false"}, false}, + {map[string]string{annotationSecureUpstream + "_no": "true"}, false}, {map[string]string{}, false}, {nil, false}, } @@ -131,9 +131,9 @@ func TestHealthCheck(t *testing.T) { eumf int euft int }{ - {map[string]string{annotation_upsMaxFails: "3", annotation_upsFailTimeout: "10"}, 3, 10}, - {map[string]string{annotation_upsMaxFails: "3"}, 3, 0}, - {map[string]string{annotation_upsFailTimeout: "10"}, 0, 10}, + {map[string]string{annotationUpsMaxFails: "3", annotationUpsFailTimeout: "10"}, 3, 10}, + {map[string]string{annotationUpsMaxFails: "3"}, 3, 0}, + {map[string]string{annotationUpsFailTimeout: "10"}, 0, 10}, {map[string]string{}, 0, 0}, {nil, 0, 0}, } @@ -164,9 +164,9 @@ func TestSSLPassthrough(t *testing.T) { annotations map[string]string er bool }{ - {map[string]string{annotation_passthrough: "true"}, true}, - {map[string]string{annotation_passthrough: "false"}, false}, - {map[string]string{annotation_passthrough + "_no": "true"}, false}, + {map[string]string{annotationPassthrough: "true"}, true}, + {map[string]string{annotationPassthrough: "false"}, false}, + {map[string]string{annotationPassthrough + "_no": "true"}, false}, {map[string]string{}, false}, {nil, false}, } diff --git a/core/pkg/ingress/controller/controller.go b/core/pkg/ingress/controller/controller.go index 146a00aa3..408c729e8 100644 --- a/core/pkg/ingress/controller/controller.go +++ b/core/pkg/ingress/controller/controller.go @@ -620,9 +620,8 @@ func (ic *GenericController) getBackendServers() ([]*ingress.Backend, []*ingress } if rule.HTTP == nil && - len(ing.Spec.TLS) == 0 && host != defServerName { - glog.V(3).Infof("ingress rule %v/%v does not contains HTTP or TLS rules. using default backend", ing.Namespace, ing.Name) + glog.V(3).Infof("ingress rule %v/%v does not contains HTTP rules. using default backend", ing.Namespace, ing.Name) server.Locations[0].Backend = defBackend.Name continue } From 49fbe700295723c51a013abb445d2083fb42bdcd Mon Sep 17 00:00:00 2001 From: Marcin Owsiany Date: Fri, 3 Feb 2017 09:58:55 +0100 Subject: [PATCH 3/7] Fix an e2e link. --- docs/faq/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq/README.md b/docs/faq/README.md index f7e4de16e..dd36de9a1 100644 --- a/docs/faq/README.md +++ b/docs/faq/README.md @@ -100,7 +100,7 @@ Testing for the Ingress controllers is divided between: * Ingress repo: unittests and pre-submit integration tests run via travis * Kubernetes repo: [pre-submit e2e](https://k8s-testgrid.appspot.com/google-gce#gce&include-filter-by-regex=Loadbalancing), [post-merge e2e](https://k8s-testgrid.appspot.com/google-gce#gci-gce-ingress), - [per release-branch e2e](https://k8s-testgrid.appspot.com/google-gce#gci-gce-ingress-release-1.5) + [per release-branch e2e](https://k8s-testgrid.appspot.com/google-gce#gci-gce-ingress-1.5) The configuration for jenkins e2e tests are located [here](https://github.com/kubernetes/test-infra). The Ingress E2Es are located [here](https://github.com/kubernetes/kubernetes/blob/master/test/e2e/ingress.go), From 1ecbe95eea301b508cf4565ab3e3591cceb68fd9 Mon Sep 17 00:00:00 2001 From: Marcin Owsiany Date: Fri, 3 Feb 2017 10:24:10 +0100 Subject: [PATCH 4/7] Improve links from CONTRIBUTING. - point to most recent version of k8s-wide docs, not some frozen version - actually mention the ingress-specific development guide --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2e61ac31d..5f7ff1f91 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,10 +22,11 @@ If you're new to the project and want to help, but don't know where to start, we ## Contributing A Patch 1. If you haven't already done so, sign a Contributor License Agreement (see details above). +1. Read the [Ingress development guide](docs/dev/README.md) 1. Fork the desired repo, develop and test your code changes. 1. Submit a pull request. -All changes must be code reviewed. Coding conventions and standards are explained in the official [developer docs](https://github.com/kubernetes/kubernetes/tree/8a2c639bfb2087a9a89c02d2dc30fcb9bd0846f6/docs/devel). Expect reviewers to request that you avoid common [go style mistakes](https://github.com/golang/go/wiki/CodeReviewComments) in your PRs. +All changes must be code reviewed. Coding conventions and standards are explained in the official [developer docs](https://github.com/kubernetes/kubernetes/tree/master/docs/devel). Expect reviewers to request that you avoid common [go style mistakes](https://github.com/golang/go/wiki/CodeReviewComments) in your PRs. ### Merge Approval From ee36b23385d5ed9a21ddb22322a7b5a0de2795fb Mon Sep 17 00:00:00 2001 From: Marcin Owsiany Date: Fri, 3 Feb 2017 10:32:59 +0100 Subject: [PATCH 5/7] Fix typo, add a couple of links. --- docs/dev/releases.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/dev/releases.md b/docs/dev/releases.md index 7cb3e0f1d..ce613cc23 100644 --- a/docs/dev/releases.md +++ b/docs/dev/releases.md @@ -4,7 +4,7 @@ This doc explains how to build, test and release ingress controllers. ## Building -All ingress controllers are build through a Makefile. Depending on your +All ingress controllers are built through a Makefile. Depending on your requirements you can build a raw server binary, a local container image, or push an image to a remote repository. @@ -76,7 +76,9 @@ $ cd $GOPATH/src/k8s.io/kubernetes $ ./hack/ginkgo-e2e.sh --ginkgo.focus=Ingress.* --delete-namespace-on-failure=false ``` -TODO: add instructions on running integration tests, or e2e against +See also [related FAQs](../faq#how-are-the-ingress-controllers-tested). + +[TODO](https://github.com/kubernetes/ingress/issues/5): add instructions on running integration tests, or e2e against local-up/minikube. ## Releasing From da9154310e7f5f26c200935fb34d8dd5bcc0b3d2 Mon Sep 17 00:00:00 2001 From: Marcin Owsiany Date: Fri, 3 Feb 2017 18:45:51 +0100 Subject: [PATCH 6/7] Fixes for minikube usage instructions. --- docs/dev/setup.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/dev/setup.md b/docs/dev/setup.md index 72bd667be..b41810e1b 100644 --- a/docs/dev/setup.md +++ b/docs/dev/setup.md @@ -49,7 +49,7 @@ NAME STATUS AGE VERSION a sandboxed local cluster. You will first need to [install](https://github.com/kubernetes/minikube/releases) the minikube binary, then bring up a cluster ```console -$ minikube up +$ minikube start ``` Check for Ready nodes @@ -71,12 +71,16 @@ $ minikube addons list If this list already contains the ingress controller, you don't need to redeploy it. If the addon controller is disabled, you can enable it with ```console -$ minikube enable addons ingress +$ minikube addons enable ingress ``` If the list *does not* contain the ingress controller, you can either update minikube, or deploy it yourself as shown in the next section. +You may want to consider [using the VM's docker +daemon](https://github.com/kubernetes/minikube/blob/master/README.md#reusing-the-docker-daemon) +when developing. + ## Deploy the ingress controller You can deploy an ingress controller on the cluster setup in the previous step From b7e8bde0e92fa1dbfb27e43e3b99b74fe855ad40 Mon Sep 17 00:00:00 2001 From: Joao Morais Date: Fri, 3 Feb 2017 18:50:51 -0200 Subject: [PATCH 7/7] Fix panic if a tempfile cannot be created --- core/pkg/net/ssl/ssl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/pkg/net/ssl/ssl.go b/core/pkg/net/ssl/ssl.go index 1ac6d2fa2..5907d5f5e 100644 --- a/core/pkg/net/ssl/ssl.go +++ b/core/pkg/net/ssl/ssl.go @@ -38,7 +38,7 @@ func AddOrUpdateCertAndKey(name string, cert, key, ca []byte) (*ingress.SSLCert, tempPemFile, err := ioutil.TempFile(ingress.DefaultSSLDirectory, pemName) if err != nil { - return nil, fmt.Errorf("could not create temp pem file %v: %v", tempPemFile.Name(), err) + return nil, fmt.Errorf("could not create temp pem file %v: %v", pemFileName, err) } _, err = tempPemFile.Write(cert)