mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-20 06:00:06 +08:00
* test(server): add a local PostgreSQL test runner
The openshell-server tests that need a real PostgreSQL server are
ignored by default and had no shared way to run. The mutation-replay
test reads its own OPENSHELL_REPLAY_TEST_DATABASE_URL, so every
contributor had to provision a database by hand, and the advisory-lock
tests that follow in this series need the same setup.
Add mise run test:rust:postgres. It runs every ignored postgres_* test
in openshell-server against OPENSHELL_TEST_POSTGRES_URL, or starts a
disposable PostgreSQL container with Docker or Podman (CONTAINER_ENGINE
selects one) on the image pinned by the Kubernetes e2e fixture and
removes it on exit. Tests run one at a time because advisory locks are
database-wide. The runner always points the legacy replay variable at
the selected database, so an inherited URL cannot send that test to a
different server. test:postgres-runner checks that selection with a fake
cargo and needs no database or container engine. CI does not run the
PostgreSQL tests; TESTING.md documents the task.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* fix(server): hold the mutation guard while deleting a provider
DeleteProvider checked that no sandbox referenced the provider and then
deleted the record without holding the sandbox mutation guard. Sandbox
create and provider attach take that guard while they write provider
references, so one of them could add a reference after the attached
sandbox check passed, and the delete then removed a provider that a
sandbox spec still named.
Take the guard before the attached sandbox check, as provider create and
update already do, so the check and the delete run against a stable
set of sandbox references, and reject an empty name after authorization
but before the guard. A new test holds the guard, attaches the provider
while the delete waits, and asserts that the delete fails with
FailedPrecondition and leaves the provider in place.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* fix(server): release staged credentials when a refresh fails early
A provider credential refresh stages the minted values under new
credential handles before it commits the provider update, and deletes
those handles when validation or persistence fails. Two earlier returns
skipped that cleanup. The minted expiry was converted to a protobuf
timestamp only after staging, so an expiry outside the timestamp range
failed the refresh and left the staged values in the credential driver.
A failure to acquire the sandbox mutation guard returned the same way.
Convert the expiry before staging anything, so a bad value fails before
any handle exists, and delete the staged handles when the guard cannot
be acquired. A new test refreshes a stored credential with an expiry of
i64::MAX and asserts that the call fails, the provider keeps its
original handles, and the credential driver holds the same number of
values as before. The guard failure path has no test here, because the
SQLite guard used by unit tests cannot fail.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* feat(server): acquire mutation locks on a dedicated PostgreSQL lock pool
The cross-object mutation guard took its advisory-lock session from the
10-connection data pool and closed it on every release, so each guarded
mutation opened a new database connection, and lock holders competed
with their own critical sections for data connections. A lock wait that
hit the 10 second lock_timeout surfaced as INTERNAL.
Add a lazy, dedicated 4-connection lock pool and a new
persistence::mutation_lock module for the lock key, mode and set types.
Store::acquire_distributed_mutation_guard now takes a lock set and a
deadline, and each lock statement sets lock_timeout to the time left
before that deadline, so a cancelled acquisition never waits past it on
the server. Returned connections are scrubbed with
pg_advisory_unlock_all() and reused, and each return is bounded by 5
seconds so a stalled session cannot keep a pool permit.
A lock statement that PostgreSQL ends with SQLSTATE 55P03 fails with a
new LockTimeout error, and so does a wait for a lock connection during
which every one was checked out at some point, or that started with less
than a second left, too little to open one. The API returns it as
UNAVAILABLE with reason MUTATION_LOCK_TIMEOUT and a 1 second retry
delay, because the mutation lock was not acquired, so the request's
guarded writes did not run. Only the guard acquisition classifies 55P03;
any other 55P03 stays a database error. A lock connection that
PostgreSQL does not open by the deadline despite at least a second to do
so (refused, out of connection slots, starting up, or not answering, all
of which SQLx retries silently) is a database error, not a lock timeout.
Mutations still take the legacy global key exclusively, so old and new
replicas keep excluding each other during a rolling upgrade. Each
PostgreSQL-backed gateway pod can now open up to 14 database
connections (10 data plus 4 lock) instead of 10, and the chart's
autoscaling.maxReplicas comment says what its default of 4 needs. The
SSH host identity lock stays on a data connection, because sandbox
creation takes it while holding its mutation guard and a second
lock-pool connection there could exhaust the pool. The provider
credential refresh lock stays there too, so a refresh still progresses
while every lock connection is in use.
Part of #3528
Co-authored-by: divesh <dgude@nvidia.com>
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* perf(server): partition mutation locks by workspace and sandbox
Every cross-object mutation, and every lifecycle and supervisor update,
took one process-wide mutex and, on PostgreSQL, one fleet-wide advisory
lock. Unrelated sandboxes and providers therefore serialized across all
replicas, and one slow critical section delayed every other mutation in
the fleet.
Replace that lock with hierarchical intention locks on a global key, one
key per workspace and one key per sandbox, each held shared or
exclusive. Global settings and policy writers and platform-scope profile
writers hold the global key exclusively. Provider and workspace-scoped
profile writers, including DeleteProvider and credential refresh, hold
their workspace key exclusively. Sandbox writers and supervisor reports
hold their sandbox key exclusively under shared global and workspace
keys. Lifecycle, driver-watch and reconcile paths take only
process-local keys and keep relying on compare-and-swap across replicas.
Workspace and sandbox keys are domain-separated SHA-256 prefixes. Each
guard takes its local keys and then its advisory locks in ascending
order under one 10 second deadline, and no path nests guards. The
settings mutex is removed, since the global and sandbox keys cover it.
Sandbox settings are keyed by sandbox name, which a sandbox key no
longer covers once another sandbox reuses the name, so a settings
update returns NOT_FOUND unless its sandbox still holds the name after
the read, and ABORTED if the settings row was recreated before the
write.
The global key keeps its legacy value, so older replicas, which hold it
exclusively for every mutation, still exclude new ones during a rolling
upgrade. Guards now also give up after 10 seconds on SQLite, and
provider refresh reports a guard timeout as UNAVAILABLE instead of
INTERNAL. A supervisor report for a missing sandbox returns NOT_FOUND.
Startup endpoint-status reconciliation still holds the global key for
its whole scan.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* fix(server): reconcile endpoint status on startup one sandbox at a time
Startup endpoint-status reconciliation held the global mutation key
exclusively for its whole scan. On PostgreSQL that blocked every guarded
mutation on every replica until the starting gateway had walked all
sandboxes, and the scan first waited behind every in-flight sandbox
mutation. It also paged with an offset, so sandboxes deleted mid-scan
shifted rows between pages, and a write that raced the scan (a Conflict
from a lifecycle update on another replica, or a sandbox deleted after
it was listed) failed gateway startup.
Walk the sandboxes with keyset paging instead, and reset each candidate
under its own sandbox-scoped guard, up to four at a time to match the
lock pool. A candidate with a fresh shared owner is skipped before any
guard is taken. Under the guard the reconciliation re-checks the owner,
re-reads the sandbox, skips it when it is gone or no longer carries
endpoint status, and writes against the version it just read. A Conflict
or a database error at write time, which is how a row deleted after the
re-read surfaces, is retried with a fresh read, at most five attempts
per sandbox. A lock timeout on the guard is retried the same way, so a
holder of the sandbox, its workspace or the global key that releases
within the retry window cannot stop a replica from starting. No
lock-timeout retry starts once the scan has run for three lock timeouts,
so a scan stuck behind a long holder fails within about 40 seconds,
inside the chart's 60-second startup probe, and logs the sandbox it gave
up on. Store::list_all_messages loses its only caller and is removed.
Reconciliation stays fail-closed: a holder that outlasts the retry
window, an owner lookup failure, or a sandbox that keeps changing still
fails startup, so stale endpoint success is never served. User-visible
change: a restarting gateway no longer stalls mutations of unrelated
sandboxes and providers on its peers while it reconciles.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* perf(server): skip the endpoint-status lock when a session was replaced
When a supervisor session ends, the gateway resets that sandbox's tool
server endpoint evidence unless a replacement session already owns
endpoint observation. The replacement check ran only after the reset
had read the sandbox and taken its sandbox mutation guard, so a reset
whose supervisor had already reconnected still queued behind other
mutations of that sandbox, and on PostgreSQL it used a lock-pool
connection, only to find it had nothing to do.
Check for a replacement first: a live local session, or a fresh owner
record on a peer. When one exists, return without reading the sandbox
or taking the guard. Otherwise take the guard and repeat the same check
under it, because a replacement's pre-acknowledgement reset runs under
the same sandbox key and resetting after it would wipe the
replacement's fresh evidence. Both checks share one helper, so they
cannot drift apart. When no replacement exists, the reset costs one
extra owner-row read.
This helps most when a replica notices a dead stream late, after the
supervisor has already reconnected elsewhere (a network partition or a
keepalive expiry).
Deferring to a replacement leaves the old session's evidence to the
replacement's pre-acknowledgement reset, which can time out on its
bounded mutation lock wait. That reset's failure path removed the
replacement and released its owner record but scheduled no
invalidation, so the old session's success evidence could outlive both
sessions. An old session that ended after its replacement registered
already deferred this way, and the unguarded check now makes every
disconnect that finds the replacement defer too. When the reset fails
while the replacement is still current, also schedule the retried
invalidation that follows a session end. That failure path keeps the
lifecycle demotion from abandon_session_setup, but runs it in the
spawned task before the retry and only while this session is still
current, so a timed-out reset returns promptly.
Part of #3528
Co-authored-by: divesh <dgude@nvidia.com>
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* test(server): cover staged credential cleanup on a lock timeout
A provider credential refresh deletes its staged handles when it cannot
acquire the provider mutation guard, but that path had no test: the
SQLite guard used by unit tests could not fail. Mutation locks now
acquire under a deadline that tests can shorten, so the timeout path
can be exercised directly.
The new test shortens the lock deadline to 50 ms, holds the workspace
mutation guard, and refreshes a provider that already stores an AWS
access key. The refresh returns UNAVAILABLE with the
MUTATION_LOCK_TIMEOUT reason, the provider keeps its original handle,
which still resolves to the old key, and the credential driver holds
the same number of values as before the refresh.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* feat(server): export mutation lock wait and timeout metrics
A handler mutation guard can now wait up to 10 seconds for its keys and
then fail with UNAVAILABLE, but nothing showed operators how long guards
waited or how often they gave up, short of reading warning logs on each
replica.
Export openshell_server_mutation_lock_wait_seconds, a histogram of the
time one guard took to acquire all of its keys (local registry plus
PostgreSQL advisory locks), recorded on success, and
openshell_server_mutation_lock_timeouts_total, a counter of guard
acquisitions that timed out. Both carry a bounded scope label: global,
workspace or sandbox. The platform scope, whose workspace is empty,
counts as global. The histogram uses the same 1 ms to 15 s buckets as
the relay and peer histograms, and the timeout counter starts at 0 for
every scope, so rate() works on an idle replica. The timeout warning
now also logs the scope. A guard that fails for another reason, such as
a lock connection PostgreSQL did not open, is not counted as a timeout
and logs a "mutation lock acquisition failed" warning instead.
Lifecycle, driver-watch and reconcile paths take only process-local
locks and never time out, so they are not recorded.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* test(server): add PostgreSQL mutation lock integration tests
The scoped mutation locks were only unit-tested on SQLite, where the
database layer is a no-op. Add ignored postgres_* tests that run the
advisory-lock layer against a real PostgreSQL through mise run
test:rust:postgres, each in its own disposable schema (TestSchema).
persistence/mutation_lock_pg_tests.rs uses two stores on one database
as two replicas. It covers disjoint sandbox scopes holding at once, a
workspace key blocking only sandboxes in that workspace, the global key
blocking every scope, and exclusion in both directions against a raw
holder of the legacy global key, whose 55P03 stays a database error
outside a guard acquisition. It checks that timed-out and cancelled
acquisitions release the keys they already took, that a released lock
connection returns to the pool without residual locks, that a release
stalled on the network closes its session and the pool recovers, and
that the lock pool never grows past its size. It also checks that a
full lock pool times out as lock contention, while a lock connection
that PostgreSQL never answers fails as a database error.
compute/mutation_guard.rs runs the random scope mix across two
PostgreSQL runtimes and checks that a by-id guard waits for a workspace
writer on the other replica. The provider refresh lock test moves onto
the runner too, and checks that a refresh proceeds while every lock
connection is held.
A bench_postgres_* capacity check measures a paced burst of 500
reconnects 12 ms apart into one replica and fails when the p99 lock
wait reaches a fifth of the lock timeout. Machine load moves those
waits, so mise run test:rust:postgres skips it and mise run
test:rust:postgres:bench runs it alone, through a new
OPENSHELL_TEST_POSTGRES_PREFIX setting in the runner.
The tests add test-only helpers: the lock pool's size and idle count
and the backend pid of a held lock session. Nothing changes outside
tests and the test runner.
Part of #3528
Co-authored-by: divesh <dgude@nvidia.com>
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* ci: run the PostgreSQL-backed server tests
Branch Checks now runs the postgres_* tests through the same runner
developers use, on an x86_64 Linux runner with Docker. They cover lock
scope exclusion, interop with replicas still on the old global key,
cancellation, lock-pool bounds and connection failures, which no other
CI lane checks directly. The load-sensitive bench_postgres_* capacity
checks stay local.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* docs: document scoped mutation locks and lock-pool sizing
In the High Availability guide, size PostgreSQL for 14 connections per
gateway pod, 10 for data and 4 for the new lock pool, so three or more
replicas now exceed what the PostgreSQL default leaves, and keep
headroom for lock sessions that cancelled requests leave behind.
Explain which changes lock a sandbox, a workspace, or the whole fleet,
and that a lock wait over 10 seconds returns a retryable UNAVAILABLE
with reason MUTATION_LOCK_TIMEOUT. A new upgrade subsection says to
raise max_connections to the 14-per-pod size before upgrading, because
the rollout already runs new pods at that count, and warns that older
replicas keep serializing every mutation until the rollout finishes.
Monitor Capacity gains the lock metrics and their queries, and names
slow driver, credential, middleware, or profile source calls as another
cause of lock waits.
List the lock wait histogram and timeout counter, with their scope
label, on the Gateway Metrics page. The counter also counts background
work and leaves out lock connections that PostgreSQL does not open
although at least a second of the wait remained.
In the cluster debugging skill, replace the single advisory-lock
paragraph with the lock levels and pool, what each timeout detail
means, how a lock connection that PostgreSQL does not open shows up,
when terminating a lock backend is safe, a pg_locks query that shows
holders and waiters, and how to spot the global key. The per-pod greps
also read the timeout counter, and new rows cover lock timeouts and
lock connections that PostgreSQL does not open.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* feat(server): check mutation lock ordering in debug builds
The mutation lock ordering rules were prose only, so a nested guard on
a different key passed every test and could only deadlock under
contention. Debug builds now register each held guard with the Tokio
task (or the thread, outside a task) that acquired it, and panic before
waiting when a local key, a blocking lifecycle gate or the SSH identity
lock would break rules 1, 4 or 5. Startup endpoint-status
reconciliation and the tests that hold a guard while driving guarded
code run under lock_order::branch(), which marks deliberate concurrency
within one task. Release builds compile the check out.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* fix(server): do not hold gateway shutdown for the endpoint-status retry
When a replacement supervisor session failed its endpoint-status reset,
the spawned cleanup task kept the session lifetime guard through
retry_endpoint_status_after_supervisor_disconnect. That retry only ends
once the reset is durable, so a gateway shutdown during a database or
lock outage waited the full 10 s and reported ownership cleanup as
incomplete. The guard now covers only the lifecycle demotion, as in
finish_supervisor_session, and a SQLite test checks that shutdown
completes while the retry is still blocked.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* refactor(server): make the platform profile lock scope explicit
Platform-scope provider profile writers (import, update, delete) pass an
empty workspace on purpose and need X(global), because they validate
sandboxes in every workspace. MutationScope::profiles() now names that
escalation and picks Global for the platform scope, instead of relying
on MutationScope::Workspace("") to mean it. An empty workspace name now
trips a debug assertion, and release builds keep X(global) as a
fail-safe that over-locks rather than under-locks.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* perf(server): amortize local mutation lock table sweeps
LocalMutationLocks swept its whole table on every key lookup, so a
burst of N concurrent acquisitions on one replica cost O(N^2) under a
blocking mutex. The table is now swept only when a new key grows it
past the larger of 64 and twice the live entries left by the last
sweep, which makes acquisition amortized O(1). Released entries,
including those of cancelled waiters, stay bounded at about twice the
peak live set. The lifecycle gate registry keeps its per-call sweep.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* feat(server): make the database pool ceiling configurable
Both stores hardcoded their pool ceiling: 10 connections for Postgres, 5
for on-disk SQLite. One pool is shared by every database-backed RPC, so
that number is also the gateway's ceiling on concurrent database work.
Once every connection is checked out, callers queue on acquire and sqlx
logs "time to acquire exceeded slow threshold"; sandbox creates then time
out and are retried, which adds load rather than shedding it.
The right ceiling is deployment-specific — it depends on how many gateway
replicas share the database and what max_connections the server itself
allows — so it cannot be a single number baked into the binary.
Expose it on the same config surface as the rest of the gateway's
settings: --db-max-connections, OPENSHELL_DB_MAX_CONNECTIONS, and the
TOML key database_max_connections, resolved in that precedence order.
Helm deployments set the key through gatewayConfig. Omitting it keeps
each backend's previous value, so existing deployments do not move.
Values below 1 are rejected rather than silently replaced by the default:
a zero pool would block every acquire, and quietly ignoring a typo would
reproduce the ceiling the operator is trying to lift. An in-memory SQLite
database stays pinned to one connection, since the database lives inside
that connection.
Refs: #2561
Signed-off-by: Bryce Wilkinson <22760097+bjw123@users.noreply.github.com>
(cherry picked from commit 33517b32bd)
[emacchi: dropped the server.dbMaxConnections Helm value; operators set
the key through gatewayConfig]
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* feat(server): make the mutation lock pool size configurable
The mutation lock pool was fixed at 4 connections per replica. That
number rests on one reconnect-burst bench rather than scale testing, so
a gateway that serves many more sandboxes needs a way to raise it
without a rebuild. Add --db-lock-max-connections,
OPENSHELL_DB_LOCK_MAX_CONNECTIONS and the database_lock_max_connections
gateway.toml key next to the data pool knob, resolved in the same order;
Helm deployments set it through gatewayConfig. The default stays 4,
zero is rejected, SQLite ignores it with a warning, and the gateway logs
both pool sizes at startup. PostgreSQL now needs at least 2 data
connections, because the SSH identity lock keeps one while it queries
the pool. The connection sizing docs, the HA guide formula and the
debug skill now count data plus lock connections.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* feat(server): export mutation lock errors and lock connections in use
A mutation lock acquisition that failed without timing out, such as a
lock connection PostgreSQL never opened or a failed lock statement,
only logged a warning, and readiness stays healthy because it pings the
data pool. Count those failures in
openshell_server_mutation_lock_errors_total{scope}, kept apart from
timeouts because they point at PostgreSQL capacity or connectivity
rather than contention. Export
openshell_server_mutation_lock_connections_in_use as a gauge slot held
by each checked-out lock connection, next to
openshell_server_mutation_lock_connections_capacity, which reads the
configured lock pool size; both exist only with PostgreSQL. The metrics
catalog, the HA guide's signals and PromQL examples, and the debug
skill cover the new series.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
* feat(server): time mutation lock holds and test a stalled holder
Nothing bounds how long a mutation guard is held, so a holder stuck in
a compute driver, credential backend or middleware call keeps its scope
locked while waiters time out. Each guard now records its hold in
openshell_server_mutation_lock_hold_seconds{scope} when it is released,
and logs a warning when the hold outlasted the lock wait timeout, so
operators can find the replica and scope behind those timeouts. A
PostgreSQL test with a stalled holder pins the current contract:
waiters on its sandbox, workspace and global scopes fail by their
deadline, other scopes proceed, the holder keeps its key, and a full
lock pool on one replica leaves the other working. The metrics catalog,
the HA guide and the debug skill describe the new signals, which
observe holds without bounding them.
Part of #3528
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
---------
Signed-off-by: Emilien Macchi <emacchi@redhat.com>
Co-authored-by: divesh <dgude@nvidia.com>
Co-authored-by: Bryce Wilkinson <22760097+bjw123@users.noreply.github.com>
799 lines
38 KiB
YAML
799 lines
38 KiB
YAML
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Default values for OpenShell
|
|
|
|
# -- Number of OpenShell gateway replicas. Values greater than 1 require
|
|
# server.externalDbSecret because the default SQLite backend is per pod.
|
|
replicaCount: 1
|
|
|
|
global:
|
|
image:
|
|
# -- Shared OpenShell image registry. Individual image registries take precedence.
|
|
registry: ghcr.io/nvidia
|
|
# -- Shared OpenShell image tag. Defaults to the chart appVersion when empty.
|
|
tag: ""
|
|
# -- Shared OpenShell image pull policy. Individual image pull policies take precedence.
|
|
pullPolicy: IfNotPresent
|
|
|
|
workload:
|
|
# -- Gateway workload controller kind. Use `statefulset` for the default
|
|
# SQLite database, or `deployment` when server.externalDbSecret points at an
|
|
# external database.
|
|
kind: statefulset
|
|
# -- Allow replicaCount > 1 while rendering a StatefulSet. Prefer
|
|
# workload.kind=deployment for external database-backed multi-replica
|
|
# gateways; this override exists for operators who explicitly require
|
|
# StatefulSet identity or storage semantics.
|
|
allowMultiReplicaStatefulSet: false
|
|
|
|
gateway:
|
|
image:
|
|
# -- Gateway image registry. Empty uses global.image.registry.
|
|
registry: ""
|
|
# -- Gateway image repository.
|
|
repository: openshell/gateway
|
|
# -- Gateway image pull policy. Empty uses global.image.pullPolicy.
|
|
pullPolicy: null
|
|
# -- Gateway image tag. Defaults to the chart appVersion when empty.
|
|
tag: ""
|
|
# -- Gateway image digest. When set, this takes precedence over tag.
|
|
digest: ""
|
|
|
|
# Trusted workload-side runtime image.
|
|
sandboxRuntime:
|
|
image:
|
|
# -- Sandbox runtime image registry. Empty uses global.image.registry.
|
|
registry: ""
|
|
# -- Sandbox runtime image repository.
|
|
repository: openshell/sandbox
|
|
# -- Sandbox runtime image pull policy. Empty uses global.image.pullPolicy.
|
|
pullPolicy: null
|
|
# -- Sandbox runtime image tag. Defaults to the chart appVersion when empty.
|
|
tag: ""
|
|
# -- Sandbox runtime image digest. When set, this takes precedence over tag.
|
|
digest: ""
|
|
|
|
# Trusted control-side runtime image.
|
|
supervisor:
|
|
image:
|
|
# -- Supervisor image registry. Empty uses global.image.registry.
|
|
registry: ""
|
|
# -- Supervisor image repository.
|
|
repository: openshell/supervisor
|
|
# -- Supervisor image pull policy. Empty uses global.image.pullPolicy.
|
|
# Prefer always, if_not_present, or never; the chart also accepts legacy
|
|
# Kubernetes spellings Always, IfNotPresent, and Never.
|
|
pullPolicy: null
|
|
# -- Supervisor image tag. Defaults to the chart appVersion when empty.
|
|
tag: ""
|
|
# -- Supervisor image digest. When set, this takes precedence over tag.
|
|
digest: ""
|
|
sandboxRuntime:
|
|
# -- Workload boundary TLS listener port.
|
|
boundaryPort: 5500
|
|
|
|
sandbox:
|
|
image:
|
|
# -- Default standalone sandbox image repository.
|
|
repository: nvcr.io/nvidia/base/ubuntu
|
|
# -- Sandbox image tag. Defaults to latest when empty.
|
|
tag: "24.04"
|
|
# -- Sandbox image digest. When set, this takes precedence over tag.
|
|
digest: ""
|
|
# -- Sandbox image pull policy. Leave unset to use the Kubernetes image default.
|
|
pullPolicy: null
|
|
|
|
# -- Operator-owned corporate forward proxy for policy-approved TLS egress
|
|
# from Kubernetes sandboxes. The workload cannot select or override it.
|
|
upstreamProxy:
|
|
# -- Proxy URL in http://host:port or https://host:port form. An https:// proxy
|
|
# whose certificate is not publicly trusted also needs caBundle below.
|
|
url: ""
|
|
# -- Comma-separated destinations that bypass only the corporate proxy.
|
|
noProxy: ""
|
|
authSecret:
|
|
# -- Existing Secret in the sandbox namespace containing a user:pass value.
|
|
name: ""
|
|
# -- Secret key containing the proxy credential.
|
|
key: ""
|
|
# -- Required when authSecret is configured because Basic auth to an HTTP proxy is cleartext.
|
|
authAllowInsecure: false
|
|
# -- Last-resort option for hostname-filtering proxy ACLs. It lets the proxy resolve CONNECT targets.
|
|
connectByHostname: false
|
|
caBundle:
|
|
# -- ConfigMap in the release namespace holding the corporate proxy CA bundle.
|
|
# Required for an https:// proxy with a private CA, and for a TLS-intercepting
|
|
# proxy that re-signs upstream certificates. The gateway reads it and stages it
|
|
# into each sandbox's immutable supervisor bootstrap Secret, so the anchor stays
|
|
# in the gateway's trust domain rather than the workload namespace.
|
|
# Supply only the CA that signs your proxy's certificate, or that the proxy
|
|
# re-signs intercepted upstream certificates with. Public roots already come
|
|
# from the supervisor image and its TLS stack, so a full merged trust bundle
|
|
# (for example an OpenShift config.openshift.io/inject-trusted-cabundle
|
|
# ConfigMap) adds hundreds of kilobytes of duplicated roots and can exceed
|
|
# the sandbox boundary's control-frame budget.
|
|
configMapName: ""
|
|
# -- Key inside that ConfigMap. Change this only to reuse an existing
|
|
# ConfigMap whose key is not ca.crt.
|
|
key: ca.crt
|
|
|
|
# -- Image pull secrets attached to gateway and helper pods.
|
|
imagePullSecrets: []
|
|
# -- Override the chart name used in generated resource names.
|
|
nameOverride: "openshell"
|
|
# -- Override the full generated resource name.
|
|
fullnameOverride: ""
|
|
|
|
serviceAccount:
|
|
# -- Create a service account for the gateway.
|
|
create: true
|
|
# -- Annotations to add to the generated service account.
|
|
annotations: {}
|
|
# -- Existing service account name to use when serviceAccount.create is false.
|
|
name: ""
|
|
|
|
sandboxServiceAccount:
|
|
# -- Create a service account for sandbox pods.
|
|
create: true
|
|
# -- Annotations to add to the generated sandbox service account.
|
|
annotations: {}
|
|
# -- Existing service account name for sandbox pods when sandboxServiceAccount.create is false.
|
|
name: ""
|
|
|
|
# RBAC objects created for the gateway ServiceAccount. Cluster-scoped objects
|
|
# can be omitted so a cluster-admin applies them once and a namespace-admin
|
|
# installs and upgrades the gateway release without cluster-scoped permissions.
|
|
rbac:
|
|
# -- Create the RBAC objects that grant the gateway ServiceAccount access.
|
|
# Disable to supply the namespaced sandbox and peer Role/RoleBinding and the
|
|
# cluster-scoped ClusterRole/ClusterRoleBinding out of band. The certgen hook
|
|
# and credential driver RBAC keep their own flags.
|
|
create: true
|
|
clusterScoped:
|
|
# -- Create the cluster-scoped ClusterRole and ClusterRoleBinding. Disable
|
|
# for a namespace-admin install where a cluster-admin applies them
|
|
# separately; the gateway ServiceAccount name and namespace are unchanged,
|
|
# so a pre-created ClusterRoleBinding still matches.
|
|
create: true
|
|
# -- Name for the ClusterRole. Empty uses the `<fullname>-node-reader-<release namespace>` default.
|
|
clusterRoleName: ""
|
|
# -- Name for the ClusterRoleBinding. Empty uses the `<fullname>-node-reader-<release namespace>` default.
|
|
clusterRoleBindingName: ""
|
|
|
|
# Namespace-scoped resources needed to run sandboxes. Disable this when the
|
|
# gateway and workspace prerequisites are managed as separate Helm releases
|
|
# using the openshell-workspace chart.
|
|
workspaceResources:
|
|
# -- Create the sandbox ServiceAccount, Role, RoleBinding, and NetworkPolicy
|
|
# from this chart. Disable for a gateway-only release.
|
|
enabled: true
|
|
|
|
# -- Extra annotations to add to the gateway pod.
|
|
podAnnotations: {}
|
|
# -- Extra labels to add to the gateway pod.
|
|
podLabels: {}
|
|
|
|
podSecurityContext:
|
|
# -- fsGroup assigned to the gateway pod.
|
|
fsGroup: 1000
|
|
|
|
securityContext:
|
|
# -- Require the gateway container to run as a non-root user.
|
|
runAsNonRoot: true
|
|
# -- UID assigned to the gateway container.
|
|
runAsUser: 1000
|
|
# -- Whether the gateway container can gain additional privileges.
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
# -- Linux capabilities dropped from the gateway container.
|
|
drop:
|
|
- ALL
|
|
|
|
service:
|
|
# -- Kubernetes Service type for the gateway.
|
|
type: ClusterIP
|
|
# -- Gateway gRPC/HTTP service port.
|
|
port: 8080
|
|
# -- Gateway health service port.
|
|
healthPort: 8081
|
|
# -- Gateway metrics service port.
|
|
metricsPort: 9090
|
|
|
|
# Agent Sandbox is a cluster-scoped prerequisite for the Kubernetes compute
|
|
# driver. OpenShell deliberately does not install its CRDs or controller.
|
|
# Enable this check for live Helm installs to fail before creating gateway
|
|
# resources when neither supported Sandbox API is served. Disable it for
|
|
# offline `helm template` and lint workflows, which cannot discover APIs.
|
|
agentSandbox:
|
|
preflight:
|
|
# -- Check the live cluster for a supported Agent Sandbox API before rendering gateway resources. Disable only for offline rendering and linting.
|
|
enabled: true
|
|
|
|
# Pod restart behavior and health probe tuning.
|
|
podLifecycle:
|
|
# -- Maximum time, in seconds, Kubernetes waits for the gateway to exit before
|
|
# killing it. The gateway exits as soon as shutdown completes; the limit
|
|
# covers supervisor session cleanup and draining queued OCSF records.
|
|
terminationGracePeriodSeconds: 30
|
|
|
|
# Optional HorizontalPodAutoscaler (autoscaling/v2) for the gateway workload.
|
|
# When enabled, the Deployment or StatefulSet omits spec.replicas and the HPA
|
|
# owns the replica count; replicaCount is ignored. Multi-replica limits
|
|
# (server.externalDbSecret, and workload.allowMultiReplicaStatefulSet for a
|
|
# StatefulSet) apply to maxReplicas. Scaling out does not move established
|
|
# supervisor sessions; read the High Availability guide before choosing metrics.
|
|
# The workload can drop to one replica when you enable this on an existing
|
|
# release, until the HPA scales it back up; read the chart README before you
|
|
# upgrade.
|
|
autoscaling:
|
|
# -- Render a HorizontalPodAutoscaler and stop rendering spec.replicas.
|
|
enabled: false
|
|
# -- Minimum gateway replicas. Use 2 or more to survive a pod failure.
|
|
minReplicas: 2
|
|
# -- Maximum gateway replicas. Each replica opens up to
|
|
# database_max_connections + database_lock_max_connections PostgreSQL
|
|
# connections (14 with the defaults; set them under
|
|
# gatewayConfig.openshell.gateway); size the database for rollouts at this
|
|
# count, as the High Availability guide describes. With a Deployment and the
|
|
# default pool sizes, the default of 4 needs `max_connections` of at least
|
|
# 126, more than the PostgreSQL default of 100.
|
|
maxReplicas: 4
|
|
# -- Target average CPU utilization, as a percentage of
|
|
# resources.requests.cpu. Set to null to disable. Requires
|
|
# resources.requests.cpu, or resources.limits.cpu, which Kubernetes copies
|
|
# into the request.
|
|
targetCPUUtilizationPercentage: 80
|
|
# -- (int) Target average memory utilization, as a percentage of
|
|
# resources.requests.memory. Null disables it. Requires
|
|
# resources.requests.memory, or resources.limits.memory, which Kubernetes
|
|
# copies into the request.
|
|
targetMemoryUtilizationPercentage: null
|
|
# -- Additional autoscaling/v2 MetricSpec entries appended verbatim, such as
|
|
# Pods metrics served by prometheus-adapter.
|
|
metrics: []
|
|
# -- HPA scaling behavior. Scale-down hands the removed pod's supervisor
|
|
# sessions to the remaining replicas, so the default removes at most one
|
|
# replica every two minutes after a five-minute stabilization window. Helm
|
|
# merges maps: set autoscaling.behavior.scaleDown to null to drop the default.
|
|
behavior:
|
|
scaleDown:
|
|
stabilizationWindowSeconds: 300
|
|
policies:
|
|
- type: Pods
|
|
value: 1
|
|
periodSeconds: 120
|
|
|
|
probes:
|
|
startup:
|
|
# -- Startup probe period, in seconds.
|
|
periodSeconds: 2
|
|
# -- Startup probe timeout, in seconds.
|
|
timeoutSeconds: 1
|
|
# -- Startup probe failure threshold before the container is killed.
|
|
failureThreshold: 30
|
|
liveness:
|
|
# -- Liveness probe initial delay, in seconds.
|
|
initialDelaySeconds: 2
|
|
# -- Liveness probe period, in seconds.
|
|
periodSeconds: 5
|
|
# -- Liveness probe timeout, in seconds.
|
|
timeoutSeconds: 1
|
|
# -- Liveness probe failure threshold before the container is restarted.
|
|
failureThreshold: 3
|
|
readiness:
|
|
# -- Readiness probe initial delay, in seconds.
|
|
initialDelaySeconds: 1
|
|
# -- Readiness probe period, in seconds.
|
|
periodSeconds: 2
|
|
# -- Readiness probe timeout, in seconds.
|
|
timeoutSeconds: 1
|
|
# -- Readiness probe failure threshold before the pod is marked not ready.
|
|
failureThreshold: 3
|
|
|
|
# -- Gateway pod resource requests and limits.
|
|
resources: {}
|
|
|
|
# -- Node selector for the gateway pod.
|
|
nodeSelector: {}
|
|
|
|
# -- Tolerations for the gateway pod.
|
|
tolerations: []
|
|
|
|
# -- Affinity rules for the gateway pod.
|
|
affinity: {}
|
|
|
|
# -- Non-secret gateway application configuration. Top-level keys name TOML
|
|
# tables and are rendered into the mounted gateway.toml file. Kubernetes
|
|
# resource inputs remain outside this map; template expressions derive the
|
|
# corresponding runtime values from their resource owner.
|
|
gatewayConfig:
|
|
openshell:
|
|
version: 2
|
|
|
|
# Server configuration
|
|
server:
|
|
# -- Operator-facing gateway name. Defaults to the chart fullname so all
|
|
# replicas in one installation share an identity. Set explicitly when one
|
|
# telemetry collector receives spans from multiple namespaces or clusters.
|
|
name: ""
|
|
# -- Gateway log level.
|
|
logLevel: info
|
|
# OpenTelemetry trace export over OTLP/gRPC. Leave endpoint empty to disable.
|
|
otlp:
|
|
# -- OTLP/gRPC collector endpoint, conventionally using port 4317.
|
|
endpoint: ""
|
|
# -- Gateway OpenTelemetry service name. Empty uses openshell-gateway.
|
|
serviceName: ""
|
|
# Gateway-native OCSF JSONL output.
|
|
ocsfLog:
|
|
# -- Write gateway OCSF events as JSONL.
|
|
enabled: false
|
|
# -- OCSF JSONL path. The default is writable in the gateway container but
|
|
# does not persist across restarts. To keep records, mount a volume with
|
|
# server.extraVolumes and server.extraVolumeMounts and set a path on it.
|
|
# When replicas share the volume, set subPathExpr: $(OPENSHELL_POD_NAME)
|
|
# on the mount so each replica writes its own file.
|
|
path: /tmp/gateway-ocsf.jsonl
|
|
# -- Optional OCSF downgrade target. Empty emits native OCSF 1.8.0.
|
|
# Supported values: "1.1", "1.3".
|
|
schemaVersion: ""
|
|
# -- Rotate the active file daily in UTC, or never.
|
|
rotation: daily
|
|
# -- Rotated files retained when rotation is daily.
|
|
maxFiles: 7
|
|
# -- Maximum records waiting for the file writer.
|
|
queueCapacity: 10000
|
|
# -- Maximum encoded bytes waiting for the file writer.
|
|
queueMaxBytes: 16777216
|
|
# -- Additional volumes for the gateway pod.
|
|
extraVolumes: []
|
|
# -- Additional volume mounts for the gateway container.
|
|
extraVolumeMounts: []
|
|
# -- Enable anonymous OpenShell telemetry from the gateway and the sandbox
|
|
# supervisors it launches.
|
|
telemetryEnabled: true
|
|
# -- Namespace where sandbox pods are created. Defaults to the Helm release
|
|
# namespace (.Release.Namespace) when left empty.
|
|
sandboxNamespace: ""
|
|
# -- Gateway database URL (used for the default SQLite backend). SQLite runs
|
|
# in WAL mode and needs a local block-backed volume, not NFS or other network
|
|
# filesystems.
|
|
dbUrl: "sqlite:/var/openshell/openshell.db"
|
|
# -- Name of a pre-existing Opaque Secret containing a PostgreSQL
|
|
# connection URI (key: uri). When set, the gateway reads OPENSHELL_DB_URL
|
|
# from this Secret instead of using dbUrl. The Secret must contain a
|
|
# `uri` key, e.g. postgresql://user:pass@host:5432/dbname.
|
|
externalDbSecret: ""
|
|
# -- Image pull secrets attached to sandbox pods. Referenced Secrets must exist
|
|
# in the sandbox namespace.
|
|
sandboxImagePullSecrets: []
|
|
# -- Default storage size for the workspace PVC in sandbox pods.
|
|
# Uses Kubernetes quantity syntax (e.g. "2Gi", "10Gi", "500Mi").
|
|
# Empty = built-in default (2Gi).
|
|
workspaceDefaultStorageSize: ""
|
|
# -- Kubernetes StorageClass for the workspace PVC in sandbox pods.
|
|
# Empty (default) = omit storageClassName, using the cluster's default
|
|
# StorageClass. Set this on clusters with no default StorageClass, otherwise
|
|
# the workspace PVC stays Pending and the sandbox never starts.
|
|
workspaceStorageClass: ""
|
|
# -- Default Kubernetes runtimeClassName for sandbox pods.
|
|
# Applied when a CreateSandbox request does not specify one.
|
|
# Empty (default) = omit the field, using the cluster's default RuntimeClass.
|
|
# Set to a RuntimeClass name (e.g. "kata-containers", "nvidia") to apply it
|
|
# to all sandboxes that don't explicitly override it.
|
|
defaultRuntimeClassName: ""
|
|
# -- UID for sandbox pods (`sandbox_uid`). Empty (default) = use the OpenShift
|
|
# SCC namespace annotation if present, otherwise the driver default. Must be
|
|
# an integer between 1 and 4294967294.
|
|
sandboxUid: ""
|
|
# -- GID for sandbox pods (`sandbox_gid`). Empty (default) = same as
|
|
# sandboxUid. Must be an integer between 1 and 4294967294.
|
|
sandboxGid: ""
|
|
# -- gRPC endpoint sandboxes call back into the gateway. Leave empty to derive
|
|
# it from the chart fullname, release namespace, service port, and
|
|
# disableTls flag, for example https://openshell.openshell.svc.cluster.local:8080.
|
|
# Override only when sandboxes must reach the gateway via a different
|
|
# hostname (e.g. an external ingress or a host alias).
|
|
grpcEndpoint: ""
|
|
# The gateway terminates TLS directly. Its client CA authenticates sandbox
|
|
# callbacks; OIDC-enabled listeners permit bearer-only user clients while
|
|
# still validating any client certificate they present.
|
|
# -- Host gateway IP for sandbox pod hostAliases. When set, sandbox pods get
|
|
# hostAliases entries mapping host.docker.internal and host.openshell.internal
|
|
# to this IP, allowing them to reach services running on the Docker host.
|
|
# Auto-detected by the cluster entrypoint script.
|
|
hostGatewayIP: ""
|
|
# -- Enable Kubernetes user namespace isolation (hostUsers: false) for sandbox
|
|
# pods. Requires Kubernetes 1.33+ with user namespace support available
|
|
# (beta through 1.35, GA in 1.36+), plus a supporting container runtime and
|
|
# Linux 5.12+. When enabled, container UID 0 maps to an unprivileged host
|
|
# UID and capabilities become namespaced.
|
|
enableUserNamespaces: false
|
|
# Kubernetes compute driver settings.
|
|
drivers:
|
|
kubernetes:
|
|
# -- Allow caller driver JSON; external resources still require approval.
|
|
allowDriverConfig: false
|
|
resourceAdmission:
|
|
# -- Require operator approval labels on external sandbox attachments (GPU attachments exempt).
|
|
enabled: true
|
|
# -- Replacement label map; null uses the built-in admission labels. Empty map is invalid when enabled.
|
|
requiredLabels: null
|
|
# -- How workspaces map to Kubernetes namespaces.
|
|
# "shared" (default): all sandboxes in a single namespace.
|
|
# "managed": auto-creates per-workspace namespaces.
|
|
# "operator": uses pre-provisioned namespaces.
|
|
workspaceMode: "shared"
|
|
# -- K8s label selector for namespace discovery in operator mode.
|
|
# The driver watches namespaces matching this label.
|
|
operatorNamespaceLabel: ""
|
|
# -- Path to a JSON file containing an array of namespace names
|
|
# allowed in operator mode. Hot-reloaded on change.
|
|
operatorNamespaceFile: ""
|
|
# -- Disable TLS entirely - the server listens on plaintext HTTP.
|
|
# Set to true when a reverse proxy / tunnel terminates TLS at the edge.
|
|
disableTls: false
|
|
# -- Enable plaintext HTTP routing for loopback sandbox service URLs on
|
|
# TLS-enabled gateways.
|
|
enableLoopbackServiceHttp: true
|
|
# -- Enable the WebSocket tunnel used by CLI/SDK clients behind an
|
|
# authenticated edge proxy. Leave disabled for direct gateway installs.
|
|
enableWebsocketTunnel: false
|
|
# -- Posture when a candidate sandbox policy fails validation. `fail_closed`
|
|
# deactivates the previous policy; `retain_last_valid` keeps it active.
|
|
policyValidationFailureMode: fail_closed
|
|
# Optional gateway-wide gRPC request rate limit. Applies only to gRPC API
|
|
# traffic after protocol multiplexing; health, metrics, and loopback service
|
|
# HTTP routes are not rate limited. Both values must be positive to enable the
|
|
# limit, otherwise it is omitted from the rendered config and stays disabled.
|
|
grpcRateLimit:
|
|
# -- Maximum gRPC requests allowed per window. Must be positive (alongside
|
|
# windowSeconds) to enable rate limiting; 0 (default) disables it.
|
|
requests: 0
|
|
# -- gRPC rate-limit window length in seconds. Must be positive (alongside
|
|
# requests) to enable rate limiting; 0 (default) disables it.
|
|
windowSeconds: 0
|
|
# Default credential storage settings (used when no credential driver is
|
|
# enabled). The gateway encrypts provider credentials in the database using
|
|
# AES-256-GCM with a key-encryption key (KEK). By default, the Helm chart
|
|
# generates and retains a KEK Secret. For GitOps / helm-template workflows
|
|
# where `lookup` is unavailable, reference a pre-created Secret instead.
|
|
credentialStorage:
|
|
# -- Name of a pre-existing Secret containing the key-encryption key.
|
|
# When set, the chart does NOT generate a new Secret; it references this
|
|
# one instead. The Secret must contain a key named "key-encryption-key"
|
|
# with a base64-encoded 32-byte value. Required for GitOps workflows that
|
|
# render manifests with `helm template` (where `lookup` is unavailable).
|
|
existingSecret: ""
|
|
# Provider credential drivers store provider credential secret material in an
|
|
# external or native backend. When no driver is enabled, the gateway uses its
|
|
# default encrypted database credential storage with a retained Kubernetes
|
|
# Secret for the shared key-encryption key.
|
|
credentialDrivers:
|
|
kubernetesSecrets:
|
|
# -- Enable the in-tree Kubernetes Secret credential driver.
|
|
# WARNING: The RBAC Role grants read/write access to ALL Secrets in the
|
|
# configured namespace. Use a dedicated namespace to limit blast radius.
|
|
enabled: false
|
|
# -- Namespace where OpenShell-managed provider Secret objects are stored.
|
|
# Empty = Helm release namespace. A dedicated namespace is RECOMMENDED
|
|
# to isolate OpenShell-managed Secrets from other workloads.
|
|
namespace: ""
|
|
# -- Create the credential namespace. Requires a namespace other than the
|
|
# release namespace. The Namespace is retained on uninstall so stored
|
|
# credentials survive; an existing Namespace not owned by this release is
|
|
# left untouched.
|
|
createNamespace: false
|
|
rbac:
|
|
# -- Create a Role/RoleBinding granting the gateway ServiceAccount read/write access to managed provider Secrets.
|
|
create: true
|
|
vault:
|
|
# -- Enable the in-tree Vault credential driver.
|
|
enabled: false
|
|
# -- Vault service base URL. Non-loopback endpoints must use HTTPS, for example https://vault.vault.svc.cluster.local:8200.
|
|
address: ""
|
|
# -- ConfigMap containing the private Vault CA certificate bundle in the ca.crt key. Leave empty to use platform trust roots.
|
|
caConfigMapName: ""
|
|
# -- Default KV mount name.
|
|
mount: secret
|
|
# -- Default KV engine version. Use "1" or "2".
|
|
kvVersion: "2"
|
|
# -- Authentication method. Use "kubernetes" in-cluster or "token_file" for local/dev validation.
|
|
authMethod: kubernetes
|
|
# -- Vault Kubernetes auth role when authMethod is kubernetes.
|
|
role: ""
|
|
# -- Vault Kubernetes auth mount.
|
|
kubernetesAuthMount: kubernetes
|
|
# -- ServiceAccount token path used for Kubernetes auth.
|
|
serviceAccountTokenPath: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
# -- Mounted token file path when authMethod is token_file.
|
|
tokenPath: ""
|
|
# -- HTTP request timeout in seconds. Empty = driver default.
|
|
timeoutSecs: ""
|
|
auth:
|
|
# -- UNSAFE: accept unauthenticated CLI/user requests as a local developer
|
|
# principal. Intended only for trusted local Skaffold/k3d development or a
|
|
# fully trusted fronting proxy. Leave false for shared or production clusters.
|
|
allowUnauthenticatedUsers: false
|
|
tls:
|
|
# -- K8s secret (type kubernetes.io/tls) with tls.crt and tls.key for the server.
|
|
certSecretName: openshell-server-tls
|
|
# -- Enable mTLS client certificate authentication. When false, the gateway
|
|
# runs HTTPS-only without requiring client certificates (use OIDC for auth
|
|
# instead). Must be false when using BackendTLSPolicy because ingress
|
|
# proxies cannot present client certificates to the backend.
|
|
enableMtls: true
|
|
# -- K8s secret with ca.crt for client certificate verification (mTLS).
|
|
# Only used when enableMtls is true. Set to "" to disable client certificate
|
|
# verification for HTTPS-only mode.
|
|
clientCaSecretName: openshell-server-client-ca
|
|
# -- K8s secret mounted into sandbox pods for mTLS to the server.
|
|
clientTlsSecretName: openshell-client-tls
|
|
# Gateway-minted sandbox JWT signing keys. The certgen hook generates an
|
|
# Ed25519 keypair and writes it to a secret containing signing.pem (PKCS#8),
|
|
# public.pem (SPKI), and kid (plain text). The hook runs in full PKI mode when
|
|
# pkiInitJob.enabled=true unless certManager.enabled=true, which takes
|
|
# precedence and runs the hook in JWT-only mode.
|
|
sandboxJwt:
|
|
# -- Name of the Opaque Secret holding the signing key material. Empty
|
|
# falls back to the chart fullname with "-jwt-keys" appended.
|
|
signingSecretName: ""
|
|
# -- Stable gateway identity embedded in iss/aud of every minted token.
|
|
# Defaults to the release name so HA replicas share identity.
|
|
gatewayId: ""
|
|
# -- Token TTL in seconds. Defaults to 3600 (1h).
|
|
ttlSecs: 3600
|
|
# -- Lifetime (seconds) of the projected ServiceAccount token kubelet
|
|
# writes into each sandbox pod for the IssueSandboxToken bootstrap
|
|
# exchange. Kubelet enforces a minimum of 600s; the driver clamps
|
|
# values outside [600, 86400]. Default 3600 — generous, since the
|
|
# supervisor consumes the token within seconds of pod start.
|
|
k8sSaTokenTtlSecs: 3600
|
|
# -- File mode for the mounted JWT signing key Secret. Default 0400
|
|
# (owner-read only). Override to 0440 or 0444 if the container UID
|
|
# does not match the volume file owner.
|
|
secretDefaultMode: ""
|
|
# Dynamic provider token grants. When SPIFFE is enabled here, both the
|
|
# gateway and sandbox supervisors mount the SPIFFE Workload API socket so
|
|
# token-exchange profiles can use gateway- and sandbox-scoped JWT-SVIDs.
|
|
# Supervisor-to-gateway authentication still uses gateway-minted sandbox JWTs.
|
|
providerTokenGrants:
|
|
spiffe:
|
|
# -- Mount the SPIFFE Workload API socket into gateway and sandbox pods for dynamic provider token grants.
|
|
enabled: false
|
|
# -- Path to the SPIFFE Workload API socket mounted into gateway and sandbox pods.
|
|
workloadApiSocketPath: /spiffe-workload-api/spire-agent.sock
|
|
# OIDC (OpenID Connect) configuration for JWT-based authentication.
|
|
# When issuer is set, the server validates Bearer tokens on gRPC requests.
|
|
oidc:
|
|
# -- OIDC issuer URL (e.g. https://keycloak.example.com/realms/openshell).
|
|
issuer: ""
|
|
# -- Development only: permit cleartext OIDC requests to numeric loopback
|
|
# addresses. This never permits HTTP to hostnames or non-loopback addresses.
|
|
dangerouslyAllowInsecureHttp: false
|
|
# -- Additional trusted HTTPS origins allowed to serve JWKS. The issuer
|
|
# origin is always allowed. Entries must not include a path or query.
|
|
jwksAllowedOrigins: []
|
|
# -- Expected audience claim for the API resource server.
|
|
# This should match the server's --oidc-audience, NOT the CLI client ID.
|
|
audience: "openshell-cli"
|
|
# -- JWKS key cache TTL in seconds. Must be greater than zero.
|
|
jwksTtl: 3600
|
|
# -- Dot-separated path to the roles array in the JWT claims.
|
|
# Keycloak: "realm_access.roles", Entra ID: "roles", Okta: "groups".
|
|
rolesClaim: ""
|
|
# -- Role name for admin access. Leave empty (with userRole also empty) for
|
|
# authentication-only mode. Both must be set or both empty.
|
|
adminRole: ""
|
|
# -- Role name for standard user access.
|
|
userRole: ""
|
|
# -- Dot-separated path to the scopes array in the JWT claims.
|
|
scopesClaim: ""
|
|
# -- Name of a ConfigMap containing a CA certificate bundle (key: ca.crt)
|
|
# for verifying the OIDC issuer's TLS certificate. Required when the
|
|
# issuer uses a non-public CA (e.g. OpenShift ingress, private PKI).
|
|
caConfigMapName: ""
|
|
|
|
# Kubernetes resource references for external credential drivers. Runtime
|
|
# driver settings remain in gatewayConfig.
|
|
credentialDrivers:
|
|
vault:
|
|
# -- ConfigMap containing the private Vault/OpenBao CA certificate under
|
|
# the ca.crt key. Helm mounts it only when the Vault driver is selected.
|
|
caConfigMapName: ""
|
|
|
|
# NetworkPolicy restricting SSH ingress on sandbox pods to the gateway only.
|
|
networkPolicy:
|
|
# -- Restrict SSH ingress on sandbox pods to the gateway. In managed mode,
|
|
# the driver applies the equivalent policy to each workspace namespace.
|
|
enabled: true
|
|
|
|
# Built-in TLS PKI bootstrap via a pre-install/pre-upgrade hook Job.
|
|
# Runs `openshell-gateway generate-certs` to create the server and client TLS
|
|
# Secrets in-cluster. Key material is written directly to K8s Secrets and
|
|
# never appears in Helm release history. Idempotent: existing secrets are
|
|
# left untouched on upgrade. Reuses the gateway image - no extra image to
|
|
# mirror in air-gapped environments.
|
|
#
|
|
# The server certificate already includes the built-in cluster SANs
|
|
# (`openshell`, `openshell.openshell.svc`, the cluster.local FQDN, `localhost`,
|
|
# `openshell.localhost`, `*.openshell.localhost`, `host.docker.internal`, and
|
|
# `127.0.0.1`) baked into the gateway binary. The lists below are additional
|
|
# SANs appended on top. Wildcard DNS SANs also enable sandbox service URLs under
|
|
# that domain, for example `*.apps.example.com` enables
|
|
# `<sandbox>--<service>.apps.example.com`.
|
|
pkiInitJob:
|
|
# -- Run a pre-install/pre-upgrade Job that creates gateway and client mTLS
|
|
# Secrets. When certManager.enabled=true, cert-manager owns TLS and this same
|
|
# hook runs in JWT-only mode even if pkiInitJob.enabled remains true.
|
|
enabled: true
|
|
# -- Extra DNS SANs to append to the server certificate.
|
|
serverDnsNames: []
|
|
# -- Extra IP SANs to append to the server certificate.
|
|
serverIpAddresses: []
|
|
# -- Maximum time in seconds for the certgen hook to poll for cert-manager
|
|
# certificates. When using cert-manager with BackendTLSPolicy, the hook
|
|
# polls for this many seconds waiting for the certificate to be issued,
|
|
# then creates the backend CA ConfigMap. The Job deadline is set to
|
|
# (timeoutSeconds + 30) to allow time for ConfigMap creation and cleanup.
|
|
# Increase this if cert-manager takes longer than 120 seconds to issue
|
|
# certificates.
|
|
timeoutSeconds: 120
|
|
# -- Fail the helm install/upgrade if cert-manager does not issue the
|
|
# certificate within the polling timeout. When true (default), the install
|
|
# fails immediately if the timeout is reached, providing clear feedback that
|
|
# BackendTLSPolicy is non-functional. When false, the hook succeeds with a
|
|
# warning and you can run `helm upgrade` after cert-manager issues the
|
|
# certificate to create the backend CA ConfigMap. If you set this to false and
|
|
# see "TLS error: Secret is not supplied by SDS" when connecting to the gateway,
|
|
# check if the TLS secret exists and run `helm upgrade` to create the ConfigMap.
|
|
failOnTimeout: true
|
|
|
|
# cert-manager Certificate/Issuer resources (requires cert-manager CRDs in-cluster).
|
|
# Does not install cert-manager itself.
|
|
certManager:
|
|
# -- Create cert-manager Issuer and Certificate resources. When enabled,
|
|
# cert-manager owns TLS and the chart runs a JWT-only certgen hook to create
|
|
# the sandbox JWT signing Secret that cert-manager does not manage.
|
|
enabled: false
|
|
# -- Secret created for the intermediate CA (Certificate with isCA: true).
|
|
caSecretName: openshell-ca-tls
|
|
# -- Override the issuerRef for the external server Certificate (e.g. a real
|
|
# LetsEncrypt/ACME ClusterIssuer for a publicly-trusted cert on an external hostname).
|
|
# When set, the chart creates a second server certificate from this issuer
|
|
# with only the hostnames in serverDnsNames; the internal server certificate
|
|
# is always signed by the chart's own CA. Leave name empty to use the chart
|
|
# CA for all server certificates (default). Requires certManager.enabled=true.
|
|
serverIssuerRef:
|
|
name: ""
|
|
kind: ""
|
|
group: ""
|
|
# -- Mount gateway client CA from the internal server TLS secret's ca.crt.
|
|
# The internal server certificate is always signed by the chart CA — the same
|
|
# CA that signs the client (mTLS) certificate — so the default (true) is
|
|
# correct for all configurations, including when serverIssuerRef is set.
|
|
# Only set to false if you mount the client CA from a separate secret via
|
|
# server.tls.clientCaSecretName.
|
|
clientCaFromServerTlsSecret: true
|
|
# -- Duration for cert-manager-issued certificates.
|
|
certificateDuration: 8760h
|
|
# -- Renewal window for cert-manager-issued certificates.
|
|
certificateRenewBefore: 720h
|
|
# -- DNS SANs on the cert-manager-issued server certificate.
|
|
serverDnsNames:
|
|
- openshell
|
|
- openshell.openshell.svc
|
|
- openshell.openshell.svc.cluster.local
|
|
- localhost
|
|
- openshell.localhost
|
|
- "*.openshell.localhost"
|
|
- host.docker.internal
|
|
# -- IP SANs on the cert-manager-issued server certificate.
|
|
serverIpAddresses:
|
|
- 127.0.0.1
|
|
|
|
# Kubernetes Gateway API - GRPCRoute and Gateway resources.
|
|
# Requires a Gateway API controller in the cluster. OpenShell tests the
|
|
# examples with Envoy Gateway, which can be installed via skaffold.yaml or
|
|
# independently:
|
|
# helm install eg oci://docker.io/envoyproxy/gateway-helm \
|
|
# --version v1.4.1 -n envoy-gateway-system --create-namespace
|
|
grpcRoute:
|
|
# -- Create a Gateway API GRPCRoute for the gateway service.
|
|
enabled: false
|
|
# -- Hostnames the GRPCRoute matches on. Leave empty to match all hosts.
|
|
hostnames: []
|
|
gateway:
|
|
# -- When true, a Gateway resource is created in the release namespace.
|
|
# Set to false and provide name/namespace to attach to a pre-existing
|
|
# Gateway. Use sectionName to select a specific listener when needed.
|
|
create: false
|
|
# -- GatewayClass for a chart-created Gateway. Set this to the name exposed
|
|
# by your Gateway API implementation. Envoy Gateway uses "eg" in the
|
|
# OpenShell examples. Ignored when gateway.create is false.
|
|
className: "eg"
|
|
# -- Name of the Gateway resource. Defaults to `<fullname>`. Set a distinct
|
|
# name when the selected controller creates a proxy Service with the
|
|
# Gateway name. When gateway.create is false, set this to the name of the
|
|
# existing Gateway.
|
|
name: ""
|
|
# -- Namespace of the Gateway referenced by the GRPCRoute parentRef.
|
|
# Defaults to the release namespace. A chart-created Gateway always resides
|
|
# in the release namespace.
|
|
namespace: ""
|
|
# -- Listener name on an existing Gateway. Leave empty to let Gateway API
|
|
# listener matching select compatible listeners.
|
|
sectionName: ""
|
|
# Listener settings (only used when gateway.create is true).
|
|
listener:
|
|
# -- Listener port for the generated Gateway resource. Use 443 with protocol HTTPS.
|
|
port: 80
|
|
# -- Listener protocol for the generated Gateway resource: HTTP or HTTPS.
|
|
# HTTPS terminates TLS at the Gateway listener; pair it with
|
|
# server.disableTls=true so the proxy forwards plaintext to the gateway
|
|
# pod, and use OIDC for client identity (the gateway never sees the client
|
|
# certificate).
|
|
protocol: HTTP
|
|
# -- "Same" restricts attached routes to the release namespace; "All" allows any namespace.
|
|
allowedRoutes: Same
|
|
# TLS settings for the listener. Used only when protocol is HTTPS
|
|
# (mode is always Terminate).
|
|
tls:
|
|
# -- certificateRefs for the HTTPS listener. Required when protocol is
|
|
# HTTPS. Each entry needs a `name` pointing at a kubernetes.io/tls Secret
|
|
# in the Gateway's namespace. May reference a cert-manager-issued Secret
|
|
# or the existing openshell-server-tls Secret (its SANs must include the
|
|
# external hostname).
|
|
certificateRefs: []
|
|
replicaRouting:
|
|
# -- Route requests carrying an `x-openshell-replica` header straight to
|
|
# that gateway replica. The CLI sets the header on long-lived sandbox
|
|
# connections (SSH, port forwards, exec) using the owner the gateway
|
|
# reports, so they skip the relay through a peer replica. Renders one
|
|
# Service per replica. Requires workload.kind=statefulset,
|
|
# workload.allowMultiReplicaStatefulSet=true, and at most 15 replicas.
|
|
enabled: false
|
|
# BackendTLSPolicy for end-to-end TLS between the Gateway proxy and the
|
|
# OpenShell gateway pod. When enabled, the Gateway proxy terminates
|
|
# client-facing TLS at the listener and re-encrypts when connecting to the
|
|
# backend service, validating the backend's certificate against the
|
|
# specified CA. Requires the gateway pod to serve TLS (server.disableTls
|
|
# must be false). Supported on OpenShift 4.22+ and other platforms with
|
|
# BackendTLSPolicy support in the Gateway API implementation.
|
|
backendTLSPolicy:
|
|
# -- Create a BackendTLSPolicy resource for end-to-end TLS between the
|
|
# Gateway proxy and the OpenShell gateway pod. The traffic flow is:
|
|
# client → HTTPS → Gateway (terminate) → TLS (re-encrypt) → gateway pod.
|
|
# Requires server.disableTls=false and server.tls.enableMtls=false. The
|
|
# certgen hook auto-creates the backend CA ConfigMap.
|
|
enabled: false
|
|
# -- Name of the ConfigMap containing the CA certificate (key: ca.crt) used
|
|
# to validate the gateway pod's TLS certificate. Defaults to
|
|
# `<fullname>-backend-ca` when empty. The certgen hook auto-creates this:
|
|
# with pkiInitJob (default), immediately on install/upgrade; with
|
|
# cert-manager, the hook polls for pkiInitJob.timeoutSeconds seconds
|
|
# waiting for cert-manager to issue the server certificate, then creates the
|
|
# ConfigMap. A single install usually succeeds; if cert-manager takes longer,
|
|
# increase pkiInitJob.timeoutSeconds. By default (pkiInitJob.failOnTimeout=true),
|
|
# the install fails if the timeout is reached; set failOnTimeout=false to allow
|
|
# the install to succeed and run `helm upgrade` after the certificate is issued.
|
|
caCertificateConfigMapName: ""
|
|
# -- Hostname the Gateway proxy validates against the backend's TLS
|
|
# certificate SAN. Defaults to the service FQDN
|
|
# (`<fullname>.<namespace>.svc.cluster.local`) when empty, which matches
|
|
# the SAN included by both cert-manager and the pkiInitJob.
|
|
hostname: ""
|
|
|
|
# OpenShift Route with TLS passthrough. The gateway terminates its own
|
|
# TLS/mTLS; the router only forwards based on SNI, so it never sees plaintext
|
|
# or the client certificate. Requires server.disableTls=false and a server
|
|
# cert whose SANs include the Route host (see certManager.serverIssuerRef).
|
|
openshiftRoute:
|
|
# -- Create an OpenShift Route with TLS passthrough.
|
|
enabled: false
|
|
# -- Hostname for the Route. Must match a SAN on the gateway's server cert.
|
|
host: ""
|
|
# -- Extra annotations on the Route (e.g. haproxy.router.openshift.io/*).
|
|
annotations: {}
|