Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No matches for kind "Ingress" in version "networking.k8s.io/v1" #90077

Closed
vitalybibikov opened this issue Apr 11, 2020 · 30 comments
Closed

No matches for kind "Ingress" in version "networking.k8s.io/v1" #90077

vitalybibikov opened this issue Apr 11, 2020 · 30 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/network Categorizes an issue or PR as relevant to SIG Network. triage/unresolved Indicates an issue that can not or will not be resolved.

Comments

@vitalybibikov
Copy link

I want to upgrade my cluster version from 1.15.10 to 1.16.7.
Prior to that I'm trying to update all the APIs.

Release notes to 1.16.0 state:
The following APIs are no longer served by default:

  • All resources under apps/v1beta1 and apps/v1beta2 - use apps/v1 instead
  • daemonsets, deployments, replicasets resources under extensions/v1beta1 - use apps/v1 instead
  • networkpolicies resources under extensions/v1beta1 - use networking.k8s.io/v1 instead
  • podsecuritypolicies resources under extensions/v1beta1 - use policy/v1beta1 instead

Release notes to 1.18.0 state:
The following deprecated APIs can no longer be served.

What happened:
When I change apiVersion in my Ingress from
apiVersion: networking.k8s.io/v1beta1
to
apiVersion: networking.k8s.io/v1

I get:
no matches for kind "Ingress" in version "networking.k8s.io/v1"

What you expected to happen:

Actually, I'm a bit of confused,
as currently kind: Ingress can only be served under v1beta1.

A PR #88509 states, that some changes had to be done, before graduation of the Ingress to v1.

So, the question is:
For now, I guess I should use --runtime-config apiserver flag to re-enable apis, but later?

How can I upgrade my cluster, if in 1.18.* v1beta1 is already deprecated, while kind:ingress is moved to v1 only in 1.19 (or later)?

Provider: Azure
Cluster Version: 1.15.10
Kubectl version: "v1.16.8". (tried on 1.15.5 and "v1.18.1") as well
OS: Windows 10 Pro, 1909 (18363.720)

@vitalybibikov vitalybibikov added the kind/bug Categorizes issue or PR as related to a bug. label Apr 11, 2020
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Apr 11, 2020
@vitalybibikov
Copy link
Author

/sig network

@k8s-ci-robot k8s-ci-robot added sig/network Categorizes an issue or PR as relevant to SIG Network. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 11, 2020
@athenabot
Copy link

/triage unresolved

Comment /remove-triage unresolved when the issue is assessed and confirmed.

🤖 I am a bot run by vllry. 👩‍🔬

@k8s-ci-robot k8s-ci-robot added the triage/unresolved Indicates an issue that can not or will not be resolved. label Apr 11, 2020
@liggitt
Copy link
Member

liggitt commented Apr 11, 2020

Ingress is not yet available under networking.k8s.io/v1, the release note is for NetworkPolicy objects

@liggitt liggitt closed this as completed Apr 11, 2020
@zafercavdar
Copy link

According to Kubernetes docs, ingress is available at networking.k8s.io/v1beta1

@BorntraegerMarc
Copy link

BorntraegerMarc commented Sep 21, 2020

I'm a bit confused. Doesn't the official site say that we should use networking.k8s.io/v1?

@liggitt
Copy link
Member

liggitt commented Sep 21, 2020

networking.k8s.io/v1 is available in Kubernetes v1.19+

@cyclelabs-ryanberger
Copy link

networking.k8s.io/v1beta1 == 1.14 to 1.18

networking.k8s.io/v1 = 1.19+

@ygbingo
Copy link

ygbingo commented Jan 8, 2021

I got the same error . And this is my k8s version:

Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.10", GitCommit:"62876fc6d93e891aa7fbe19771e6a6c03773b0f7", GitTreeState:"clean", BuildDate:"2020-10-16T20:43:34Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}

When I usr apiVersion: networking.k8s.io/v1
I got the error message:

error: unable to recognize ".\\dashboard-ingress.yaml": no matches for kind "Ingress" in version "networking.k8s.io/v1"

And then I change my apiVersion to "networking.k8s.io/v1beta",
I got the error message like that

error: error validating ".\\dashboard-ingress.yaml": error validating data: ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field "service" in io.k8s.api.networking.v1beta1.IngressBackend; if you choose to ignore these errors, turn validation off with --validate=false

Is that my format wrong??

my-ingress.yaml

apiVersion: networking.k8s.io/v1beta
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: kube-dashboard
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
    - http:
        paths:
          - path: /dashboard
            pathType: Prefix
            backend:
              service:
                name: kubernetes-dashboard
                port:
                  number: 8080

thisisnotashwin added a commit to hashicorp/consul-helm that referenced this issue Jan 26, 2021
* fix api version for ingress
* Use v1beta1 for kubernetes version < 1.19
kubernetes/kubernetes#90077 (comment)
* Update consul helm image version for tests
* Add comment describing why we use KubeVersion to determine the
apiVersion.
@fongrx7
Copy link

fongrx7 commented Jan 27, 2021

I got the same error . And this is my k8s version:

Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.10", GitCommit:"62876fc6d93e891aa7fbe19771e6a6c03773b0f7", GitTreeState:"clean", BuildDate:"2020-10-16T20:43:34Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}

When I usr apiVersion: networking.k8s.io/v1
I got the error message:

error: unable to recognize ".\\dashboard-ingress.yaml": no matches for kind "Ingress" in version "networking.k8s.io/v1"

And then I change my apiVersion to "networking.k8s.io/v1beta",
I got the error message like that

error: error validating ".\\dashboard-ingress.yaml": error validating data: ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field "service" in io.k8s.api.networking.v1beta1.IngressBackend; if you choose to ignore these errors, turn validation off with --validate=false

Is that my format wrong??

my-ingress.yaml

apiVersion: networking.k8s.io/v1beta
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: kube-dashboard
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
    - http:
        paths:
          - path: /dashboard
            pathType: Prefix
            backend:
              service:
                name: kubernetes-dashboard
                port:
                  number: 8080

I have the same problem with 1.18, haven't found a solution yet

@seadoherty
Copy link

@fongrx7 sounds like we're in a similar spot.
Was able to get a little further but still wasn't 100% so if it helps...
Getting Version: 1.0.0 on http://172.17.0.3:31995/
Getting Version: 2.0.0 on posts.com/v2 (post.com is in etc/hosts as 172.17.0.3)
Was able to get there by creating a separate Service file

web-serv.yaml

apiVersion: v1
kind: Service
metadata:
  name: web-srv
spec:
  selector:
    app: posts
  ports:
    - name: posts
      protocol: TCP
      port: 8080
      targetPort: 8080

example-ingress.yaml:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
    - host: posts.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              serviceName: web-srv
              servicePort: 8080
          - path: /v2
            pathType: Prefix
            backend:
              serviceName: web2
              servicePort: 8080

@rohitdurvasula
Copy link

@liggitt I am sure I am misinterpreting this, but why does a 1.18.1 kubectl recommend using networking.k8s.io/v1 if that is only available in 1.19+ ?

# kubectl version --short
Client Version: v1.18.1
Server Version: v1.18.1
# kubectl get --raw /apis/networking.k8s.io | jq .
{
  "kind": "APIGroup",
  "apiVersion": "v1",
  "name": "networking.k8s.io",
  "versions": [
    {
      "groupVersion": "networking.k8s.io/v1",
      "version": "v1"
    },
    {
      "groupVersion": "networking.k8s.io/v1beta1",
      "version": "v1beta1"
    }
  ],
  "preferredVersion": {
    "groupVersion": "networking.k8s.io/v1",
    "version": "v1"
  }
}

@hoang-innomize
Copy link

hoang-innomize commented Jul 13, 2021

I also faced this issue when running with Kubernetes 1.18

Client Version: v1.19.7
Server Version: v1.18.16-eks-7737de

  "kind": "APIGroup",
  "apiVersion": "v1",
  "name": "networking.k8s.io",
  "versions": [
    {
      "groupVersion": "networking.k8s.io/v1",
      "version": "v1"
    },
    {
      "groupVersion": "networking.k8s.io/v1beta1",
      "version": "v1beta1"
    }
  ],
  "preferredVersion": {
    "groupVersion": "networking.k8s.io/v1",
    "version": "v1"
  }
}

So from what I can understand, we have to upgrade Kubernetes 1.19+ to get this works?

@liggitt
Copy link
Member

liggitt commented Jul 13, 2021

yes, Ingress v1 only exists in 1.19+

@hoang-innomize
Copy link

Hmm, but I really confused about the log above, seems the v1 is there. And if we are using v1.18 we can change back to v1beta1 and it still works right?

@liggitt
Copy link
Member

liggitt commented Jul 13, 2021

the networking.k8s.io/v1 group/version exists in 1.18, but only contains NetworkPolicy (https://github.com/kubernetes/api/blob/release-1.18/networking/v1/types.go)

vijay-veeranki added a commit to ministryofjustice/cloud-platform-user-guide that referenced this issue Sep 7, 2021
This is for ingress as networking.k8s.io/v1 is supported from k8s 1.19,
live-1 is 1.18.

issue related to it:
kubernetes/kubernetes#90077
@bishal7679
Copy link
Member

I want to create an ingress in kubernetes-dashboard but this giving me an error with the apiversion networking.k8s.io/v1beta1
how can resolve this @hoang-innomizetech @liggitt pls help me out

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: dashboard-ingress
namespace: kubernetes-dashboard
spec:
rules:

  • host: dashboard.com
    http:
    paths:
    • backend:
      serviceName: kubernetes-dashboard
      servicePort: 80

@theAkito
Copy link

theAkito commented Mar 12, 2022

@bishal7679

  1. Change the apiVersion's value to networking.k8s.io/v1.
  2. Overhaul your current Ingress definition, to match the newest specification.

https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122

For example, you have to change servicePort to service.port.number and serviceName to service.name. You are also required to provide an explicit pathType, etc. All that is shown in the above link.

If you change everything according to the changes shown in the link, such a conversion works. I have tested it.

@epochsupport
Copy link

HI Team,

I want to route the request to external Load balancer of 3rd party vendor from the ingress/Service, Could you help on that

@dem4gus
Copy link

dem4gus commented Mar 14, 2022

I'm not a member of the Kubernetes team so I obviously can't speak for them, but I don't think this issue is an appropriate place to be requesting support like that. You can refer to the Kubernetes documentation and the documentation for your 3rd party vendor if you need more help.

https://kubernetes.io/docs/concepts/services-networking/

@decipher27
Copy link

Facing this while creating an Ingress
error: unable to recognize "es-ingress.yaml": no matches for kind "Ingress" in version "networking.k8s.io/v1"

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kots.io/app-slug: lite
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/configuration-snippet: |
      more_set_headers "server: hide";
      more_set_headers "X-Content-Type-Options: nosniff";
      more_set_headers "X-Frame-Options: DENY";
      more_set_headers "X-Xss-Protection: 1";
      more_clear_headers Server;
  labels:
    app: atlas
    app.kubernetes.io/managed-by: Tiller
    kots.io/app-slug: lite
    kots.io/backup: velero
    release: ditto
  name: ditto-ing
  namespace: ditto
spec:
  rules:
  - host: <Domain> 
    http:
      paths:
      - backend:
          service:
            name: pok-ditto-service
            port:
              number: 3822
        path: /api/dito(/|$)(.*)
        pathType: Prefix
  tls:
  - hosts:
    - <Domain> 
    secretName: tls-wildcard-ditto

@liggitt
Copy link
Member

liggitt commented Jun 15, 2022

Facing this while creating an Ingress
error: unable to recognize "es-ingress.yaml": no matches for kind "Ingress" in version "networking.k8s.io/v1"

what server version are you running against (what does kubectl version show)?

v1 Ingress was added in 1.19.

@decipher27
Copy link

❯ kubectl version --short
Client Version: v1.23.5
Server Version: v1.18.20-eks-154371

@aojea
Copy link
Member

aojea commented Jun 15, 2022

Server Version: v1.18.20-eks-154371

v1 Ingress was added in 1.19.

@decipher27
Copy link

Still not able to create using the same kind and version.
Later created using apiVersion as networking.k8s.io/v1beta1 and some modifications to the spec.

@aojea
Copy link
Member

aojea commented Jun 16, 2022

v1 is not present on the server version you are using

@kbansod
Copy link

kbansod commented Jun 30, 2022

I am trying to change my template to use networking.k8s.io/v1 from networking.k8s.io/v1beta1

My pod gets created/deployed but it doesn't create any routes.

My ingress example is attached. I am not able to figure what would be missing. Please help me out.
ingress.yaml.txt

Environment details:

kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.0", GitCommit:"878f5a8fe0d04ea70c5e5de11fa9cc7a49afb86e", GitTreeState:"clean", BuildDate:"2022-06-01T00:19:52Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.5+3afdacb", GitCommit:"3c28e7a79b58e78b4c1dc1ab7e5f6c6c2d3aedd3", GitTreeState:"clean", BuildDate:"2022-05-10T16:30:48Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}

@aojea
Copy link
Member

aojea commented May 31, 2023

@marthasimons87 are you sure you are commenting on the right issue?

this is about Ingress and the problem is very clear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/network Categorizes an issue or PR as relevant to SIG Network. triage/unresolved Indicates an issue that can not or will not be resolved.
Projects
None yet
Development

No branches or pull requests