Skip to content

[FEATURE] Helm Secret Creation Feature FlagΒ #345

@Matcham89

Description

@Matcham89

πŸ“‹ Prerequisites

πŸ“ Feature Summary

Create a feature flag for helm secrets

❓ Problem Statement / Motivation

  • provider secrets are created by default
  • helm/kagent/templates/secret.yaml comments state that the app container will fail if the secret is NULL.
  • if a user wants to deploy via helm and has a secret manager (external-secrets) there will be conflicts/duplication.
  • if a user wants to deploy via helm delcaratively (argocd) & with a secret manager, there will be ownership warnings.

πŸ’‘ Proposed Solution

would be good to have a feature-flag for the secret creation, per provider.

providers.openAI.secretCreation.enabled

providers:
  default: openAI
  openAI:
    secretCreation: false
    provider: OpenAI
    model: "gpt-4.1-mini"
    apiKeySecretRef: kagent-openai
    apiKeySecretKey: OPENAI_API_KEY
{{- $dot := . }}
{{- $model := index $dot.Values.providers $dot.Values.providers.default  }}
{{- if $model.secretCreation.enabled }}
---
apiVersion: v1
kind: Secret
metadata:
  name: {{ $model.apiKeySecretRef | quote }}
  labels:
    {{- include "kagent.labels" $dot | nindent 4 }}
type: Opaque
data:
  {{/*  to prevent app container to fail with empty key use default - */}}
  {{ $model.apiKeySecretKey | default (printf "%s_API_KEY" $model.provider | upper) }}: {{ $model.apiKey | default "-" | b64enc }}
{{- end }}

πŸ”„ Alternatives Considered

No response

🎯 Affected Service(s)

App Service

πŸ“š Additional Context

No response

πŸ™‹ 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
    No fields configured for Feature.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions