diff --git a/deploy/validating-webhook.yaml.tpl b/deploy/validating-webhook.yaml.tpl index 7aad64f8c..b7ee80ac5 100644 --- a/deploy/validating-webhook.yaml.tpl +++ b/deploy/validating-webhook.yaml.tpl @@ -7,7 +7,7 @@ webhooks: - name: validate.nginx.ingress.kubernetes.io rules: - apiGroups: - - extensions + - networking.k8s.io apiVersions: - v1beta1 operations: @@ -20,6 +20,6 @@ webhooks: service: namespace: ingress-nginx name: nginx-ingress-webhook - path: /extensions/v1beta1/ingresses + path: /networking.k8s.io/v1beta1/ingresses caBundle: --- \ No newline at end of file diff --git a/docs/deploy/validating-webhook.md b/docs/deploy/validating-webhook.md index c083fa35e..81fd6392b 100644 --- a/docs/deploy/validating-webhook.md +++ b/docs/deploy/validating-webhook.md @@ -148,7 +148,7 @@ webhooks: - name: validate.nginx.ingress.kubernetes.io rules: - apiGroups: - - extensions + - networking.k8s.io/v1beta1 apiVersions: - v1beta1 operations: @@ -161,7 +161,7 @@ webhooks: service: namespace: ingress-nginx name: ingress-validation-webhook - path: /extensions/v1beta1/ingress + path: /networking.k8s.io/v1beta1/ingress caBundle: ``` diff --git a/docs/examples/affinity/cookie/ingress.yaml b/docs/examples/affinity/cookie/ingress.yaml index 4abebfedf..57edbdbd3 100644 --- a/docs/examples/affinity/cookie/ingress.yaml +++ b/docs/examples/affinity/cookie/ingress.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: nginx-test diff --git a/docs/examples/auth/basic/README.md b/docs/examples/auth/basic/README.md index 15e0a7eeb..edf5ebd95 100644 --- a/docs/examples/auth/basic/README.md +++ b/docs/examples/auth/basic/README.md @@ -30,7 +30,7 @@ type: Opaque ```console echo " -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: ingress-with-auth diff --git a/docs/examples/auth/client-certs/ingress.yaml b/docs/examples/auth/client-certs/ingress.yaml index 39dacce97..cf5f701b2 100644 --- a/docs/examples/auth/client-certs/ingress.yaml +++ b/docs/examples/auth/client-certs/ingress.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: diff --git a/docs/examples/auth/external-auth/README.md b/docs/examples/auth/external-auth/README.md index d1d6011c6..a08138373 100644 --- a/docs/examples/auth/external-auth/README.md +++ b/docs/examples/auth/external-auth/README.md @@ -2,7 +2,7 @@ ### Example 1: -Use an external service (Basic Auth) located in `https://httpbin.org` +Use an external service (Basic Auth) located in `https://httpbin.org` ``` $ kubectl create -f ingress.yaml @@ -13,7 +13,7 @@ NAME HOSTS ADDRESS PORTS AGE external-auth external-auth-01.sample.com 172.17.4.99 80 13s $ kubectl get ing external-auth -o yaml -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: diff --git a/docs/examples/auth/external-auth/ingress.yaml b/docs/examples/auth/external-auth/ingress.yaml index 4cec37653..c7a87a240 100644 --- a/docs/examples/auth/external-auth/ingress.yaml +++ b/docs/examples/auth/external-auth/ingress.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: diff --git a/docs/examples/auth/oauth-external-auth/dashboard-ingress.yaml b/docs/examples/auth/oauth-external-auth/dashboard-ingress.yaml index 17a222939..ade56a9e6 100644 --- a/docs/examples/auth/oauth-external-auth/dashboard-ingress.yaml +++ b/docs/examples/auth/oauth-external-auth/dashboard-ingress.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: @@ -18,7 +18,7 @@ spec: --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: oauth2-proxy diff --git a/docs/examples/auth/oauth-external-auth/oauth2-proxy.yaml b/docs/examples/auth/oauth-external-auth/oauth2-proxy.yaml index 4fe0dd27b..dc5b7a354 100644 --- a/docs/examples/auth/oauth-external-auth/oauth2-proxy.yaml +++ b/docs/examples/auth/oauth-external-auth/oauth2-proxy.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: labels: diff --git a/docs/examples/chashsubset/deployment.yaml b/docs/examples/chashsubset/deployment.yaml index 5db8d3b37..9b1bafcb1 100644 --- a/docs/examples/chashsubset/deployment.yaml +++ b/docs/examples/chashsubset/deployment.yaml @@ -54,7 +54,7 @@ spec: targetPort: 8080 --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: diff --git a/docs/examples/customization/configuration-snippets/ingress.yaml b/docs/examples/customization/configuration-snippets/ingress.yaml index 01af93ea2..07af3552f 100644 --- a/docs/examples/customization/configuration-snippets/ingress.yaml +++ b/docs/examples/customization/configuration-snippets/ingress.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: nginx-configuration-snippet diff --git a/docs/examples/customization/external-auth-headers/deploy/auth-service.yaml b/docs/examples/customization/external-auth-headers/deploy/auth-service.yaml index af8f09518..3a5dff12c 100644 --- a/docs/examples/customization/external-auth-headers/deploy/auth-service.yaml +++ b/docs/examples/customization/external-auth-headers/deploy/auth-service.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: demo-auth-service diff --git a/docs/examples/customization/external-auth-headers/deploy/echo-service.yaml b/docs/examples/customization/external-auth-headers/deploy/echo-service.yaml index 363c4bf3d..1c3667c7c 100644 --- a/docs/examples/customization/external-auth-headers/deploy/echo-service.yaml +++ b/docs/examples/customization/external-auth-headers/deploy/echo-service.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: demo-echo-service @@ -43,7 +43,7 @@ spec: selector: k8s-app: demo-echo-service --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: public-demo-echo-service @@ -61,7 +61,7 @@ spec: servicePort: 80 path: / --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: secure-demo-echo-service diff --git a/docs/examples/docker-registry/deployment.yaml b/docs/examples/docker-registry/deployment.yaml index c9044b488..7a923d69f 100644 --- a/docs/examples/docker-registry/deployment.yaml +++ b/docs/examples/docker-registry/deployment.yaml @@ -5,7 +5,7 @@ metadata: --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: docker-registry diff --git a/docs/examples/docker-registry/ingress-with-tls.yaml b/docs/examples/docker-registry/ingress-with-tls.yaml index 817d3d85f..fc277b20f 100644 --- a/docs/examples/docker-registry/ingress-with-tls.yaml +++ b/docs/examples/docker-registry/ingress-with-tls.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: diff --git a/docs/examples/docker-registry/ingress-without-tls.yaml b/docs/examples/docker-registry/ingress-without-tls.yaml index 6c89101b6..1ce1b98fb 100644 --- a/docs/examples/docker-registry/ingress-without-tls.yaml +++ b/docs/examples/docker-registry/ingress-without-tls.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: diff --git a/docs/examples/grpc/app.yaml b/docs/examples/grpc/app.yaml index 04f1932d7..3c04033e0 100644 --- a/docs/examples/grpc/app.yaml +++ b/docs/examples/grpc/app.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: fortune-teller-app diff --git a/docs/examples/grpc/ingress.yaml b/docs/examples/grpc/ingress.yaml index 02174c2db..1d76476d1 100644 --- a/docs/examples/grpc/ingress.yaml +++ b/docs/examples/grpc/ingress.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: diff --git a/docs/examples/http-svc.yaml b/docs/examples/http-svc.yaml index aabe9a652..bd2b34ce9 100644 --- a/docs/examples/http-svc.yaml +++ b/docs/examples/http-svc.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: http-svc diff --git a/docs/examples/multi-tls/multi-tls.yaml b/docs/examples/multi-tls/multi-tls.yaml index f6ae876d0..c616501be 100644 --- a/docs/examples/multi-tls/multi-tls.yaml +++ b/docs/examples/multi-tls/multi-tls.yaml @@ -90,9 +90,9 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP - + --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: foo-tls diff --git a/docs/examples/rewrite/README.md b/docs/examples/rewrite/README.md index 299b791f4..b27d75c4c 100644 --- a/docs/examples/rewrite/README.md +++ b/docs/examples/rewrite/README.md @@ -34,7 +34,7 @@ Create an Ingress rule with a rewrite annotation: ```console $ echo ' -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: @@ -65,7 +65,7 @@ For example, the ingress definition above will result in the following rewrites: Create an Ingress rule with a app-root annotation: ``` $ echo " -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: diff --git a/docs/examples/static-ip/nginx-ingress.yaml b/docs/examples/static-ip/nginx-ingress.yaml index 1db6ee335..aa4877e56 100644 --- a/docs/examples/static-ip/nginx-ingress.yaml +++ b/docs/examples/static-ip/nginx-ingress.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: ingress-nginx diff --git a/docs/examples/tls-termination/README.md b/docs/examples/tls-termination/README.md index a4e20e73b..99de6c29e 100644 --- a/docs/examples/tls-termination/README.md +++ b/docs/examples/tls-termination/README.md @@ -11,7 +11,7 @@ You need a [TLS cert](../PREREQUISITES.md#tls-certificates) and a [test HTTP ser Create a `values.yaml` file. ```yaml -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: nginx-test @@ -19,7 +19,7 @@ spec: tls: - hosts: - foo.bar.com - # This assumes tls-secret exists and the SSL + # This assumes tls-secret exists and the SSL # certificate contains a CN for foo.bar.com secretName: tls-secret rules: @@ -33,7 +33,7 @@ spec: servicePort: 80 ``` -The following command instructs the controller to terminate traffic using the provided +The following command instructs the controller to terminate traffic using the provided TLS cert, and forward un-encrypted HTTP traffic to the test HTTP service. ```console diff --git a/docs/examples/tls-termination/ingress.yaml b/docs/examples/tls-termination/ingress.yaml index b5decf8f2..fc97b3707 100644 --- a/docs/examples/tls-termination/ingress.yaml +++ b/docs/examples/tls-termination/ingress.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: nginx-test @@ -6,7 +6,7 @@ spec: tls: - hosts: - foo.bar.com - # This assumes tls-secret exists and the SSL + # This assumes tls-secret exists and the SSL # certificate contains a CN for foo.bar.com secretName: tls-secret rules: diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index a99da8511..915c38aad 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -32,7 +32,7 @@ Rules: /tea tea-svc:80 () /coffee coffee-svc:80 () Annotations: - kubectl.kubernetes.io/last-applied-configuration: {"apiVersion":"extensions/v1beta1","kind":"Ingress","metadata":{"annotations":{},"name":"cafe-ingress","namespace":"default","selfLink":"/apis/networking/v1beta1/namespaces/default/ingresses/cafe-ingress"},"spec":{"rules":[{"host":"cafe.com","http":{"paths":[{"backend":{"serviceName":"tea-svc","servicePort":80},"path":"/tea"},{"backend":{"serviceName":"coffee-svc","servicePort":80},"path":"/coffee"}]}}]},"status":{"loadBalancer":{"ingress":[{"ip":"169.48.142.110"}]}}} + kubectl.kubernetes.io/last-applied-configuration: {"apiVersion":"networking.k8s.io/v1beta1","kind":"Ingress","metadata":{"annotations":{},"name":"cafe-ingress","namespace":"default","selfLink":"/apis/networking/v1beta1/namespaces/default/ingresses/cafe-ingress"},"spec":{"rules":[{"host":"cafe.com","http":{"paths":[{"backend":{"serviceName":"tea-svc","servicePort":80},"path":"/tea"},{"backend":{"serviceName":"coffee-svc","servicePort":80},"path":"/coffee"}]}}]},"status":{"loadBalancer":{"ingress":[{"ip":"169.48.142.110"}]}}} Events: Type Reason Age From Message diff --git a/docs/user-guide/basic-usage.md b/docs/user-guide/basic-usage.md index b5feca7f0..247cb8bf2 100644 --- a/docs/user-guide/basic-usage.md +++ b/docs/user-guide/basic-usage.md @@ -5,7 +5,7 @@ ingress-nginx can be used for many use cases, inside various cloud provider and First of all follow the instructions to install ingress-nginx. Then imagine that you need to expose 2 HTTP services already installed: `myServiceA`, `myServiceB`. Let's say that you want to expose the first at `myServiceA.foo.org` and the second at `myServiceB.foo.org`. One possible solution is to create two **ingress** resources: ``` -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: ingress-myServiceA @@ -22,7 +22,7 @@ spec: serviceName: myServiceA servicePort: 80 --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: ingress-myServiceB diff --git a/docs/user-guide/fcgi-services.md b/docs/user-guide/fcgi-services.md index fba989f3c..aa0924769 100644 --- a/docs/user-guide/fcgi-services.md +++ b/docs/user-guide/fcgi-services.md @@ -60,7 +60,7 @@ data: --- -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: diff --git a/docs/user-guide/ingress-path-matching.md b/docs/user-guide/ingress-path-matching.md index ae1c1b584..09d39f4c0 100644 --- a/docs/user-guide/ingress-path-matching.md +++ b/docs/user-guide/ingress-path-matching.md @@ -2,8 +2,8 @@ ## Regular Expression Support -!!! important - Regular expressions and wild cards are not supported in the `spec.rules.host` field. Full hostnames must be used. +!!! important + Regular expressions and wild cards are not supported in the `spec.rules.host` field. Full hostnames must be used. The ingress controller supports **case insensitive** regular expressions in the `spec.rules.http.paths.path` field. This can be enabled by setting the `nginx.ingress.kubernetes.io/use-regex` annotation to `true` (the default is false). @@ -11,7 +11,7 @@ This can be enabled by setting the `nginx.ingress.kubernetes.io/use-regex` annot See the [description](./nginx-configuration/annotations.md#use-regex) of the `use-regex` annotation for more details. ```yaml -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: test-ingress @@ -47,7 +47,7 @@ In NGINX, regular expressions follow a **first match** policy. In order to enabl Let the following two ingress definitions be created: ```yaml -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: test-ingress-1 @@ -67,7 +67,7 @@ spec: ``` ```yaml -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: test-ingress-2 @@ -121,7 +121,7 @@ This case is expected and a result of NGINX's a first match policy for paths tha Let the following ingress be defined: ```yaml -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: test-ingress-3 diff --git a/docs/user-guide/nginx-configuration/annotations.md b/docs/user-guide/nginx-configuration/annotations.md index 134cab0f9..3a00afa26 100755 --- a/docs/user-guide/nginx-configuration/annotations.md +++ b/docs/user-guide/nginx-configuration/annotations.md @@ -361,7 +361,7 @@ For more information please see [the `server_name` documentation](http://nginx.o Using the annotation `nginx.ingress.kubernetes.io/server-snippet` it is possible to add custom configuration in the server configuration block. ```yaml -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: annotations: diff --git a/docs/user-guide/third-party-addons/opentracing.md b/docs/user-guide/third-party-addons/opentracing.md index 13c2a1753..df8568e24 100644 --- a/docs/user-guide/third-party-addons/opentracing.md +++ b/docs/user-guide/third-party-addons/opentracing.md @@ -29,7 +29,7 @@ zipkin-collector-host: zipkin.default.svc.cluster.local jaeger-collector-host: jaeger-agent.default.svc.cluster.local datadog-collector-host: datadog-agent.default.svc.cluster.local ``` -NOTE: While the option is called `jaeger-collector-host`, you will need to point this to a `jaeger-agent`, and not the `jaeger-collector` component. +NOTE: While the option is called `jaeger-collector-host`, you will need to point this to a `jaeger-agent`, and not the `jaeger-collector` component. Next you will need to deploy a distributed tracing system which uses OpenTracing. [Zipkin](https://github.com/openzipkin/zipkin) and @@ -147,7 +147,7 @@ In the Zipkin interface we can see the details: # Apply the Ingress Resource $ echo ' - apiVersion: extensions/v1beta1 + apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: echo-ingress diff --git a/internal/ingress/status/status.go b/internal/ingress/status/status.go index 2c23c9912..bbe6e8383 100644 --- a/internal/ingress/status/status.go +++ b/internal/ingress/status/status.go @@ -278,7 +278,7 @@ func runUpdate(ing *ingress.Ingress, status []apiv1.LoadBalancerIngress, klog.Warningf("error updating ingress rule: %v", err) } } else { - ingClient := client.ExtensionsV1beta1().Ingresses(ing.Namespace) + ingClient := client.NetworkingV1beta1().Ingresses(ing.Namespace) currIng, err := ingClient.Get(ing.Name, metav1.GetOptions{}) if err != nil { return nil, errors.Wrap(err, fmt.Sprintf("unexpected error searching Ingress %v/%v", ing.Namespace, ing.Name)) diff --git a/test/e2e/annotations/affinity.go b/test/e2e/annotations/affinity.go index 241d354a4..cbafb9861 100644 --- a/test/e2e/annotations/affinity.go +++ b/test/e2e/annotations/affinity.go @@ -26,7 +26,7 @@ import ( . "github.com/onsi/gomega" "github.com/parnurzeal/gorequest" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -142,29 +142,29 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions", "nginx.ingress.kubernetes.io/session-cookie-name": "SERVERID", } - f.EnsureIngress(&extensions.Ingress{ + f.EnsureIngress(&networking.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: host, Namespace: f.Namespace, Annotations: annotations, }, - Spec: extensions.IngressSpec{ - Rules: []extensions.IngressRule{ + Spec: networking.IngressSpec{ + Rules: []networking.IngressRule{ { Host: host, - IngressRuleValue: extensions.IngressRuleValue{ - HTTP: &extensions.HTTPIngressRuleValue{ - Paths: []extensions.HTTPIngressPath{ + IngressRuleValue: networking.IngressRuleValue{ + HTTP: &networking.HTTPIngressRuleValue{ + Paths: []networking.HTTPIngressPath{ { Path: "/something", - Backend: extensions.IngressBackend{ + Backend: networking.IngressBackend{ ServiceName: framework.EchoService, ServicePort: intstr.FromInt(80), }, }, { Path: "/somewhereelese", - Backend: extensions.IngressBackend{ + Backend: networking.IngressBackend{ ServiceName: framework.EchoService, ServicePort: intstr.FromInt(80), }, diff --git a/test/e2e/annotations/customhttperrors.go b/test/e2e/annotations/customhttperrors.go index 358f8778a..c925a520a 100644 --- a/test/e2e/annotations/customhttperrors.go +++ b/test/e2e/annotations/customhttperrors.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" "k8s.io/ingress-nginx/test/e2e/framework" ) @@ -73,7 +73,7 @@ var _ = framework.IngressNginxDescribe("Annotations - custom-http-errors", func( } By("updating configuration when only custom-http-error value changes") - err := framework.UpdateIngress(f.KubeClientSet, f.Namespace, host, func(ingress *extensions.Ingress) error { + err := framework.UpdateIngress(f.KubeClientSet, f.Namespace, host, func(ingress *networking.Ingress) error { ingress.ObjectMeta.Annotations["nginx.ingress.kubernetes.io/custom-http-errors"] = "503" return nil }) @@ -104,7 +104,7 @@ var _ = framework.IngressNginxDescribe("Annotations - custom-http-errors", func( customDefaultBackend := "from-annotation" f.NewEchoDeploymentWithNameAndReplicas(customDefaultBackend, 1) - err = framework.UpdateIngress(f.KubeClientSet, f.Namespace, host, func(ingress *extensions.Ingress) error { + err = framework.UpdateIngress(f.KubeClientSet, f.Namespace, host, func(ingress *networking.Ingress) error { ingress.ObjectMeta.Annotations["nginx.ingress.kubernetes.io/default-backend"] = customDefaultBackend return nil }) diff --git a/test/e2e/annotations/satisfy.go b/test/e2e/annotations/satisfy.go index aa67a3ea4..dc2cf7049 100644 --- a/test/e2e/annotations/satisfy.go +++ b/test/e2e/annotations/satisfy.go @@ -25,7 +25,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/parnurzeal/gorequest" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/ingress-nginx/test/e2e/framework" ) @@ -62,7 +62,7 @@ var _ = framework.IngressNginxDescribe("Annotations - SATISFY", func() { f.EnsureIngress(ing) for key, result := range results { - err := framework.UpdateIngress(f.KubeClientSet, f.Namespace, host, func(ingress *extensions.Ingress) error { + err := framework.UpdateIngress(f.KubeClientSet, f.Namespace, host, func(ingress *networking.Ingress) error { ingress.ObjectMeta.Annotations[annotationKey] = annotations[key] return nil }) diff --git a/test/e2e/defaultbackend/with_hosts.go b/test/e2e/defaultbackend/with_hosts.go index 1c4830da5..9cf47abf8 100644 --- a/test/e2e/defaultbackend/with_hosts.go +++ b/test/e2e/defaultbackend/with_hosts.go @@ -24,7 +24,7 @@ import ( "strings" "github.com/parnurzeal/gorequest" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/ingress-nginx/test/e2e/framework" @@ -46,18 +46,18 @@ var _ = framework.IngressNginxDescribe("Default backend with hosts", func() { "nginx.ingress.kubernetes.io/proxy-buffer-size": "8k", } - ing := &extensions.Ingress{ + ing := &networking.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: "default-backend-annotations", Namespace: f.Namespace, Annotations: annotations, }, - Spec: extensions.IngressSpec{ - Backend: &extensions.IngressBackend{ + Spec: networking.IngressSpec{ + Backend: &networking.IngressBackend{ ServiceName: framework.EchoService, ServicePort: intstr.FromInt(80), }, - Rules: []extensions.IngressRule{ + Rules: []networking.IngressRule{ { Host: host, }, diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 4e49c507a..21d1cff50 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -18,9 +18,10 @@ import ( "strings" "time" + "github.com/pkg/errors" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" apiextcs "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" @@ -28,8 +29,6 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" restclient "k8s.io/client-go/rest" - - "github.com/pkg/errors" "k8s.io/klog" . "github.com/onsi/ginkgo" @@ -393,8 +392,8 @@ func UpdateDeployment(kubeClientSet kubernetes.Interface, namespace string, name } // UpdateIngress runs the given updateFunc on the ingress -func UpdateIngress(kubeClientSet kubernetes.Interface, namespace string, name string, updateFunc func(d *extensions.Ingress) error) error { - ingress, err := kubeClientSet.ExtensionsV1beta1().Ingresses(namespace).Get(name, metav1.GetOptions{}) +func UpdateIngress(kubeClientSet kubernetes.Interface, namespace string, name string, updateFunc func(d *networking.Ingress) error) error { + ingress, err := kubeClientSet.NetworkingV1beta1().Ingresses(namespace).Get(name, metav1.GetOptions{}) if err != nil { return err } @@ -403,37 +402,37 @@ func UpdateIngress(kubeClientSet kubernetes.Interface, namespace string, name st return err } - _, err = kubeClientSet.ExtensionsV1beta1().Ingresses(namespace).Update(ingress) + _, err = kubeClientSet.NetworkingV1beta1().Ingresses(namespace).Update(ingress) return err } // NewSingleIngressWithTLS creates a simple ingress rule with TLS spec included -func NewSingleIngressWithTLS(name, path, host string, tlsHosts []string, ns, service string, port int, annotations *map[string]string) *extensions.Ingress { +func NewSingleIngressWithTLS(name, path, host string, tlsHosts []string, ns, service string, port int, annotations *map[string]string) *networking.Ingress { return newSingleIngressWithRules(name, path, host, ns, service, port, annotations, tlsHosts) } // NewSingleIngress creates a simple ingress rule -func NewSingleIngress(name, path, host, ns, service string, port int, annotations *map[string]string) *extensions.Ingress { +func NewSingleIngress(name, path, host, ns, service string, port int, annotations *map[string]string) *networking.Ingress { return newSingleIngressWithRules(name, path, host, ns, service, port, annotations, nil) } // NewSingleIngressWithMultiplePaths creates a simple ingress rule with multiple paths -func NewSingleIngressWithMultiplePaths(name string, paths []string, host, ns, service string, port int, annotations *map[string]string) *extensions.Ingress { - spec := extensions.IngressSpec{ - Rules: []extensions.IngressRule{ +func NewSingleIngressWithMultiplePaths(name string, paths []string, host, ns, service string, port int, annotations *map[string]string) *networking.Ingress { + spec := networking.IngressSpec{ + Rules: []networking.IngressRule{ { Host: host, - IngressRuleValue: extensions.IngressRuleValue{ - HTTP: &extensions.HTTPIngressRuleValue{}, + IngressRuleValue: networking.IngressRuleValue{ + HTTP: &networking.HTTPIngressRuleValue{}, }, }, }, } for _, path := range paths { - spec.Rules[0].IngressRuleValue.HTTP.Paths = append(spec.Rules[0].IngressRuleValue.HTTP.Paths, extensions.HTTPIngressPath{ + spec.Rules[0].IngressRuleValue.HTTP.Paths = append(spec.Rules[0].IngressRuleValue.HTTP.Paths, networking.HTTPIngressPath{ Path: path, - Backend: extensions.IngressBackend{ + Backend: networking.IngressBackend{ ServiceName: service, ServicePort: intstr.FromInt(port), }, @@ -443,18 +442,18 @@ func NewSingleIngressWithMultiplePaths(name string, paths []string, host, ns, se return newSingleIngress(name, ns, annotations, spec) } -func newSingleIngressWithRules(name, path, host, ns, service string, port int, annotations *map[string]string, tlsHosts []string) *extensions.Ingress { +func newSingleIngressWithRules(name, path, host, ns, service string, port int, annotations *map[string]string, tlsHosts []string) *networking.Ingress { - spec := extensions.IngressSpec{ - Rules: []extensions.IngressRule{ + spec := networking.IngressSpec{ + Rules: []networking.IngressRule{ { Host: host, - IngressRuleValue: extensions.IngressRuleValue{ - HTTP: &extensions.HTTPIngressRuleValue{ - Paths: []extensions.HTTPIngressPath{ + IngressRuleValue: networking.IngressRuleValue{ + HTTP: &networking.HTTPIngressRuleValue{ + Paths: []networking.HTTPIngressPath{ { Path: path, - Backend: extensions.IngressBackend{ + Backend: networking.IngressBackend{ ServiceName: service, ServicePort: intstr.FromInt(port), }, @@ -467,7 +466,7 @@ func newSingleIngressWithRules(name, path, host, ns, service string, port int, a } if len(tlsHosts) > 0 { - spec.TLS = []extensions.IngressTLS{ + spec.TLS = []networking.IngressTLS{ { Hosts: tlsHosts, SecretName: host, @@ -479,21 +478,21 @@ func newSingleIngressWithRules(name, path, host, ns, service string, port int, a } // NewSingleIngressWithBackendAndRules creates an ingress with both a default backend and a rule -func NewSingleIngressWithBackendAndRules(name, path, host, ns, defaultService string, defaultPort int, service string, port int, annotations *map[string]string) *extensions.Ingress { - spec := extensions.IngressSpec{ - Backend: &extensions.IngressBackend{ +func NewSingleIngressWithBackendAndRules(name, path, host, ns, defaultService string, defaultPort int, service string, port int, annotations *map[string]string) *networking.Ingress { + spec := networking.IngressSpec{ + Backend: &networking.IngressBackend{ ServiceName: defaultService, ServicePort: intstr.FromInt(defaultPort), }, - Rules: []extensions.IngressRule{ + Rules: []networking.IngressRule{ { Host: host, - IngressRuleValue: extensions.IngressRuleValue{ - HTTP: &extensions.HTTPIngressRuleValue{ - Paths: []extensions.HTTPIngressPath{ + IngressRuleValue: networking.IngressRuleValue{ + HTTP: &networking.HTTPIngressRuleValue{ + Paths: []networking.HTTPIngressPath{ { Path: path, - Backend: extensions.IngressBackend{ + Backend: networking.IngressBackend{ ServiceName: service, ServicePort: intstr.FromInt(port), }, @@ -509,9 +508,9 @@ func NewSingleIngressWithBackendAndRules(name, path, host, ns, defaultService st } // NewSingleCatchAllIngress creates a simple ingress with a catch-all backend -func NewSingleCatchAllIngress(name, ns, service string, port int, annotations *map[string]string) *extensions.Ingress { - spec := extensions.IngressSpec{ - Backend: &extensions.IngressBackend{ +func NewSingleCatchAllIngress(name, ns, service string, port int, annotations *map[string]string) *networking.Ingress { + spec := networking.IngressSpec{ + Backend: &networking.IngressBackend{ ServiceName: service, ServicePort: intstr.FromInt(port), }, @@ -519,12 +518,12 @@ func NewSingleCatchAllIngress(name, ns, service string, port int, annotations *m return newSingleIngress(name, ns, annotations, spec) } -func newSingleIngress(name, ns string, annotations *map[string]string, spec extensions.IngressSpec) *extensions.Ingress { +func newSingleIngress(name, ns string, annotations *map[string]string, spec networking.IngressSpec) *networking.Ingress { if annotations == nil { annotations = &map[string]string{} } - ing := &extensions.Ingress{ + ing := &networking.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: ns, diff --git a/test/e2e/framework/k8s.go b/test/e2e/framework/k8s.go index b5fd1c688..760ef2d6a 100644 --- a/test/e2e/framework/k8s.go +++ b/test/e2e/framework/k8s.go @@ -26,7 +26,7 @@ import ( appsv1 "k8s.io/api/apps/v1" api "k8s.io/api/core/v1" core "k8s.io/api/core/v1" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" k8sErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" @@ -68,11 +68,11 @@ func (f *Framework) EnsureConfigMap(configMap *api.ConfigMap) (*api.ConfigMap, e } // EnsureIngress creates an Ingress object or returns it if it already exists. -func (f *Framework) EnsureIngress(ingress *extensions.Ingress) *extensions.Ingress { - ing, err := f.KubeClientSet.ExtensionsV1beta1().Ingresses(ingress.Namespace).Update(ingress) +func (f *Framework) EnsureIngress(ingress *networking.Ingress) *networking.Ingress { + ing, err := f.KubeClientSet.NetworkingV1beta1().Ingresses(ingress.Namespace).Update(ingress) if err != nil { if k8sErrors.IsNotFound(err) { - ing, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(ingress.Namespace).Create(ingress) + ing, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(ingress.Namespace).Create(ingress) Expect(err).NotTo(HaveOccurred(), "unexpected error creating ingress") return ing } diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 8e00d404a..e28419334 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -235,7 +235,7 @@ func WaitForNoIngressInNamespace(c kubernetes.Interface, namespace, name string) func noIngressInNamespace(c kubernetes.Interface, namespace, name string) wait.ConditionFunc { return func() (bool, error) { - ing, err := c.ExtensionsV1beta1().Ingresses(namespace).Get(name, metav1.GetOptions{}) + ing, err := c.NetworkingV1beta1().Ingresses(namespace).Get(name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { return true, nil } @@ -257,7 +257,7 @@ func WaitForIngressInNamespace(c kubernetes.Interface, namespace, name string) e func ingressInNamespace(c kubernetes.Interface, namespace, name string) wait.ConditionFunc { return func() (bool, error) { - ing, err := c.ExtensionsV1beta1().Ingresses(namespace).Get(name, metav1.GetOptions{}) + ing, err := c.NetworkingV1beta1().Ingresses(namespace).Get(name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { return false, nil } diff --git a/test/e2e/leaks/lua_ssl.go b/test/e2e/leaks/lua_ssl.go index ecd11c7cb..2ab9e0b39 100644 --- a/test/e2e/leaks/lua_ssl.go +++ b/test/e2e/leaks/lua_ssl.go @@ -104,7 +104,7 @@ func checkIngress(hostname string, f *framework.Framework) { } func deleteIngress(hostname string, f *framework.Framework) { - err := f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Delete(hostname, &metav1.DeleteOptions{}) + err := f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Delete(hostname, &metav1.DeleteOptions{}) Expect(err).NotTo(HaveOccurred(), "unexpected error deleting ingress") } diff --git a/test/e2e/lua/dynamic_certificates.go b/test/e2e/lua/dynamic_certificates.go index 9d80f0402..2855d40cf 100644 --- a/test/e2e/lua/dynamic_certificates.go +++ b/test/e2e/lua/dynamic_certificates.go @@ -27,7 +27,7 @@ import ( dto "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" "github.com/prometheus/common/model" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/ingress-nginx/test/e2e/framework" @@ -44,9 +44,9 @@ var _ = framework.IngressNginxDescribe("Dynamic Certificate", func() { It("picks up the certificate when we add TLS spec to existing ingress", func() { ensureIngress(f, host, framework.EchoService) - ing, err := f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) + ing, err := f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) Expect(err).ToNot(HaveOccurred()) - ing.Spec.TLS = []extensions.IngressTLS{ + ing.Spec.TLS = []networking.IngressTLS{ { Hosts: []string{host}, SecretName: host, @@ -57,7 +57,7 @@ var _ = framework.IngressNginxDescribe("Dynamic Certificate", func() { ing.Spec.TLS[0].SecretName, ing.Namespace) Expect(err).ToNot(HaveOccurred()) - _, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Update(ing) + _, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Update(ing) Expect(err).ToNot(HaveOccurred()) time.Sleep(waitForLuaSync) @@ -143,7 +143,7 @@ var _ = framework.IngressNginxDescribe("Dynamic Certificate", func() { }) It("picks up the updated certificate without reloading", func() { - ing, err := f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) + ing, err := f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) Expect(err).ToNot(HaveOccurred()) ensureHTTPSRequest(fmt.Sprintf("%s?id=dummy_log_splitter_foo_bar", f.GetURL(framework.HTTPS)), host, host) @@ -177,7 +177,7 @@ var _ = framework.IngressNginxDescribe("Dynamic Certificate", func() { }) It("falls back to using default certificate when secret gets deleted without reloading", func() { - ing, err := f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) + ing, err := f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) ensureHTTPSRequest(fmt.Sprintf("%s?id=dummy_log_splitter_foo_bar", f.GetURL(framework.HTTPS)), host, host) @@ -210,10 +210,10 @@ var _ = framework.IngressNginxDescribe("Dynamic Certificate", func() { It("picks up a non-certificate only change", func() { newHost := "foo2.com" - ing, err := f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) + ing, err := f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred()) ing.Spec.Rules[0].Host = newHost - _, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Update(ing) + _, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Update(ing) Expect(err).ToNot(HaveOccurred()) time.Sleep(waitForLuaSync) @@ -222,10 +222,10 @@ var _ = framework.IngressNginxDescribe("Dynamic Certificate", func() { }) It("removes HTTPS configuration when we delete TLS spec", func() { - ing, err := f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) + ing, err := f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred()) - ing.Spec.TLS = []extensions.IngressTLS{} - _, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Update(ing) + ing.Spec.TLS = []networking.IngressTLS{} + _, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Update(ing) Expect(err).ToNot(HaveOccurred()) time.Sleep(waitForLuaSync) diff --git a/test/e2e/lua/dynamic_configuration.go b/test/e2e/lua/dynamic_configuration.go index 20beefe68..b69bc8e7f 100644 --- a/test/e2e/lua/dynamic_configuration.go +++ b/test/e2e/lua/dynamic_configuration.go @@ -27,7 +27,7 @@ import ( . "github.com/onsi/gomega" "github.com/parnurzeal/gorequest" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/ingress-nginx/internal/nginx" @@ -146,11 +146,11 @@ var _ = framework.IngressNginxDescribe("Dynamic Configuration", func() { return true }) - ingress, err := f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Get("foo.com", metav1.GetOptions{}) + ingress, err := f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get("foo.com", metav1.GetOptions{}) Expect(err).ToNot(HaveOccurred()) ingress.ObjectMeta.Annotations["nginx.ingress.kubernetes.io/load-balance"] = "round_robin" - _, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Update(ingress) + _, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Update(ingress) Expect(err).ToNot(HaveOccurred()) time.Sleep(waitForLuaSync) @@ -184,7 +184,7 @@ var _ = framework.IngressNginxDescribe("Dynamic Configuration", func() { }) }) -func ensureIngress(f *framework.Framework, host string, deploymentName string) *extensions.Ingress { +func ensureIngress(f *framework.Framework, host string, deploymentName string) *networking.Ingress { ing := createIngress(f, host, deploymentName) time.Sleep(waitForLuaSync) ensureRequest(f, host) @@ -192,7 +192,7 @@ func ensureIngress(f *framework.Framework, host string, deploymentName string) * return ing } -func createIngress(f *framework.Framework, host string, deploymentName string) *extensions.Ingress { +func createIngress(f *framework.Framework, host string, deploymentName string) *networking.Ingress { ing := f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, deploymentName, 80, &map[string]string{"nginx.ingress.kubernetes.io/load-balance": "ewma"})) diff --git a/test/e2e/run.sh b/test/e2e/run.sh index bade28563..678d2d996 100755 --- a/test/e2e/run.sh +++ b/test/e2e/run.sh @@ -14,11 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -KIND_LOG_LEVEL="info" +KIND_LOG_LEVEL="0" if ! [ -z $DEBUG ]; then set -x - KIND_LOG_LEVEL="debug" + KIND_LOG_LEVEL="6" fi set -o errexit @@ -41,7 +41,7 @@ export TAG=dev export ARCH=amd64 export REGISTRY=ingress-controller -export K8S_VERSION=${K8S_VERSION:-v1.15.3} +export K8S_VERSION=${K8S_VERSION:-v1.17.0} KIND_CLUSTER_NAME="ingress-nginx-dev" @@ -51,7 +51,7 @@ echo "[dev-env] creating Kubernetes cluster with kind" export KUBECONFIG="${HOME}/.kube/kind-config-${KIND_CLUSTER_NAME}" kind create cluster \ - --loglevel=${KIND_LOG_LEVEL} \ + --verbosity=${KIND_LOG_LEVEL} \ --name ${KIND_CLUSTER_NAME} \ --config ${DIR}/kind.yaml \ --image "kindest/node:${K8S_VERSION}" @@ -59,15 +59,13 @@ kind create cluster \ echo "Kubernetes cluster:" kubectl get nodes -o wide -kubectl config set-context kubernetes-admin@${KIND_CLUSTER_NAME} - echo "[dev-env] building container" echo " make -C ${DIR}/../../ build container make -C ${DIR}/../../ e2e-test-image make -C ${DIR}/../../images/fastcgi-helloserver/ build container make -C ${DIR}/../../images/httpbin/ container -" | parallel --progress {} +" | parallel --progress --joblog /tmp/log {} || cat /tmp/log # Remove after https://github.com/kubernetes/ingress-nginx/pull/4271 is merged docker tag ${REGISTRY}/nginx-ingress-controller-${ARCH}:${TAG} ${REGISTRY}/nginx-ingress-controller:${TAG} @@ -82,11 +80,11 @@ kind load docker-image --name="${KIND_CLUSTER_NAME}" ${REGISTRY}/nginx-ingress-c kind load docker-image --name="${KIND_CLUSTER_NAME}" ${REGISTRY}/fastcgi-helloserver:${TAG} kind load docker-image --name="${KIND_CLUSTER_NAME}" openresty/openresty:1.15.8.2-alpine kind load docker-image --name="${KIND_CLUSTER_NAME}" ${REGISTRY}/httpbin:${TAG} -" | parallel --progress +" | parallel --progress --joblog /tmp/log {} || cat /tmp/log echo "[dev-env] running e2e tests..." make -C ${DIR}/../../ e2e-test kind delete cluster \ - --loglevel=${KIND_LOG_LEVEL} \ + --verbosity=${KIND_LOG_LEVEL} \ --name ${KIND_CLUSTER_NAME} diff --git a/test/e2e/servicebackend/service_backend.go b/test/e2e/servicebackend/service_backend.go index 3829104bb..3a6dba086 100644 --- a/test/e2e/servicebackend/service_backend.go +++ b/test/e2e/servicebackend/service_backend.go @@ -25,7 +25,7 @@ import ( "github.com/parnurzeal/gorequest" corev1 "k8s.io/api/core/v1" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -85,23 +85,23 @@ var _ = framework.IngressNginxDescribe("Service backend - 503", func() { }) -func buildIngressWithNonexistentService(host, namespace, path string) *extensions.Ingress { +func buildIngressWithNonexistentService(host, namespace, path string) *networking.Ingress { backendService := "nonexistent-svc" - return &extensions.Ingress{ + return &networking.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: host, Namespace: namespace, }, - Spec: extensions.IngressSpec{ - Rules: []extensions.IngressRule{ + Spec: networking.IngressSpec{ + Rules: []networking.IngressRule{ { Host: host, - IngressRuleValue: extensions.IngressRuleValue{ - HTTP: &extensions.HTTPIngressRuleValue{ - Paths: []extensions.HTTPIngressPath{ + IngressRuleValue: networking.IngressRuleValue{ + HTTP: &networking.HTTPIngressRuleValue{ + Paths: []networking.HTTPIngressPath{ { Path: path, - Backend: extensions.IngressBackend{ + Backend: networking.IngressBackend{ ServiceName: backendService, ServicePort: intstr.FromInt(80), }, @@ -115,23 +115,23 @@ func buildIngressWithNonexistentService(host, namespace, path string) *extension } } -func buildIngressWithUnavailableServiceEndpoints(host, namespace, path string) (*extensions.Ingress, *corev1.Service) { +func buildIngressWithUnavailableServiceEndpoints(host, namespace, path string) (*networking.Ingress, *corev1.Service) { backendService := "unavailable-svc" - return &extensions.Ingress{ + return &networking.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: host, Namespace: namespace, }, - Spec: extensions.IngressSpec{ - Rules: []extensions.IngressRule{ + Spec: networking.IngressSpec{ + Rules: []networking.IngressRule{ { Host: host, - IngressRuleValue: extensions.IngressRuleValue{ - HTTP: &extensions.HTTPIngressRuleValue{ - Paths: []extensions.HTTPIngressPath{ + IngressRuleValue: networking.IngressRuleValue{ + HTTP: &networking.HTTPIngressRuleValue{ + Paths: []networking.HTTPIngressPath{ { Path: path, - Backend: extensions.IngressBackend{ + Backend: networking.IngressBackend{ ServiceName: backendService, ServicePort: intstr.FromInt(80), }, diff --git a/test/e2e/settings/disable_catch_all.go b/test/e2e/settings/disable_catch_all.go index f5a56f089..95d4b4f81 100644 --- a/test/e2e/settings/disable_catch_all.go +++ b/test/e2e/settings/disable_catch_all.go @@ -25,7 +25,7 @@ import ( "github.com/parnurzeal/gorequest" appsv1 "k8s.io/api/apps/v1" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/ingress-nginx/test/e2e/framework" @@ -88,9 +88,9 @@ var _ = framework.IngressNginxDescribe("Disabled catch-all", func() { Expect(errs).To(BeNil()) Expect(resp.StatusCode).Should(Equal(http.StatusOK)) - err := framework.UpdateIngress(f.KubeClientSet, f.Namespace, host, func(ingress *extensions.Ingress) error { + err := framework.UpdateIngress(f.KubeClientSet, f.Namespace, host, func(ingress *networking.Ingress) error { ingress.Spec.Rules = nil - ingress.Spec.Backend = &extensions.IngressBackend{ + ingress.Spec.Backend = &networking.IngressBackend{ ServiceName: framework.EchoService, ServicePort: intstr.FromInt(80), } diff --git a/test/e2e/settings/no_auth_locations.go b/test/e2e/settings/no_auth_locations.go index a9ea8b90d..da52222f1 100644 --- a/test/e2e/settings/no_auth_locations.go +++ b/test/e2e/settings/no_auth_locations.go @@ -26,7 +26,7 @@ import ( "github.com/parnurzeal/gorequest" corev1 "k8s.io/api/core/v1" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/ingress-nginx/test/e2e/framework" @@ -104,8 +104,8 @@ var _ = framework.IngressNginxDescribe("No Auth locations", func() { }) }) -func buildBasicAuthIngressWithSecondPath(host, namespace, secretName, pathName string) *extensions.Ingress { - return &extensions.Ingress{ +func buildBasicAuthIngressWithSecondPath(host, namespace, secretName, pathName string) *networking.Ingress { + return &networking.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: host, Namespace: namespace, @@ -114,23 +114,23 @@ func buildBasicAuthIngressWithSecondPath(host, namespace, secretName, pathName s "nginx.ingress.kubernetes.io/auth-realm": "test auth", }, }, - Spec: extensions.IngressSpec{ - Rules: []extensions.IngressRule{ + Spec: networking.IngressSpec{ + Rules: []networking.IngressRule{ { Host: host, - IngressRuleValue: extensions.IngressRuleValue{ - HTTP: &extensions.HTTPIngressRuleValue{ - Paths: []extensions.HTTPIngressPath{ + IngressRuleValue: networking.IngressRuleValue{ + HTTP: &networking.HTTPIngressRuleValue{ + Paths: []networking.HTTPIngressPath{ { Path: "/", - Backend: extensions.IngressBackend{ + Backend: networking.IngressBackend{ ServiceName: framework.EchoService, ServicePort: intstr.FromInt(80), }, }, { Path: pathName, - Backend: extensions.IngressBackend{ + Backend: networking.IngressBackend{ ServiceName: framework.EchoService, ServicePort: intstr.FromInt(80), }, diff --git a/test/e2e/settings/pod_security_policy.go b/test/e2e/settings/pod_security_policy.go index 9c7c65d2a..77e5a3415 100644 --- a/test/e2e/settings/pod_security_policy.go +++ b/test/e2e/settings/pod_security_policy.go @@ -27,7 +27,7 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" - extensions "k8s.io/api/extensions/v1beta1" + policyv1beta1 "k8s.io/api/policy/v1beta1" rbacv1 "k8s.io/api/rbac/v1" k8sErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -44,7 +44,7 @@ var _ = framework.IngressNginxDescribe("Pod Security Policies", func() { BeforeEach(func() { psp := createPodSecurityPolicy() - _, err := f.KubeClientSet.ExtensionsV1beta1().PodSecurityPolicies().Create(psp) + _, err := f.KubeClientSet.PolicyV1beta1().PodSecurityPolicies().Create(psp) if !k8sErrors.IsAlreadyExists(err) { Expect(err).NotTo(HaveOccurred(), "creating Pod Security Policy") } @@ -92,23 +92,23 @@ var _ = framework.IngressNginxDescribe("Pod Security Policies", func() { }) }) -func createPodSecurityPolicy() *extensions.PodSecurityPolicy { +func createPodSecurityPolicy() *policyv1beta1.PodSecurityPolicy { trueValue := true - return &extensions.PodSecurityPolicy{ + return &policyv1beta1.PodSecurityPolicy{ ObjectMeta: metav1.ObjectMeta{ Name: ingressControllerPSP, }, - Spec: extensions.PodSecurityPolicySpec{ + Spec: policyv1beta1.PodSecurityPolicySpec{ AllowPrivilegeEscalation: &trueValue, RequiredDropCapabilities: []corev1.Capability{"All"}, - RunAsUser: extensions.RunAsUserStrategyOptions{ + RunAsUser: policyv1beta1.RunAsUserStrategyOptions{ Rule: "RunAsAny", }, - SELinux: extensions.SELinuxStrategyOptions{ + SELinux: policyv1beta1.SELinuxStrategyOptions{ Rule: "RunAsAny", }, - FSGroup: extensions.FSGroupStrategyOptions{ - Ranges: []extensions.IDRange{ + FSGroup: policyv1beta1.FSGroupStrategyOptions{ + Ranges: []policyv1beta1.IDRange{ { Min: 1, Max: 65535, @@ -116,8 +116,8 @@ func createPodSecurityPolicy() *extensions.PodSecurityPolicy { }, Rule: "MustRunAs", }, - SupplementalGroups: extensions.SupplementalGroupsStrategyOptions{ - Ranges: []extensions.IDRange{ + SupplementalGroups: policyv1beta1.SupplementalGroupsStrategyOptions{ + Ranges: []policyv1beta1.IDRange{ { Min: 1, Max: 65535, diff --git a/test/e2e/settings/pod_security_policy_volumes.go b/test/e2e/settings/pod_security_policy_volumes.go index e022c3106..f05cb5ed6 100644 --- a/test/e2e/settings/pod_security_policy_volumes.go +++ b/test/e2e/settings/pod_security_policy_volumes.go @@ -40,7 +40,7 @@ var _ = framework.IngressNginxDescribe("Pod Security Policies with volumes", fun It("should be running with a Pod Security Policy", func() { psp := createPodSecurityPolicy() - _, err := f.KubeClientSet.ExtensionsV1beta1().PodSecurityPolicies().Create(psp) + _, err := f.KubeClientSet.PolicyV1beta1().PodSecurityPolicies().Create(psp) if !k8sErrors.IsAlreadyExists(err) { Expect(err).NotTo(HaveOccurred(), "creating Pod Security Policy") } diff --git a/test/e2e/settings/server_tokens.go b/test/e2e/settings/server_tokens.go index ca659ce97..0ef4b46c6 100644 --- a/test/e2e/settings/server_tokens.go +++ b/test/e2e/settings/server_tokens.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/ginkgo" - extensions "k8s.io/api/extensions/v1beta1" + networking "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/ingress-nginx/test/e2e/framework" @@ -53,22 +53,22 @@ var _ = framework.IngressNginxDescribe("Server Tokens", func() { It("should exists Server header in the response when is enabled", func() { f.UpdateNginxConfigMapData(serverTokens, "true") - f.EnsureIngress(&extensions.Ingress{ + f.EnsureIngress(&networking.Ingress{ ObjectMeta: metav1.ObjectMeta{ Name: serverTokens, Namespace: f.Namespace, Annotations: map[string]string{}, }, - Spec: extensions.IngressSpec{ - Rules: []extensions.IngressRule{ + Spec: networking.IngressSpec{ + Rules: []networking.IngressRule{ { Host: serverTokens, - IngressRuleValue: extensions.IngressRuleValue{ - HTTP: &extensions.HTTPIngressRuleValue{ - Paths: []extensions.HTTPIngressPath{ + IngressRuleValue: networking.IngressRuleValue{ + HTTP: &networking.HTTPIngressRuleValue{ + Paths: []networking.HTTPIngressPath{ { Path: "/", - Backend: extensions.IngressBackend{ + Backend: networking.IngressBackend{ ServiceName: framework.EchoService, ServicePort: intstr.FromInt(80), }, diff --git a/test/e2e/status/update.go b/test/e2e/status/update.go index ea77b9097..ede8d1023 100644 --- a/test/e2e/status/update.go +++ b/test/e2e/status/update.go @@ -87,11 +87,11 @@ var _ = framework.IngressNginxDescribe("Status Update [Status]", func() { err = cmd.Process.Kill() Expect(err).NotTo(HaveOccurred(), "unexpected error terminating kubectl proxy") - ing, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) + ing, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred(), "unexpected error getting %s/%v Ingress", f.Namespace, host) ing.Status.LoadBalancer.Ingress = []apiv1.LoadBalancerIngress{} - _, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).UpdateStatus(ing) + _, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).UpdateStatus(ing) Expect(err).NotTo(HaveOccurred(), "unexpected error cleaning Ingress status") time.Sleep(10 * time.Second) @@ -110,7 +110,7 @@ var _ = framework.IngressNginxDescribe("Status Update [Status]", func() { }() err = wait.Poll(10*time.Second, framework.DefaultTimeout, func() (done bool, err error) { - ing, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) + ing, err = f.KubeClientSet.NetworkingV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{}) if err != nil { return false, nil }