Kayra

Kayra is the authentication, namespace creation and IAM policy service, built on infrapi/lib. Cluster-wide API registrations, per-tenant namespaces and the subscriptions linking them sit behind one bearer-auth and cluster-RBAC model, with a separate kayra reconciler process turning disabled records active.

Where to start#

I want to…Go to
Run Kayra for the first timeGetting started
Understand how the pieces fit togetherArchitecture overview
See who can authenticate and who can manage whatRBAC & auth
Create or update an API registrationAPI registrations
Create or update a tenantNamespaces
Subscribe a tenant to an API registration, or trigger reconcileSubscriptions & reconciliation
Run a command (serve, reconciler, cache clean, token mint) or use kayra-cliCLI
Look up one internal/* package’s APIPackages
Build, test, or work on the docs themselvesDevelopment

Packages#

Package-by-domain, not package-by-layer: each package below owns its own types, storage and HTTP handlers together.

PackageOwns
internal/configLoading and validating kayra.yaml
internal/storeetcd / local storage backend
internal/cryptoPAT encryption, self-signed JWT signing
internal/oidcDiscovery/JWKS fetch, caching, own endpoints
internal/authnVerifying a bearer token, resolving its user id
internal/authzResolving a user id to groups/attributes (LDAP or fixture)
internal/middlewareThe two gin auth middlewares (general + sysadmin)
internal/rbacGroup/Role/RoleBinding, cluster + namespace scoped
internal/catalogApiRegistration/Namespace/Subscription + the reconciler (see API registrations, Namespaces, Subscriptions & reconciliation)
internal/tokenapiPersonal access token issuance
internal/oauth2brokerServer-side relay for kayra-cli login’s browser-based OAuth2 flow
internal/httpapiRFC 9457 error response helper
internal/apiserverWires every package above onto one gin engine

cmd/kayra wires all of it together; cmd/cli depends on none of it. The client side has its own two packages, used only by cmd/cli:

PackageOwns
internal/oauth2loginThe CLI-side half of the browser-based OAuth2 login flow
internal/clicontextcmd/cli’s own ~/.config/kayra/config (kubeconfig-style contexts)