From 5552fdf814f8ee16b534c354d3e710fafd4cb53b Mon Sep 17 00:00:00 2001 From: Tiago Ferreira Date: Wed, 12 Jan 2022 19:08:14 +0000 Subject: [PATCH] Fix api version for ingress objects on K8s version <1.19 (#8112) --- docs/user-guide/basic-usage.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/docs/user-guide/basic-usage.md b/docs/user-guide/basic-usage.md index cbb7004c7..089c08b3e 100644 --- a/docs/user-guide/basic-usage.md +++ b/docs/user-guide/basic-usage.md @@ -9,7 +9,7 @@ Let's say that you want to expose the first at `myServiceA.foo.org` and the seco If cluster version < 1.19 you can create two **ingress** resources like this: ``` -apiVersion: networking.k8s.io/v1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: ingress-myservicea @@ -20,14 +20,11 @@ spec: http: paths: - path: / - pathType: Prefix backend: - service: - name: myservicea - port: - number: 80 + serviceName: myservicea + servicePort: 80 --- -apiVersion: networking.k8s.io/v1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: ingress-myserviceb @@ -40,15 +37,12 @@ spec: http: paths: - path: / - pathType: Prefix backend: - service: - name: myserviceb - port: - number: 80 + serviceName: myserviceb + servicePort: 80 ``` -If cluster version >= 1.19 the Ingress resource above will not work, instead of annotations you should use the new `ingressClassName: nginx` property. +If the cluster uses Kubernetes version >= 1.19.x, then its suggested to create 2 ingress resources, using yaml examples shown below. These examples are in conformity with the `networking.kubernetes.io/v1` api. ``` apiVersion: networking.k8s.io/v1