Error with "okteto.yaml": no matches for kind "Ingress"

I have this error during deploy:

k8s/okteto.yaml": no matches for kind “Ingress” in version "networking.k8s.io/v1beta1

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: xxxxxxx-ingress
  namespace: yyyyyyyy
  annotations:
    dev.okteto.com/generate-host: "true"
spec:
  rules:
  - host: zzzzzzzz-yyyyyyyy.cloud.okteto.net
    http:
      paths:
        - path: /
          backend:
            serviceName: service-web      
            servicePort: 8080
        - path: /api
          backend:
            serviceName: service-api     
            servicePort: 8080
        - path: /db
          backend:
            serviceName: mysqldb     
            servicePort: 3306

Hi mscarceller!

In which cluster are you running this? Is it a custom cluster or cloud.okteto.com?

Kubernetes has deprecated networking.k8s.io/v1beta1 in favor of networking.k8s.io/v1, changing that should solve your issue. (k8s info)

This error might happen to you since cloud.okteto.com has been upgraded to k8s 1.23

1 Like

I’m using cloud.okteto.com
If i change to networking.k8s.io/v1 i get this error:

error executing command 'kubectl apply -f k8s/okteto.yaml': exit status 1

thanks

I got it :grinning:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: xxxxxxxxx-ingress
  namespace: yyyyyyyyy
  annotations:
    dev.okteto.com/generate-host: "true"
spec:
  rules:
  - host: xxxxxxxxx-yyyyyyyyy.cloud.okteto.net
    http:
      paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: service-web      
              port: 
                number: 8080
        - path: /api
          pathType: Prefix
          backend:
            service:
              name: service-api     
              port: 
                number: 8080
        - path: /db
          pathType: Prefix
          backend:
            service:
              name: mysqldb     
              port: 
                number: 3306

Thanks @AgustinRamiroDiaz

1 Like