Welcome to the Linux Foundation Forum!

Metadata in YAML


I have a question that isn't specific to any lab...

I have been using the API documentation to help write YAML content, and trying to understand the various values that are permissible in ObjectMeta for each "kind".

Sometimes label values are important, and sometimes annotations are important - but I can't see where that is described in the doco. For example, for an object of kind Ingress, you need an annotation of kubernetes.io/ingress.class

No where in the documentation can I find guidance on what is needed when. This isn;t limited to the Ingress kind, it is a common problem. Where can I find this detail?


  • serewicz
    serewicz Posts: 1,000


    You are not alone in noticing this lack of consistent configuration. With so many folks working on the project, with loose connection to one another, there is not a consistent application of guidelines. What should be the case is labels are used only as a selector and annotations are used for non-selector configuration. More on what should be done can be found here: https://github.com/kubernetes/community/tree/master/contributors/devel

    Hopefully as the project matures the various SIGs can focus on streamlining this sort of convention. Until then there is only concerned folks who become developers and try to make it better.



Upcoming Training