educative.io

Getting errors for Ingress configuration from examples

I am getting the following error:

error: unable to recognize "ingress/go-demo-2-ingress.yml": no matches for kind "Ingress" in version "extensions/v1beta1"

Hey - from what I gather a lot has changed re Kubernetes/kops since this course was written and i have struggled to get stuff to work as described.

First thing is that if you are using a newer version of kubernetes, Ingress has changed apiVersion etc

For that particular part of the course I believe I had to change the given yaml file to this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: go-demo-2
  annotations:
    kubernetes.io/ingress.class: "nginx"
    ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
  rules:
  - http:
      paths:
      - path: /demo
        pathType: ImplementationSpecific
        backend:
          service:
            name: go-demo-2-api
            port:
              number: 8080

So changing the apiVersion and also changing serviceName to be a nested field etc