Kubernetes resources used by Ipseity

When running on Kubernetes, Ipseity uses the cluster API to persist state and keys. This page lists exactly what it reads, writes and creates so operators can scope RBAC, back up correctly, and reason about storage.

Everything lives in the realm's namespace except the cluster-scoped roles and realm namespaces themselves.

RBAC (cluster-scoped)

The ClusterRole/ClusterRoleBinding grants get/list/watch/create/update/patch/delete on:

  • namespaces — realm discovery (labelled realms) and realm create/delete.
  • configmaps — persistent entity + state storage.
  • secrets — signing keys and the encryption key.

Namespaces

  • The ipseity realm namespace (IPSEITY_NAMESPACE, default ipseity) — created by the deployment.
  • Additional realm namespaces — every namespace carrying IPSEITY_REALM_LABEL (default ipseity.io/realm) is a realm. Ipseity stores each realm's data there and creates Realm-signing-key Secrets there. Realm namespaces may be shared with the user's applications.

ConfigMaps (persistent state)

Label conventions: app: ipseity, app.kubernetes.io/managed-by: ipseity, plus a per-kind selector label.

Entity records

One ConfigMap per entity per logical name:

  • Name: ipseity-<entity-singular>-<normalized-name> (letters lowercased, _ → -), e.g. ipseity-role-admin, ipseity-principal-alice, ipseity-client-web-console, ipseity-group-platform-admins, ipseity-provider-corp-sso, ipseity-membership-ipseity-adrian.
  • Labels: ipseity.io/entity: <entity>, ipseity.io/name: <name>.
  • Data: data.payload = JSON document.

Each realm also receives one server-managed client ConfigMap for its console. The main record is ipseity-client-ipseity-internal by default. Tenant records use the configured client-ID prefix and a stable realm hash (see console clients). These clients are public, carry no client secret, and need no additional Kubernetes resources or RBAC. Ipseity reconciles them on initialization and managed OAuth lookup; GitOps should leave them server-owned. They are removed with other managed objects when a realm is released.

Memberships (ipseity.io/entity: memberships) live in the target tenant namespace. They reference a principal in the main Ipseity realm and assign tenant-local roles/groups, containing no credentials. See membership schema and controller provisioning and example YAML. Existing ConfigMap RBAC covers them; no CRD or additional Secret is required.

Ephemeral / state records

These are TTL'd utility ConfigMaps, labelled by component (ipseity.io/ephemeral / ipseity.io/component):

Kind Name pattern Purpose
Auth codes ipseity-oauth-codes-<digest> One-time authorization codes.
Refresh tokens ipseity-oauth-refresh-<digest> Sessions (refresh tokens).
KV state ipseity-kv-<digest> Revocation, login-attempt/lockout, email verify, consent, external-login state, login recovery, audit-free counters.

Refresh-token ConfigMaps are deleted immediately on consumption or revocation. Expired, revoked and malformed refresh-token records are swept on startup and every five minutes in every realm, even without new logins. Auth-code and KV cleanup runs opportunistically on issuance/writes; lockout and email/consent state expire via the KV TTL.

Consent and external-provider flows also save recovery-only KV records under login-recovery:consent:<token> and login-recovery:extlogin:<token>. They store only the original authorization parameters, encrypted like other KV payloads, and expire after the larger of 24 hours or the flow TTL plus one hour. They remain until expiry even after a successful flow, so a repeated or expired callback can reconstruct its login form. They grant no authentication or consent and contain no credentials, codes, tokens or PKCE verifiers. See browser login recovery.

Audit events are written to stdout as AUDIT JSON lines; no audit ConfigMaps are created or read. Existing ipseity-audit-* ConfigMaps are legacy history and are not automatically removed on upgrade. See monitoring for cleanup.

Secrets

Secret name Data key Purpose
ipseity-oidc-signing-key (ipseity realm; IPSEITY_OIDC_SIGNING_SECRET_NAME) private.pem (+ retired private.<kid>.pem) Per-realm RS256 signing key.
<signing>-ipseity-<realm> (per realm namespace) private.pem (+ retired) Other realms' signing keys.
ipseity-encryption-key (IPSEITY_ENCRYPTION_KEY_SECRET_NAME) encryption.key Base64 32-byte AES key for encryption at rest.

Created on first start when Kubernetes is available (first writer wins; never overwritten). If you pre-provision via External Secrets Operator, the same names and data keys are expected.

Releasing vs purging a realm namespace

Deleting a realm splits into two operations (see realms.md):

  • Release (default) — delete only ipseity-managed ConfigMaps and Secrets in the namespace (objects carrying app: ipseity + app.kubernetes.io/managed-by: ipseity) and strip the realm + managed labels from the namespace. The namespace itself and any non-Ipseity workloads are preserved.
  • Purge (DELETE /api/realms/<realm>?purge=true) — delete the namespace and everything inside it, including anything not related to ipseity.

What the pod itself reads

  • KUBERNETES_SERVICE_HOST / in-cluster service-account token → selects the Kubernetes backend.
  • An optional mounted signing-key file (IPSEITY_OIDC_SIGNING_PRIVATE_KEY_FILE) and/or encryption-key file (IPSEITY_ENCRYPTION_KEY_FILE) take precedence.
  • SMTP credentials are consumed as environment variables only, not read from the API (in the Orbit Deploy baseline they come from an ExternalSecret).

Back up

To preserve identity data and keys, back up in each realm namespace:

  • The entity ConfigMaps (ipseity-principal-*, ipseity-role-*, ipseity-group-*, ipseity-client-*, ipseity-provider-*, ipseity-membership-*) — these are your identity database.
  • The two Secret types above (signing + encryption keys) — mandatory for DR.

See backup-and-recovery.md for commands.