Give a workload an API key
Declare a Credential resource and the operator mints an API key into a Secret for your workload.
A Credential resource gives one workload its own API key for a Nova cluster that runs auth.mode: jwt. You declare the key's scope, the cluster mints the key, and the operator writes it to a Secret beside the resource. The workload loads the Secret as its environment, and every Nova client reads the key from NOVA_API_KEY. Nobody copies a secret by hand, and deleting the resource revokes the key.
Mint a key
The example keeps the workload in its own namespace, apps. Create it, and let the cluster trust it, before you start:
constellation:
spec:
auth: { mode: jwt, credentialNamespaces: [apps] }kubectl create namespace apps
helm upgrade nova deploy/helm/nova --namespace nova --values values.yamlDeclare the credential
apiVersion: nova.dev/v1alpha1
kind: Credential
metadata:
name: orders
namespace: apps
spec:
constellation: { name: nova, namespace: nova }
scope: "nova:append:demo:* nova:read:demo:*"kubectl apply -f credential.yaml
kubectl -n apps get credentialsNAME KEY STATE
orders 900e1f14e3cbee6f ActiveKEY is the key's public id. The credential is named <namespace>/<name> inside Nova, here apps/orders. A Credential in another namespace than the cluster's needs that namespace listed in the cluster's auth.credentialNamespaces; the cluster's own namespace always may ask.
Load it in the workload
The operator writes the key to the Secret <name>-credential, under NOVA_API_KEY:
envFrom:
- secretRef:
name: orders-credentialThe Go and TypeScript SDKs and the nova CLI trade the key for a short-lived token on their own. Through a port-forwarded Gateway:
NOVA_API_KEY=… nova --addr http://localhost:8422 read nova://demo/events --from 00 2026-11-22T19:24:08+01:00 hello
1 2026-11-22T19:24:08+01:00 worldThe scope
The scope is a list of grants, each nova:<action>:<bucket>:<key>. A trailing * on the bucket or the key matches every name that starts with what comes before it. The actions are append, read, list, create, delete and trim. A scope can go as high as nova:admin, which is why each cluster lists the namespaces it trusts. Two scopes are refused for any workload: nova:node, the identity of the cluster's own nodes, and nova:gateway, the Gateway's.
A request outside the scope is refused. This key cannot list the bucket:
novactl: rpc error: code = PermissionDenied desc = dataplane: no grant covers list on bucket "demo"Edit the scope and the key's grants change in place, under the same key id. After adding nova:list:demo:*, the same key lists the bucket:
ADDRESS CLASS PRODUCER
nova://demo/events standard anyRotate and revoke
| You do | The operator does |
|---|---|
| Delete the Credential | Revokes the key and deletes its Secret |
| Delete only the Secret | Mints a new key into a new Secret and revokes the old key |
Edit scope | Changes the grants of the standing key |
A revoked key fails at once:
novactl: http dataplane: credential: client: api-key exchange: rpc error: code = PermissionDenied desc = exchange: the credential is revokedTo rotate a key, delete the Secret. The workload must restart to read the new one.
When a Credential is refused
A Credential that can never be served shows Refused, and one that waits shows Pending. status.message says why:
kubectl get credentials -ANAMESPACE NAME KEY STATE
apps orders 900e1f14e3cbee6f Active
apps peer Refused
other stray Refused| Message | Cause | What to do |
|---|---|---|
constellation nova/nova does not list namespace other in auth.credentialNamespaces | The Credential's namespace is not trusted | Add the namespace to auth.credentialNamespaces, or move the Credential |
scope: nova:node is peer identity, never a workload's | The scope asks for a node's identity | Grant the actions the workload needs instead |
scope: malformed tokens [nova:list:demo] | A grant does not follow nova:<action>:<bucket>:<key> | Fix the grant; here nova:list:demo:* |
constellation nova/nova does not authenticate (auth mode is not jwt): a credential would mean nothing | The cluster runs with auth off | Turn on auth.mode: jwt |
the Secret predates the single api key; delete the Credential to re-mint | The Secret holds the old NOVA_KEY_ID and NOVA_SECRET pair | Delete the Credential and apply it again |
Fixing the spec retries at once.