Game of pods "Iron Gallery" is unable to complete

Trying to do the Game of Pods, exercise “Iron Gallery”, I get an error when trying to create an Ingress resource:

master $ k create -f ingress.yml
error: unable to recognize "ingress.yml": no matches for kind "Ingress" in version "networking.k8s.io/v1beta1"

ingress.yml contains the following

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          serviceName: test
          servicePort: 80

this definition file working fine for me.

Are you using the Iron Gallery game or are you running it on your own K8s installation?

Using Iron Gallery Game.

This seems to be because the Kubernetes cluster provided for this exercise, is version 1.11. Come on Kodekloud, at least make sure your exercises can run on the environments you provide, please test it before releasing it to end users.

master $ k version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.3", GitCommit:"a4529464e4629c21224b3d52edfe0ea91b072862", GitTreeState:"clean", BuildDate:"2018-09-09T18:02:47Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.3", GitCommit:"a4529464e4629c21224b3d52edfe0ea91b072862", GitTreeState:"clean", BuildDate:"2018-09-09T17:53:03Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

I get a seemingly random K8s version every time I load this exercise. Sometimes it’s 1.11, sometimes it’s 1.14 and neither version works with the Ingress resource.

Actually i tested this on v1.18 on katakoda and It’s ran without any errors.

I am sure it works fine on Kubernetes v1.18, however that is irrelevant if I am given access to a v1.11 or v1.14 cluster. So perhaps the issue is that I am not presented with a v1.18 cluster.

I took out this line

pathType: Prefix

And it worked for me. Yes the ingress yaml file is out of date to the current version of k8s, and so the official docs isn’t much help either.