Skip to main content
Version: main 🚧

Retrieve project secrets

Use the vCluster CLI when working within the platform's project abstraction, as it lets you refer to secrets by name and project without knowing the underlying namespace. Use kubectl when you need the raw Kubernetes secret object, work in a CI/CD pipeline that already has a kube context, or are in an environment where the vCluster CLI is not available.

Retrieve using vCluster CLI​

To retrieve a specific project secret, run:

vcluster platform get secret SECRET_NAME [flags]

To list all secrets in a project, run:

vcluster platform list secrets --project default

Retrieve using kubectl​

To get a list of project secrets using kubectl, run the following command:

kubectl get secrets --all-namespaces --selector loft.sh/project-secret

If you want to only list project secrets for a project, add the project's namespace to the command:

kubectl get secrets --namespace loft-project-default --selector loft.sh/project-secret