Skip to main content

Configuration

The Session Service is configured via a YAML file. The path 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.

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
grpcgRPC server configuration. See gRPC.
dbPostgreSQL connection configuration. See Database.
janitorStale-session reaper settings. See Janitor.
recordingSession recording configuration. See Recording.

gRPC

The Session Service exposes a gRPC server consumed by the SSH Proxy and the API Server.

FieldDefaultDescription
portrequiredPort the gRPC server listens on.
authEnabledfalseRequire JWT authentication on inbound gRPC calls.
audienceExpected JWT audience claim. Required when authEnabled is true.
allowedList of allowed callers identified by Kubernetes service account and optional namespace. Each entry may specify serviceAccount and/or namespace.

Database

The Session Service persists session records in PostgreSQL. See Session Store for details on the schema and operations.

FieldDefaultDescription
enabledtrueEnable the database connection. When disabled, all session storage operations are no-ops.
hostnamerequiredPostgreSQL server hostname. Supports ${ENV_VAR} substitution.
portrequiredPostgreSQL server port.
databaserequiredDatabase name.
usernamerequiredDatabase username. Use !file <path> to load from a mounted secret.
passwordrequiredDatabase password. Use !file <path> to load from a mounted secret.

Janitor

The janitor ends sessions that stop sending upserts — for example when the SSH Proxy process is killed without cleanly closing the session. See Session Store — Janitor for how the sweep works.

FieldDefaultDescription
ttl5mHow long a session may go without an upsert before the janitor ends it.
interval1mHow often the janitor sweep runs.
batchSize100Maximum number of sessions ended per sweep.

Recording

Controls whether session content is recorded to disk and in which format. See Recording for details on stream types, file layout, and the PCAP shared-file model.

FieldDefaultDescription
enabledfalseEnable session recording. When disabled, all recording RPC calls return Unimplemented.
storagePathrequiredDirectory where recording files are written. Created on startup if it does not exist.
gzipfalseCompress recording files with gzip. Adds a .gz suffix to each file.
formatsMap of stream-type name to format name. Overrides the defaults (shellasciinema, execasciinema). Valid format names: asciinema, pcap.