mirror of
https://github.com/open-webui/terminals.git
synced 2026-11-22 21:50:42 -05:00
refac
This commit is contained in:
1 parent
0e89fe7829
commit
be10268c03
3 files changed
+40
No files matched your search
@@ -163,6 +163,40 @@ policy `podTemplate` field and native Kubernetes volumes instead:
|
||||
Read-only mounts prevent writes through that mount, but they are not a security
|
||||
boundary if terminal containers are privileged or can access the Docker socket.
|
||||
|
||||
### Kubernetes health probes
|
||||
|
||||
Both Kubernetes backends accept probe overrides in the policy's `podTemplate`.
|
||||
Each supplied probe replaces the default, so include its check (such as
|
||||
`httpGet`) as well as timing settings. For slower hardware:
|
||||
|
||||
```json
|
||||
{
|
||||
"podTemplate": {
|
||||
"spec": {
|
||||
"containers": [{
|
||||
"name": "open-terminal",
|
||||
"readinessProbe": {
|
||||
"httpGet": {"path": "/health", "port": 8000},
|
||||
"initialDelaySeconds": 15,
|
||||
"periodSeconds": 10,
|
||||
"timeoutSeconds": 5,
|
||||
"failureThreshold": 6
|
||||
},
|
||||
"livenessProbe": {
|
||||
"httpGet": {"path": "/health", "port": 8000},
|
||||
"initialDelaySeconds": 60,
|
||||
"periodSeconds": 15,
|
||||
"timeoutSeconds": 5,
|
||||
"failureThreshold": 6
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Omitted probes keep their existing defaults. Refresh existing terminals to apply
|
||||
the updated policy on their next access.
|
||||
|
||||
### Policy lifecycle
|
||||
|
||||
Policies define what gets provisioned. Policy lifecycle config defines ongoing maintenance for that policy, such as scheduled resets of persisted terminal files. Due resets refresh matching terminals even when they are still running, so long-lived browser sessions do not block scheduled cleanup.
|
||||
|
||||
@@ -211,6 +211,9 @@ def _apply_pod_template(pod_manifest: dict, pod_template: dict | None) -> dict:
|
||||
{},
|
||||
)
|
||||
generated_container = generated_spec["containers"][0]
|
||||
for field in ("readinessProbe", "livenessProbe"):
|
||||
if field in template_container:
|
||||
container[field] = template_container[field]
|
||||
for field in ("env", "ports", "volumeMounts"):
|
||||
container[field] = _merge_by_name(
|
||||
template_container.get(field), generated_container.get(field)
|
||||
|
||||
@@ -153,6 +153,9 @@ def _apply_pod_template(pod_manifest: dict, pod_template: dict | None) -> dict:
|
||||
{},
|
||||
)
|
||||
generated_container = generated_spec["containers"][0]
|
||||
for field in ("readinessProbe", "livenessProbe"):
|
||||
if field in template_container:
|
||||
container[field] = template_container[field]
|
||||
for field in ("env", "ports", "volumeMounts"):
|
||||
container[field] = _merge_by_name(
|
||||
template_container.get(field), generated_container.get(field)
|
||||
|
||||
Reference in new issue
Block a user