mirror of
https://github.com/open-webui/terminals.git
synced 2026-11-05 01:37:21 +00:00
[PR #5] [MERGED] feat(Kubernetes Operator): Move API Key from Pod Spec to Secret #38
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/terminals#38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/terminals/pull/5
Author: @james-westbrook
Created: 3/20/2026
Status: ✅ Merged
Merged: 3/20/2026
Merged by: @tjbck
Base:
main← Head:fix-k8s-backend-api-key-secret📝 Commits (1)
f9000a1fix: update Kubernetes backend to store API key as secret📊 Changes
1 file changed (+43 additions, -11 deletions)
View changed files
📝
terminals/backends/kubernetes.py(+43 -11)📄 Description
Description
Store terminal API keys in Kubernetes Secrets instead of plain pod env vars
Moves the per-terminal
OPEN_TERMINAL_API_KEYfrom a literalvaluein the pod spec to a Kubernetes Secret referenced viasecretKeyRef. This aligns the Kubernetes backend with the existing pattern in the Kubernetes Operator backend, which already stores API keys in Secrets (_build_secret_manifest/_read_api_key_from_secret).Problem
The Kubernetes backend embedded API keys directly in pod env vars, making them visible to anyone with
kubectl describe podaccess, which is a lower permission bar than reading Secrets. There is already a working pattern for the Kubernetes Operator to store the API key as a secret; this PR uplifts the Kubernetes backend implementation to match this more secure configuration.Changes
provision()— creates a{name}-apikeySecret before the Pod, injects the key viaV1EnvVarSource(secret_key_ref=...)instead of a literal valueteardown()— deletes the Secret alongside the Pod and Service on teardownreconcile()— reads the API key from the Secret (read_namespaced_secret) instead of extracting it frompod.spec.containers[].env[].value, which is empty forsecretKeyRefreferencesConsistency with Operator backend
{name}-apikey{name}-apikeyapi-keyapi-keysecretKeyRefsecretKeyRefread_namespaced_secretread_namespaced_secretContributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.