Workflows
Passing secrets to the Pipeline
We're currently working on providing alternative ways to read secrets from both self hosted and SaaS providers. If you'd like early access, reach out.
To allow the Pipeline to access in-cluster secrets, you will need to use Kubernetes RBAC.
Make sure to target the platform cluster and do the following:
Create the Secret you'd like to access. For example:
kubectl create secret generic promise-secret \
--from-literal=apikey=topsecretCreate a ClusterRole giving
get
permissions to thepromise-secret
created above:kubectl create clusterrole promise-secret-cr \
--verb=get \
--resource=secrets \
--resource-name=promise-secretCreate a ClusterRoleBinding to associate the Pipeline ServiceAccount created by Kratix. For Promise Pipelines the service accounts are called
PROMISE-promise-pipeline
in thekratix-platform-system
namespace and for Resource PipelinesPROMISE-resource-pipeline
in whatever namespace the resource is requested in.# Replace PROMISE with the name of your Promise
kubectl create clusterrolebinding promise-secret \
--clusterrole=promise-secret-cr \
--serviceaccount=default:PROMISE-default-resource-pipeline$Access the Base64 enconded Secret in the Pipeline with the
kubectl
CLIkubectl get secret promise-secret -o=jsonpath='{.data.apikey}'
For a working example, check the Slack Promise available in the Marketplace.