You can list the current namespaces in a cluster using:
kubectl get namespace
To set the namespace for a current request, use the --namespace flag. For example:
kubectl get pods --namespace=[namespaceName]
You can permanently save the namespace for all subsequent kubectl commands in that context.
kubectl config set-context --current --namespace=[namespaceName]
¿Quieres ver más aportes, preguntas y respuestas de la comunidad?