Welcome to the Linux Foundation Forum!

Exercise 10.1

Hi all,

I upgraded K8s to 1.18.2 and I'm still getting an error while running:
$ kubectl edit ingress ingress test

 # ingresses.extensions "ingress-test" was not valid:
 # * : Invalid value: "The edited file failed validation": ValidationError(Ingress.spec.rules[0].http.paths[0]): unknown field "pathType" in io.k8s.api.extensions.v1beta1.HTTPIngressPath

Comments

  • chrispokorni
    chrispokorni Posts: 2,349

    Hi @tduszyk,

    From the error provided, it seems to be an issue with the yaml of your ingress. Such issues are not fixed by cluster upgrades, but by carefully examining the yaml for incorrect indentation or unexpected configuration fields.

    I suggest starting with the yaml file included in the SOLUTIONS tarball and start making edits to that in order to preserve as much of the correct indentation as possible.

    In addition, I recommend reviewing the official documentation as well:

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

    Regards,
    -Chris

  • tduszyk
    tduszyk Posts: 4

    Hi @chrispokorni

    I am using the file provided in the SOLUTIONS tarball, plus the necessary edits. This unknown field pathType is actually what we are being asked to add to the file.

    apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
    annotations:
    kubernetes.io/ingress.class: traefik
    creationTimestamp: "2020-05-20T11:20:19Z"
    generation: 1
    name: ingress-test
    namespace: default
    resourceVersion: "1684153"
    selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/ingress-test
    uid: de4136aa-4a85-4f95-a1b2-cd3dcb276341
    spec:
    rules:
    - host: www.example.com
    http:
    paths:
    - backend:
    serviceName: secondapp
    servicePort: 80
    path: /
    pathType: ImplementationSpecific
    - host: thirdpage.org
    http:
    paths:
    - backend:
    serviceName: thirdpage
    servicePort: 80
    path: /
    pathType: ImplementationSpecific
    status:
    loadBalancer: {}

  • chrispokorni
    chrispokorni Posts: 2,349

    It seems to be an older version of the file. The apiVersion is incorrect. apiVersion should be networking.k8s.io/v1beta1. You can see that in the documentation too following the link provided earlier.

    Have you downloaded the most up-to-date SOLUTIONS tarball, supporting the current course version 1.18.1? Because the latest tarball includes the file with the correct apiVersion.

    Regards,
    -Chris

  • tduszyk
    tduszyk Posts: 4

    Yes, I downloaded the newest SOLUTIONS.
    I ran kubectl delete ingress ingress-test to delete and recreate it using kubectl create -f ./ingress.rule.yaml but it didn't help. When I am trying to edit ingress, I have the wrong apiVersion. What am I doing wrong?

  • chrispokorni
    chrispokorni Posts: 2,349
    edited May 2020

    The lab exercise works as expected on Kubernetes 1.18.1, as it is presented in the lab manual. I just ran the Ingress exercise and it all worked fine. I also downloaded a new copy of the SOLUTIONS tarball and the included ingress.rule file shows the correct apiVersion.

    What was your Kubernetes version before the upgrade to 1.18.2? Did you upgrade all your nodes to 1.18.2? Things may change between minor versions also, so expect things to behave differently when running the labs on a different version than the one presented in the manual.

    You can also try editing the ingress.rule file right before creating the ingress resource. Have you tried that instead?

    Regards,
    -Chris

  • tduszyk
    tduszyk Posts: 4

    Thank you Chris.

    I ended up redeploying fresh Ubuntu 18.04 VMs and installing K8s 1.18.1-00. It's working now as expected.

Categories

Upcoming Training