Welcome to the Linux Foundation Forum!

clarification on namespaces

Hi,
i took the knowledge check in APIs and Access.
in question 5.5 - all objects are restricted to a single namespace. the correct answer is false but in the kubernetes documentation i found this: "Namespaces can not be nested inside one another and each Kubernetes resource can only be in one namespace."

any clarifications ?

Comments

  • turnes
    turnes Posts: 4

    Some objects apply for all namespaces or does not belong to a specific namespace . Try "kubectl api-resources" you will see some resources are not namespaced.

    NAME                              SHORTNAMES   APIGROUP                       NAMESPACED   KIND
    bindings                                                                      true         Binding
    componentstatuses                 cs                                          false        ComponentStatus
    configmaps                        cm                                          true         ConfigMap
    endpoints                         ep                                          true         Endpoints
    events                            ev                                          true         Event
    limitranges                       limits                                      true         LimitRange
    namespaces                        ns                                          false        Namespace
    
  • chrispokorni
    chrispokorni Posts: 2,346

    Hi @gharbi.bdr

    It means that you cannot nest namespaces, that is you cannot create a namespace inside another namespace.

    And, a namespaced Kubernetes resource can only live in one namespace, but if it is deployed in a second namespace, that second deployment is already a separate, isolated instance of that resource.

    Regards,
    -Chris

Categories

Upcoming Training