Keystone Operator
The Keystone operator deploys and manages the OpenStack Identity Service as a Kubernetes-native workload. It is the reference implementation for all CobaltCore service operators — the patterns established here (CRD layout, sub-reconciler chain, webhooks, finalizers, instrumentation) are replicated by the Horizon, Glance, Placement, Barbican, Neutron, Cinder and Nova operators and by the OVN layer underneath Neutron.
This page is a feature catalogue and entry point. Each item links to the in-depth reference doc for that area.
Lifecycle and Reconciliation
The figure shows the pipeline one pass runs. Reconciliation Flow lists every entry with its condition and its requeue interval.
- Sub-reconciler chain. A pipeline of sub-reconcilers: Secrets → DatabaseTLS → DBConnectionSecret → IdentityBackends → Config → FernetKeys / CredentialKeys / NetworkPolicy → Database → PolicyValidation → Deployment → HTTPRoute / HealthCheck / HPA / VPA / Bootstrap / TrustFlush → PasswordRotation. Each reports through a typed sub-condition that aggregates into
Ready. See Reconciler Architecture. - Two parallel groups. FernetKeys, CredentialKeys and NetworkPolicy run concurrently via
errgroup, and so do HTTPRoute, HealthCheck, HPA, VPA, Bootstrap and TrustFlush, to cut tail latency on cold reconciles. - Two finalizers, three on a target cluster.
keystone.openstack.c5c3.io/finalizerdeletes the MariaDBDatabase,UserandGrant; the OpenBao finalizer gates deletion on ESOPushSecretcleanup so Fernet/credential key backups in OpenBao stay consistent. A Keystone withspec.targetClusterRefalso carriesopenstack.c5c3.io/remote-children, which sweeps the children that carry ownership labels in place of an owner reference. - Watch-driven reactivity. Field-indexed
Secretwatches and aPushSecretname-match mapper with predicate filter wake the workqueue only on transitions the state machine branches on, not on every ESO sync tick.
CRD Surface
- Comprehensive spec. Image, database, cache, fernet, credentialKeys, passwordRotation, trustFlush, bootstrap, federation, middleware, plugins, policy overrides, autoscaling, networkPolicy, gateway, uwsgi, logging, free-form
extraConfig, adeploymentblock grouping the pod-level knobs (replicas, resources, rolloutstrategy, graceful-termination timings, topologySpreadConstraints, priorityClassName, nodeSelector, tolerations, affinity), and ajobsblock that sizes, prioritizes and places every Job and CronJob. - Status with sub-conditions. Sixteen typed sub-conditions plus
installedRelease,targetRelease,upgradePhase, andendpoint— surfaced viakubectl get keystonesprinter columns. - Validating + Defaulting webhooks. CEL validation rules enforced by the API server (database/cache exclusivity, autoscaling targets, replica/key minimums, graceful-termination invariants) plus defaults injected by the webhook for replicas. Container resources and the graceful-termination fallbacks resolve when the reconciler renders the pod (see Resource defaults).
- Stable sub-resource naming. All emitted resources are named after the CR with no
-apisuffix; cluster-internal DNS aligns with the public Gateway hostname.
See CRD API Reference and Controller Events.
Identity Backends (LDAP/AD Domains)
- Attachable domain CRD. One
KeystoneIdentityBackendCR per LDAP/AD domain — connection, bind credentials, tree/attribute mapping, read-only mode, TLS,extraOptions— attached viaspec.keystoneRef. - Dedicated controller + keystone-side projection. The backend controller owns finalizer, domain provisioning (Manage/Adopt), and the per-backend
DomainReady/ConfigProjected/Readyconditions; the keystone-side sub-reconciler aggregates allDomainReadybackends into a content-hashed domains Secret mounted at/etc/keystone/domains/in the Deployment and every keystone-manage Job/CronJob. - Safety rails. The
Defaultdomain is never external, domain names are unique per Keystone, read-only mode forces the write options off, anddeletionPolicy: Retain|Delete(Retain default; adopted domains always retained) governs teardown.
See KeystoneIdentityBackend CRD and the LDAP Domain Backend guide.
Encryption Key Management
- Fernet token keys. Per-CR CronJob with configurable schedule and
maxActiveKeys; rotation script delivered via ConfigMap. - Credential keys. Same rotation model, but each rotation is automatically followed by a
credential_migratestep. - In-place key rotation, no rollout. The operator replaces the data of the key Secret and the kubelet projects it into the running pods. The pod template carries no hash of the key Secrets. Its one hash annotation,
keystone.c5c3.io/db-connection-hash, rolls the Deployment when a Dynamic database credential changes. - OpenBao backup via ESO PushSecret. Keys are mirrored to OpenBao for disaster recovery; staging Secrets are owner-referenced for cache eviction on rotation.
- Watch-driven backup finalizer. PushSecret watch with predicate filter eliminates per-sync workqueue churn and trims delete latency to sub-15s.
See the Key Rotation Guide.
Database Lifecycle
- Managed mode via mariadb-operator. Operator emits
Database/User/GrantCRs and waits for the upstream MariaDB cluster to report health before runningdb_sync. - Schema drift detection. A read-only schema-check Job runs after
db_syncand fails the reconcile if the database schema deviates from the expected Alembic head. See Schema Drift Detection. - Expand-migrate-contract upgrades. When
spec.image.tagadvances to a new OpenStack release, the operator drives phased database migrations while keeping the API available. Sequential-only upgrade paths; patch revisions skip migration entirely. See Upgrade Flow. - oslo.config env-var overrides. Database credentials and other runtime knobs are injected via
OS_<GROUP>__<OPTION>env vars rather than baked into the rendered config, so credential rotation does not require a ConfigMap re-render. - Optional database TLS.
spec.database.tlsenables encrypted MariaDB connections up toverify-full, with a cert-manager-issued client certificate in managed mode and a dedicatedDatabaseTLSReadysub-condition. See the Database TLS guide.
Networking and Exposure
- Cluster-internal Service. ClusterIP, named port, stable DNS at
<name>.<namespace>.svc.cluster.local:5000. - Gateway API integration. Optional
HTTPRouterendered fromspec.gateway; presence ofgateway.networking.k8s.io/v1is detected at startup via the manager'sRESTMapperand the watch is registered only when the CRD is installed.status.endpointreflects the Gateway hostname. - Per-CR NetworkPolicy. Auto-derived egress to database, cache, ESO and OpenBao; configurable ingress.
- Operator NetworkPolicy. Chart-level, default-off, opt-in hardening of the operator pod itself with fail-closed render guards. See Operator NetworkPolicy and the enablement guide.
Observability
- Active HTTP health check against the Keystone API endpoint drives the
KeystoneAPIReadycondition. Injectable HTTP client for tests. - Kubernetes Events for every state transition — bootstrap, db_sync, upgrade phases, key generation, deployment rollout. Catalogued in Controller Events.
- Prometheus metrics + ServiceMonitor. Reconcile duration, per-condition error counts, key rotation age, db_sync outcomes and duration. Contract-tested against this catalogue. See Operator Metrics and the enablement guide.
Day-2 Operations
- Bootstrap Job. Idempotent
keystone-manage bootstrapestablishing the admin project/user/role, region and public endpoint. - Trust flush CronJob. Optional periodic cleanup of expired trust delegations.
- Admin password rotation. Manual rotation at the OpenBao source with a digest-gated bootstrap re-run, plus an optional in-cluster scheduled rotation CronJob via
spec.passwordRotation. See the rotation and scheduled rotation guides. - Policy validation.
oslopolicy-validatorJob blocks rollouts on invalid policy overrides. - Graceful-termination knobs.
terminationGracePeriodSeconds,preStopSleepSeconds, and rolloutstrategyexposed on the CR with webhook-enforced invariants. - HPA lifecycle. HPA is created when
spec.autoscalingis set, removed when cleared, with CPU and/or memory targets. - Topology spread + PriorityClass. Sensible defaults across zone and hostname; webhook validates that referenced PriorityClasses exist.
- ConfigMap rotation pruning. Stale
<name>-config-<hash>ConfigMaps are pruned after rollout, keeping the current revision and the three newest before it for fast rollback.
Owned resources
The figure groups what the operator creates for one Keystone CR and what it only reads. Owned Resources lists every object with the condition it exists under and names what each workload mounts.
Where to go next
- New to the operator? Start with the Quick Start.
- Running it in production? Read Day 2 Operations, Observability & Diagnostics, and Multi-Tenant Deployment.
- Diving into the code? Begin with Reconciler Architecture and follow the links into the individual sub-reconcilers.