Skip to content

Conversation

@bussyjd
Copy link
Collaborator

@bussyjd bussyjd commented Nov 7, 2025

No description provided.

bussyjd and others added 4 commits November 7, 2025 16:40
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
Copy link
Collaborator

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".

Copy link
Contributor

@OisinKyne OisinKyne left a 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.

bussyjd and others added 2 commits December 8, 2025 19:40
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.
kind: Role
metadata:
name: obol-agent-role
namespace: ethereum
Copy link
Collaborator

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 @@
---
Copy link
Collaborator

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

bussyjd and others added 7 commits December 9, 2025 14:02
- 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
@Padraic-O-Mhuiris Padraic-O-Mhuiris self-requested a review December 11, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants