Skip to main content

Configuration

The API Server is configured via a YAML file. The path to the file is passed as a command-line argument at startup. String values support ${ENV_VAR} substitution and !file <path> directives that load the value from a file on disk — useful for secrets mounted into the container.

info

In a standard k8shell deployment, configuration is managed alongside other k8shell services. This section provides a full reference of all configuration values.

Top-level fields

FieldDescription
httpHTTP server configuration. See HTTP.
jwtVerifierJWT verification settings for validating user identity tokens issued by the Identity service. See JWT verifier.
natsNATS connection for reading provisioning job status. See NATS.
sessiongRPC client configuration for the Session service. See Session.
identitygRPC client configuration for the Identity service. See Identity.
provisionergRPC client configuration for the Provisioner service. See Provisioner.
k8shelldCredentials used when connecting to k8shelld inside each workspace. See k8shelld.
internalServer-side security settings for the internal API. See Internal.

HTTP

The http block configures the HTTP server, session cookie behaviour, and access logging.

FieldDefaultDescription
portrequiredTCP port the HTTP server listens on.

The http.cookie block controls the session cookie issued to browser clients after a successful OAuth login.

FieldDefaultDescription
namek8shell-sessionName of the session cookie.
securefalseSet the Secure attribute on the cookie. Should be true in production deployments served over HTTPS.
httpOnlytrueSet the HttpOnly attribute on the cookie, preventing JavaScript access.
sameSiteLaxSameSite policy for the cookie: Strict, Lax, or None.
maxAgeSeconds86400Cookie lifetime in seconds. Defaults to one day.
path/URL path scope of the cookie.
domainCookie domain. Set to a leading-dot value (e.g. .example.com) to allow the cookie to be sent to subdomains, which is required for workspace app reverse proxying.

Logging

The http.logging block controls structured access logging for inbound HTTP requests.

FieldDefaultDescription
enabledfalseEnable HTTP access logging.
requestHeadersfalseInclude request headers in log output.
responseHeadersfalseInclude response headers in log output.

JWT verifier

The API Server validates every inbound bearer token and session-cookie-derived token against the Identity service's signing key. The same key pair is used across all k8shell services.

FieldDefaultDescription
signingMethodrequiredJWT signing algorithm. Must be es256 or rs256.
privateKeyFilePath to the ES256 private key file. Required when signingMethod is es256.
publicKeyFilePath to the RS256 public key file. Required when signingMethod is rs256.

Either privateKeyFile or publicKeyFile must be provided, matching the chosen signingMethod.

NATS

The API Server connects to NATS to read provisioning job status written by the Provisioner. It does not publish to NATS itself.

FieldDefaultDescription
enabledfalseEnable NATS integration. When disabled, provisioning job status endpoints return an error.
urlNATS server URL, e.g. nats://nats.k8shell:4222.
usernameNATS username.
passwordNATS password. Supports !file <path> to load from a mounted secret file.

Session

The Session service manages workspace session state. The API Server calls it to create, retrieve, and invalidate sessions on behalf of clients.

FieldDefaultDescription
addressrequiredgRPC address of the Session service, e.g. session.k8shell:9010.
tokenFilePathPath to the service token used to authenticate calls to the Session service.
caCertPathPath to a custom CA certificate for the Session service TLS connection.
serverNameOverride the TLS server name used when connecting to the Session service.

Identity

The Identity service is the source of truth for user profiles, credentials, and blueprint retrieval. The API Server calls it to resolve user context on authenticated requests.

FieldDefaultDescription
addressrequiredgRPC address of the Identity service, e.g. identity.k8shell:9020.
tokenFilePathPath to the service token used to authenticate calls to the Identity service.
caCertPathPath to a custom CA certificate for the Identity service TLS connection.
serverNameOverride the TLS server name used when connecting to the Identity service.

Provisioner

The API Server forwards workspace provisioning and deletion requests to the Provisioner, and queries it for workspace details and system information.

FieldDefaultDescription
addressrequiredgRPC address of the Provisioner service, e.g. provisioner.k8shell:9030.
tokenFilePathPath to the service token used to authenticate calls to the Provisioner.
caCertPathPath to a custom CA certificate for the Provisioner TLS connection.
serverNameOverride the TLS server name used when connecting to the Provisioner.

k8shelld

The API Server connects directly to the k8shelld daemon running inside each workspace to proxy interactive sessions, file transfers, and workspace app traffic. Unlike the other downstream services, the address is resolved per-workspace at request time from workspace metadata. Only the credential material is configured here.

FieldDefaultDescription
tokenFilePathPath to the service token presented to k8shelld on each connection.
caCertPathPath to a custom CA certificate used to verify the k8shelld TLS certificate.

Internal

The internal block controls security restrictions on the internal API endpoints (under /api/v1/internal), which are called by workspace processes rather than end users.

FieldDefaultDescription
allowedPodCIDRsList of CIDR ranges from which internal endpoint calls are accepted, e.g. 10.42.0.0/16. When omitted, the CIDR check is skipped and any source IP is permitted. Set this to your cluster pod network CIDR to restrict access to workspace pods only.