Skip to content

Commit c30d30f

Browse files
committed
feat(helm): add TLS certificate reload interval config
Signed-off-by: Yuedong Wu <dwcn22@outlook.com>
1 parent 6beb3c3 commit c30d30f

4 files changed

Lines changed: 14 additions & 0 deletions

File tree

deploy/helm/openshell/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ JWT signing Secret.
216216
| server.tls.certSecretName | string | `"openshell-server-tls"` | K8s secret (type kubernetes.io/tls) with tls.crt and tls.key for the server. |
217217
| server.tls.clientCaSecretName | string | `"openshell-server-client-ca"` | K8s secret with ca.crt for client certificate verification (mTLS). Set to "" to disable mTLS and run HTTPS-only (use OIDC for auth instead). |
218218
| server.tls.clientTlsSecretName | string | `"openshell-client-tls"` | K8s secret mounted into sandbox pods for mTLS to the server. |
219+
| server.tls.reloadIntervalSecs | int | `0` | Interval in seconds between TLS certificate reload checks. Set to 0 to disable periodic reload (the default). Set to a positive value (e.g., 60 or 600) to enable polling-based hot-reload. The gateway re-reads cert/key/CA files on each tick and atomically swaps the active TLS config when they change. |
219220
| server.workspaceDefaultStorageSize | string | `""` | Default storage size for the workspace PVC in sandbox pods. Uses Kubernetes quantity syntax (e.g. "2Gi", "10Gi", "500Mi"). Empty = built-in default (2Gi). |
220221
| service.healthPort | int | `8081` | Gateway health service port. |
221222
| service.metricsPort | int | `9090` | Gateway metrics service port. |

deploy/helm/openshell/templates/gateway-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ data:
6363
cert_path = "/etc/openshell-tls/server/tls.crt"
6464
key_path = "/etc/openshell-tls/server/tls.key"
6565
client_ca_path = "/etc/openshell-tls/client-ca/ca.crt"
66+
{{- if .Values.server.tls.reloadIntervalSecs }}
67+
reload_interval_secs = {{ .Values.server.tls.reloadIntervalSecs }}
68+
{{- end }}
6669
{{- end }}
6770
6871
{{- if .Values.server.auth.allowUnauthenticatedUsers }}

deploy/helm/openshell/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ server:
208208
clientCaSecretName: openshell-server-client-ca
209209
# -- K8s secret mounted into sandbox pods for mTLS to the server.
210210
clientTlsSecretName: openshell-client-tls
211+
# -- Interval in seconds between TLS certificate reload checks.
212+
# Set to 0 to disable periodic reload (the default). Set to a positive
213+
# value (e.g., 60 or 600) to enable polling-based hot-reload. The gateway
214+
# re-reads cert/key/CA files on each tick and atomically swaps the active
215+
# TLS config when they change.
216+
reloadIntervalSecs: 0
211217
# Gateway-minted sandbox JWT signing keys. The certgen hook generates an
212218
# Ed25519 keypair and writes it to a secret containing signing.pem (PKCS#8),
213219
# public.pem (SPKI), and kid (plain text). The hook runs in full PKI mode when

docs/reference/gateway-config.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ cert_path = "/etc/openshell/certs/gateway.pem"
104104
key_path = "/etc/openshell/certs/gateway-key.pem"
105105
client_ca_path = "/etc/openshell/certs/client-ca.pem"
106106
require_client_auth = false
107+
# Polling interval in seconds for hot-reloading TLS certificates.
108+
# Set to 0 to disable reload (the default).
109+
# reload_interval_secs = 600
107110

108111
[openshell.gateway.gateway_jwt]
109112
signing_key_path = "/etc/openshell/jwt/signing.pem"
@@ -160,6 +163,7 @@ compute_drivers = ["kubernetes"]
160163
cert_path = "/etc/openshell-tls/server/tls.crt"
161164
key_path = "/etc/openshell-tls/server/tls.key"
162165
client_ca_path = "/etc/openshell-tls/client-ca/ca.crt"
166+
# reload_interval_secs = 600 # opt-in: polling interval for TLS cert hot-reload
163167

164168
[openshell.drivers.kubernetes]
165169
namespace = "agents"

0 commit comments

Comments
 (0)