Newbie question regarding retrieving ressources which are not in a namespace

Hello together,
I have created a secret which shall be available in all my namespaces. Via Rancher GUI this is not a problem. However, I would now also like to be able to reference to this secret.

kubectl get secrets

does not show the secret. And I have not found any description yet how to retrieve a ressource which is not in a namespace. Would be great if someone could provide help here.

Best regards,
Christoph

Try one of these:
kubectl get secrets --all-namespaces
kubectl get secrets -n <namespace>

Hello shubbard343,
I solved the issue in the meantime. I realized, when I create a secret and allow all namespaces in a project to access the secret, then the secret is actually not placed in a global namespace, but a copy seems to be created into each namespace. So getting it via the namespace was the right way to do it.

Thanks for your answer.

Best regards,
Christoph

There is no Kubernetes concept of a secret available in all namespaces. So it’s kept in the management plane and then synched down as individual copies to the namespaces that are part of the project.

Hello Vincent,
how could I than display elements from the management plane? This all namespaces seemed not to work.

It doesn’t actually exist in the cluster, so you can’t see or manage it from kubectl.

(Technically, it is a type in the management cluster that you could connect to and see in a HA install, but we do not recommend or really support direct manipulation of resources inside the local cluster).

Hello Vincent,
thanks for the explanation!