Welcome to the Linux Foundation Forum!

[LFS258 Kubernetes fundamentals][Lab 4.2 - Resource Limits for a Namespace]

Hi there I am on Lab 4.2 - Resource Limits for a Namespace of the course Kubernetes Fundamentals (LFS258), I am struggling since yesterday to create a LimitRange resource in a namespace using the following spec:

However when I run the command kubectl --namespace=low-usage-limit apply -f limitrange.yaml, i got the following error
error: error validating "limitrange.yaml": error validating data: unknown object type "nil" in LimitRange.spec.limits[0].default.cpu; if you choose to ignore these errors, turn validation off with --validate=false


  • serewicz
    serewicz Posts: 1,000


    Chances are the issue is with white space indentation. If you post the output using code type, or perhaps a screen shot of the output, we can try to troubleshoot the issue. Another idea is to use yamllint.com/ or https://json2yaml.com/

    These sites may help expose the syntax issue.


  • serewicz
    serewicz Posts: 1,000

    Hello again,

    When you diff your file and ~/LFS458/SOLUTIONS/s_03/low-resource-range.yaml are there any differences?


  • MouhamadouGueye
    MouhamadouGueye Posts: 4
    edited August 2020

    The spec is valid according to the yamllint
    However, I forgot in to set the value of the cpu parameter to 1, that was the origin of the error

    cpu: 1
    memory: 500Mi

  • serewicz
    serewicz Posts: 1,000

    Great! Glad it's working. I checked each line you wrote for depth,but didn't consider a line missing. Hopefully the diff showed what was missing.



Upcoming Training