Why are namespaces created via the kubectl CLI not assigned to a project?
Article Number: 000020218
Environment
SUSE Rancher 2.7.x
SUSE Rancher 2.8.x
Situation
When a user creates a Kubernetes namespace via the Rancher UI, API or CLI the namespace is created within a specified Rancher project in the cluster; however, when a user creates a namespace via the kubectl CLI (kubectl create ns <namespace>
) it is created outside of any project, why is this?
Cause
- It is expected behavior that namespaces created via the kubectl CLI are created outside of a Project.
- Projects are Rancher abstractions and do not exist natively within Kubernetes, as a result when you create a namespace via the kubectl CLI, it is not associated with any project in Rancher.