Skip to content
Latchkey

Tekton "secret X not found" in CI

A ServiceAccount, workspace, or step env references a Secret by name that Tekton cannot find in the run namespace. Depending on where it is referenced, the run fails to start or the pod stays Pending.

What this error means

A run or pod fails with "secret \"git-creds\" not found" or "secrets \"git-creds\" not found" in events.

Tekton
secrets "git-creds" not found

Common causes

The Secret is not in the run namespace

Secrets are namespaced. A Secret applied to another namespace does not resolve for this run.

A name typo in a ServiceAccount or env ref

The ServiceAccount secrets entry or a secretKeyRef names a Secret that does not exist.

How to fix it

Create the Secret in the run namespace

  1. Confirm the namespace the run uses.
  2. Apply or create the Secret there.
  3. Re-run once the Secret exists.
Terminal
kubectl create secret generic git-creds \
  --from-literal=token=$GIT_TOKEN -n ci

Correct the referenced name

Ensure the ServiceAccount and step refs name a Secret that exists in the namespace.

Terminal
kubectl get secret -n ci

How to prevent it

  • Apply Secrets into the same namespace as the runs that use them.
  • Keep ServiceAccount and env secret names matched to real objects.
  • Provision CI secrets as part of namespace setup.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →