Skip to content

[FEATURE | API DESIGN] Use nested structure for ModelConfig ApiKey CRDΒ #1130

@inFocus7

Description

@inFocus7

πŸ“‹ Prerequisites

πŸ“ Feature Summary

Update the CRD for ModelConfig to nest the ApiKey Secret

❓ Problem Statement / Motivation

We have implemented a new secret ref for ModelConfigs - TLS CA certs, which follow a nested approach modelconfig.spec.tls.(secret). Setting up a api key which also is a secret follows a different approach modelconfig.spec.(secret).

For anyone new to kagent this could be confusing and easy to forget that both follow different structure to set their secrets. We should match their definitions to avoid confusion.

πŸ’‘ Proposed Solution

Update ModelConfig CRD from:

spec:
  apiKeySecret: xyz
  apiKeySecretKey: xyz

to

spec:
  apiKey:
    secretRef: xyz
    secretKey: xyz

Then:

  1. Mark existing apiKey config as deprecated.
  2. During translation use the new setup, falling back to old if unset.
  3. If the user is using old ModelConfig, log a warning.
Image

πŸ”„ Alternatives Considered

No response

🎯 Affected Service(s)

None

πŸ“š Additional Context

This would be a breaking change, but we can mark the existing CRD fields as Deprecated (with a planned removal) and log so that users know to move to new definition.

While we may want to avoid breaking changes (although technically not breaking if we deprecate it first), it's better to get this in sooner so less users are impacted as the userbase grows.

πŸ™‹ Are you willing to contribute?

  • I am willing to submit a PR for this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions