Secret manifest¶
apiVersion: v1beta1
kind: Secret
metadata:
name: anthropic-token
realm: kuke-system # scope coordinates; deepest non-empty wins
# space: team-a # optional — space-scoped
# stack: web # optional — stack-scoped (requires space)
# cell: api # optional — cell-scoped (requires stack)
spec:
data: <bytes> # printed only by a named `kuke get secret <name> -o yaml|json`
A Secret is a named, scoped, daemon-managed credential — an opaque value, or a typed git credential (spec.type). Unlike the realm / space / stack / cell hierarchy resources it has no runtime and carries no status — its only state is the bytes on disk. kuke apply writes the bytes to a root-owned file under the scope's metadata tree; kuke get secret reads it back and kuke delete secret removes it.
See docs/cli-use-cases.md → Secrets for the full apply workflow and invariants.
metadata¶
Scope coordinates live on metadata (not spec), so a Secret's full identity is its scope plus its name.
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | The secret's name, unique within its scope. |
realm |
string | yes | The always-required top-level scope coordinate. |
space |
string | no | When set, scopes the secret to a space within realm. |
stack |
string | no | When set, scopes the secret to a stack within space (requires space). |
cell |
string | no | When set, scopes the secret to a cell within stack (requires stack). |
The scope is the deepest non-empty coordinate: a Secret with only realm set is realm-scoped; one with realm + space + stack set is stack-scoped. A deeper coordinate may only be set when every shallower one is — a cell-scoped secret must also name its stack, space, and realm; a gap exits non-zero.
spec¶
spec.type (string, optional)¶
What the secret holds. Defaults to opaque.
| Type | Holds | Used by |
|---|---|---|
opaque |
Arbitrary bytes in spec.data. |
Container secrets[] (env var or file) |
basic-auth |
spec.basicAuth: a username plus a password or a token. |
Git over HTTPS — git.credentials[] |
ssh-key |
spec.sshKey: an OpenSSH private key and its optional companions. |
Git over SSH and SSH signing — git.credentials[], git.signing |
basic-auth and ssh-key are git credentials. They are consumed only through a git block and cannot be referenced from a container's secrets[]; an opaque secret cannot be used as a git credential. An opaque Secret tagged git is an author-only git identity: it sets an author and committer and authenticates nothing. See the git credentials guide. A basic-auth secret is also what a Realm's registryCredentials[].secretRef names.
spec.connector (string, optional)¶
Tags the secret as an identity of a connector — claude, github, git, registry, … — so it can be picked by name for a team, a Config or a single cell. The tag is a lowercase identifier. A tagged secret is accepted only where that connector is asked for; an untagged one is accepted anywhere its type fits.
spec.identity (map of string, optional)¶
The connector's readable identity fields — for a git identity, author, committer, hosts, sign and allowedSignersRef. Requires spec.connector. Each value is one line of at most 1024 bytes, and is checked against the connector's field schema where one is at hand (kuke create secret --connector, the web UI, and the daemon when it resolves the identity for a cell). These are facts about the secret, not material: never put a key or a token here.
apiVersion: v1beta1
kind: Secret
metadata: { name: bot-key, realm: default }
spec:
type: ssh-key
connector: git
identity:
author: Dev Bot <bot@example.com>
hosts: github.com
sign: commits,tags
sshKey:
privateKey: |
<contents of ~/.ssh/id_ed25519>
spec.data (string, required for opaque)¶
The raw secret material supplied at apply time. Must be non-empty; an empty data exits non-zero. Not allowed on the typed secrets.
spec.basicAuth (object, required for basic-auth)¶
| Field | Type | Required | Description |
|---|---|---|---|
username |
string | yes | The HTTP user (for a token, the forge's token user — e.g. your username). |
password |
string | one of | The password. Exactly one of password or token is set. |
token |
string | one of | A personal access token, sent as the HTTP password. |
spec.sshKey (object, required for ssh-key)¶
| Field | Type | Required | Description |
|---|---|---|---|
privateKey |
string | yes | An OpenSSH private key — any key type (ed25519, rsa, ecdsa). |
passphrase |
string | no | The key's passphrase. Required when the key is encrypted; the key is then loaded into a per-container ssh-agent. |
publicKey |
string | no | The matching public key. Derived from an unencrypted private key when omitted; required to sign with an encrypted key. |
certificate |
string | no | An OpenSSH user certificate presented together with the key. |
knownHosts |
string | no | Pinned host keys in known_hosts format. Omitted, the built-in keys of github.com, gitlab.com and bitbucket.org are used. |
The material of every type is persisted to the daemon-managed file and is printed by exactly one command: a named kuke get secret <name> -o yaml or -o json, which prints the whole document, material included, so the output re-applies unchanged with kuke apply -f -. It never appears in apply output, a kuke get secret table or wide row, any kuke get secrets list (in any format), the web UI or its API, a daemon log or an audit trail; those show only the secret's name, scope, type, connector and identity.
kuke get secret forge-https --realm default -o yaml # material included
kuke get secret forge-https --realm default # metadata row only
Anyone who can reach kukeond can read every secret. The files on disk stay root-only (below), but the daemon hands the material to any client that can dial its socket: root and every member of the kukeon group, through the daemon or with --no-daemon as root. A kukeond older than the kuke client answers the named -o yaml|json read with an error saying kukeond must be upgraded.
Storage layout¶
The daemon writes the bytes to a root-owned file under the scope's metadata tree:
<runPath>/data/<realm>/secrets/<name> # realm-scoped
<runPath>/data/<realm>/<space>/secrets/<name> # space-scoped
<runPath>/data/<realm>/<space>/<stack>/secrets/<name> # stack-scoped
<runPath>/data/<realm>/<space>/<stack>/<cell>/secrets/<name> # cell-scoped
A secret's type and its readable identity are kept in root-only sidecar files next to it (secrets/.types/<name>, secrets/.meta/<name>), so a get or list never opens the material.
The secrets/ directory is 0700 and each secret file is 0600, both owned by root — stricter than the 0o2750 setgid metadata directories, so the kuke group cannot read secret material. Because secrets/ nests inside the scope's metadata directory, the same teardown that reclaims a scope (kuke purge / kuke delete) reclaims its secrets too. There is no crypto-at-rest in v1.
Invariants¶
- Exit code 0 on success; the result reports
createdon the first apply of a name andupdatedon re-apply (write-through — the daemon overwrites without reading the prior bytes back to diff them). - The scope must already exist — apply does not auto-create a missing realm / space / stack / cell for a secret (unlike the hierarchy reconcilers). An unreachable scope exits non-zero with a
scope does not existmessage.
Minimal¶
apiVersion: v1beta1
kind: Secret
metadata:
name: anthropic-token
realm: kuke-system
spec:
data: sk-ant-...
A realm-scoped secret named anthropic-token in the kuke-system realm.
Git credentials¶
apiVersion: v1beta1
kind: Secret
metadata: { name: git-ssh, realm: default }
spec:
type: ssh-key
sshKey:
privateKey: | # the private key file, verbatim
<contents of ~/.ssh/id_ed25519>
---
apiVersion: v1beta1
kind: Secret
metadata: { name: forge-https, realm: default }
spec:
type: basic-auth
basicAuth: { username: dev-bot, token: <personal access token> }
kuke create secret --type builds the same documents from files and stdin, so key material never has to be pasted into YAML.