Welcome to the Linux Foundation Forum!

All objects are restricted to a single namespace. True or False?

Can someone ellaborate on this? I think every object must be in a single namespace (default or any other) and cannot be in two namespaces at the same time. Is there an exception for this?

Best Answer

  • chrispokorni
    chrispokorni Posts: 2,301
    Answer ✓

    Hi @ilmx,

    The exception is/are the non-namespaced objects, that live clusterwide - visible to all namespaces. For a list of all namespaced and clusterwide objects, run the following command:

    kubectl api-resources
    

    For additional output, try the command with the -o wide flag.

    Regards,
    -Chris

Answers

  • spljaa
    spljaa Posts: 2

    There are cluster wide resources, aren't there?
    If some object is on namespace level then I haven't notice option to be multiple namespaces ;)
    ClusterRole would be one without namespace at all:
    https://kubernetes.io/docs/reference/access-authn-authz/rbac/
    I'm not native English, and my personal opinion is that such questions are hard to translate.
    I would go with False answer as zero is not "single". However if object has an namespace attribute, then it is single...

  • ilmx
    ilmx Posts: 13

    Thanks! I understand now.
    It is a tricky question. All objects are restricted to a single namespace EXCEPT those that cannot belong to a namespace. Clear now.

Categories

Upcoming Training