Migrate ingress definitions from extensions to networking.k8s.io

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-12-12 20:12:12 -03:00
parent be1907142b
commit 0dce5be743
49 changed files with 186 additions and 189 deletions

View file

@ -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: <certificate.pem | base64>
---

View file

@ -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: <pem encoded ca cert that signs the server cert used by the webhook>
```

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: nginx-test

View file

@ -30,7 +30,7 @@ type: Opaque
```console
echo "
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-with-auth

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:

View file

@ -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:

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:

View file

@ -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

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:

View file

@ -54,7 +54,7 @@ spec:
targetPort: 8080
---
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: nginx-configuration-snippet

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo-auth-service

View file

@ -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

View file

@ -5,7 +5,7 @@ metadata:
---
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: docker-registry

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: fortune-teller-app

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: http-svc

View file

@ -90,9 +90,9 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
---
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: foo-tls

View file

@ -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:

View file

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress-nginx

View file

@ -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

View file

@ -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:

View file

@ -32,7 +32,7 @@ Rules:
/tea tea-svc:80 (<none>)
/coffee coffee-svc:80 (<none>)
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

View file

@ -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

View file

@ -60,7 +60,7 @@ data:
---
apiVersion: extensions/v1beta1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:

View file

@ -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

View file

@ -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:

View file

@ -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

View file

@ -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))

View file

@ -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),
},

View file

@ -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
})

View file

@ -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
})

View file

@ -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,
},

View file

@ -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,

View file

@ -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
}

View file

@ -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
}

View file

@ -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")
}

View file

@ -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)

View file

@ -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"}))

View file

@ -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}

View file

@ -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),
},

View file

@ -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),
}

View file

@ -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),
},

View file

@ -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,

View file

@ -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")
}

View file

@ -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),
},

View file

@ -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
}