-
Notifications
You must be signed in to change notification settings - Fork 0
Obol-agent template #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add support for securely providing the GOOGLE_API_KEY to the Obol Agent via Kubernetes secrets instead of plaintext values in YAML. Changes: - Add --google-api-key flag (short: -g) to 'obol stack up' command - Accept GOOGLE_API_KEY environment variable as alternative input - Create 'agent' namespace and 'obol-agent-google-api-key' secret automatically - Update obol-agent.yaml to consume secret via secretKeyRef - Provide clear warnings when API key is not supplied The implementation uses kubectl dry-run + apply pattern for idempotent secret creation, matching the error handling style of existing code. Usage: obol stack up --google-api-key="your-key" obol stack up -g "your-key" GOOGLE_API_KEY="your-key" obol stack up
Addresses review feedback to separate agent initialization from stack lifecycle. Changes: - Create new internal/agent package with Init() function for Google API key secret management - Add 'obol agent init' command with --google-api-key flag (-g) and GOOGLE_API_KEY env var support - Remove Google API key parameter from 'obol stack up' command - Remove Google API key secret creation logic from syncDefaults in internal/stack/stack.go - Update CLI help text to include new agent command section Usage: obol stack up # Start stack (no API key needed) obol agent init --google-api-key="key" # Initialize agent with API key obol agent init -g "key" # Short form GOOGLE_API_KEY="key" obol agent init # Via environment variable The agent init command requires the stack to be running and will create: - agent namespace (if it doesn't exist) - obol-agent-google-api-key secret in the agent namespace This separation allows users to manage agent secrets independently of the stack lifecycle, making it clearer when and how to provide sensitive credentials.
Add Google API key secret management for Obol Agent
| namespace: agent | ||
|
|
||
| --- | ||
| # Role for 'ethereum' namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks duplicated, possibly my own fault given the relabelling of "l1" and "ethereum".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM except lets remove google from the customer facing interface at a minimum if not all the internals. I stopped making suggestions after a while when the idea is communicated. Suggestion for @agaskrobot around allowing the Agent component to auto-show if e.g. an anchor is in the url like obol.stack#agent.
I made a ticket #117 for us to make this command work with stdin as well, for users who need to be guided through it. TBH, it might end up with us doing an oauth flow for the users between google and our CLI command.
internal/embed/defaults/obol-stack-defaults/templates/obol-agent.yaml
Outdated
Show resolved
Hide resolved
internal/embed/defaults/obol-stack-defaults/templates/obol-agent.yaml
Outdated
Show resolved
Hide resolved
internal/embed/defaults/obol-stack-defaults/templates/obol-agent.yaml
Outdated
Show resolved
Hide resolved
Remove Google-specific branding from agent initialization to allow for future flexibility in API key providers. Changes include: - Rename CLI flag: --google-api-key → --agent-api-key - Update environment variable: GOOGLE_API_KEY → AGENT_API_KEY - Rename Kubernetes secret: obol-agent-google-api-key → obol-agent-api-key - Remove resource requests to lighten agent deployment for infrequent users - Remove l1 namespace RBAC (no longer exists with dynamic namespaces) - Add helpful link to Google AI Studio in error messages - Update all user-facing text to be provider-agnostic Addresses PR #84 review feedback.
Signed-off-by: JeanDaniel Bussy <[email protected]>
| kind: Role | ||
| metadata: | ||
| name: obol-agent-role | ||
| namespace: ethereum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah so there probably needs to be a different approach for namespace permissions given we have unique-per deployment approaches.
| @@ -0,0 +1,245 @@ | |||
| --- | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file also was created when I was still using the defaults namespace for our mandatory resources, frontend/erpc/local-path. They now live in internal/embed/infrastructure in the latest branch
- Refactored agent permissions to use dynamic RoleBindings per network namespace - Added stdin support for agent init command
- Relocated obol-agent manifests from defaults to infrastructure/obol-agent - Added local Chart.yaml for obol-agent - Registered obol-agent release in infrastructure helmfile - Removed legacy defaults directory
This commit applies the necessary change to cmd/obol/main.go to align with the agent.Init refactor, removing direct logging and executor calls from the action function.
- Moved obol-agent.yaml to base/templates/ - Added Namespace definition to obol-agent.yaml - Removed separate obol-agent release from helmfile - Removed separate obol-agent chart directory
Feature/obol agent refinements
Signed-off-by: JeanDaniel Bussy <[email protected]>
No description provided.