[configuration] Configuration values are set in multiple places in Helm chart #4152

Open
opened 2026-04-06 11:32:45 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/k8s-helm-config-single-source-of-truth
  • Commit Message: fix(k8s): remove duplicate config values from ConfigMap, rely on CLI args
  • Milestone: (none — backlog, see note below)
  • Parent Epic: #399

Backlog note: This issue was discovered during autonomous operation
on milestone v3.8.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Background and Context

The Helm chart for CleverAgents sets CLEVERAGENTS_SERVER_HOST, CLEVERAGENTS_SERVER_PORT, and CLEVERAGENTS_LOG_LEVEL in two separate places:

  1. k8s/templates/configmap.yaml — sets these as environment variables in the ConfigMap.
  2. k8s/templates/deployment.yaml — passes the same values as CLI arguments to the cleveragents server serve command.

The comment in configmap.yaml acknowledges this duplication and notes that CLI args take precedence over environment variables. While this is technically functional, it creates a maintenance burden: any change to these values must be made consistently in both files, and the dual-source pattern is confusing to contributors unfamiliar with the chart.

Current Behavior

k8s/templates/configmap.yaml sets:

data:
  # NOTE: The Deployment template overrides these values via CLI args
  # (command/args in deployment.yaml).  Uvicorn CLI args take precedence
  # over environment variables.  These ConfigMap entries serve as a
  # fallback for any code paths that read env vars directly (e.g.,
  # Settings model defaults) rather than relying on CLI args.
  CLEVERAGENTS_SERVER_HOST: {{ .Values.server.host | quote }}
  CLEVERAGENTS_SERVER_PORT: {{ .Values.server.port | quote }}
  CLEVERAGENTS_LOG_LEVEL: {{ .Values.server.logLevel | quote }}

k8s/templates/deployment.yaml also sets:

command: ["python", "-m", "cleveragents"]
args:
  - "server"
  - "serve"
  - "--app"
  - "cleveragents.a2a.asgi:app"
  - "--host"
  - {{ .Values.server.host | quote }}
  - "--port"
  - {{ .Values.server.port | quote }}
  - "--workers"
  - {{ .Values.server.workers | quote }}
  - "--log-level"
  - {{ .Values.server.logLevel | quote }}

Expected Behavior

There should be a single source of truth for these configuration values. Since the CLI arguments in deployment.yaml already take precedence and are the authoritative source, the redundant entries in configmap.yaml should be removed. The ConfigMap should only contain values that are not already passed as CLI arguments.

Acceptance Criteria

  • k8s/templates/configmap.yaml no longer contains CLEVERAGENTS_SERVER_HOST, CLEVERAGENTS_SERVER_PORT, or CLEVERAGENTS_LOG_LEVEL entries.
  • k8s/templates/deployment.yaml continues to pass --host, --port, and --log-level as CLI arguments (no change).
  • The Helm chart renders correctly (helm template produces valid output).
  • Any code paths that previously relied on the env-var fallback are verified to work via CLI args instead, or are updated accordingly.
  • Helm chart documentation (if any) is updated to reflect the single-source-of-truth approach.

Supporting Information

  • Files affected: k8s/templates/configmap.yaml, k8s/templates/deployment.yaml
  • Category: consistency / maintainability
  • Impact: Low — no functional regression; purely a maintenance improvement.
  • Suggested fix: Remove the three duplicate keys from configmap.yaml. If any code path genuinely requires these env vars as a fallback (i.e., reads them directly rather than via CLI), that code path should be refactored to use the CLI args or a dedicated config mechanism instead.

Subtasks

  • Audit all code paths that read CLEVERAGENTS_SERVER_HOST, CLEVERAGENTS_SERVER_PORT, and CLEVERAGENTS_LOG_LEVEL env vars directly to confirm they are not relying on the ConfigMap fallback.
  • Remove CLEVERAGENTS_SERVER_HOST, CLEVERAGENTS_SERVER_PORT, and CLEVERAGENTS_LOG_LEVEL from k8s/templates/configmap.yaml.
  • Run helm template and helm lint to verify the chart renders without errors.
  • Update any Helm chart documentation or comments that reference the dual-source pattern.
  • Run nox (all default sessions), fix any errors.
  • Verify coverage >= 97% via nox -s coverage_report.

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly (fix(k8s): remove duplicate config values from ConfigMap, rely on CLI args), followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly (fix/k8s-helm-config-single-source-of-truth).
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: Bug Hunt | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/k8s-helm-config-single-source-of-truth` - **Commit Message**: `fix(k8s): remove duplicate config values from ConfigMap, rely on CLI args` - **Milestone**: *(none — backlog, see note below)* - **Parent Epic**: #399 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.8.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Background and Context The Helm chart for CleverAgents sets `CLEVERAGENTS_SERVER_HOST`, `CLEVERAGENTS_SERVER_PORT`, and `CLEVERAGENTS_LOG_LEVEL` in two separate places: 1. **`k8s/templates/configmap.yaml`** — sets these as environment variables in the ConfigMap. 2. **`k8s/templates/deployment.yaml`** — passes the same values as CLI arguments to the `cleveragents server serve` command. The comment in `configmap.yaml` acknowledges this duplication and notes that CLI args take precedence over environment variables. While this is technically functional, it creates a maintenance burden: any change to these values must be made consistently in both files, and the dual-source pattern is confusing to contributors unfamiliar with the chart. ## Current Behavior `k8s/templates/configmap.yaml` sets: ```yaml data: # NOTE: The Deployment template overrides these values via CLI args # (command/args in deployment.yaml). Uvicorn CLI args take precedence # over environment variables. These ConfigMap entries serve as a # fallback for any code paths that read env vars directly (e.g., # Settings model defaults) rather than relying on CLI args. CLEVERAGENTS_SERVER_HOST: {{ .Values.server.host | quote }} CLEVERAGENTS_SERVER_PORT: {{ .Values.server.port | quote }} CLEVERAGENTS_LOG_LEVEL: {{ .Values.server.logLevel | quote }} ``` `k8s/templates/deployment.yaml` also sets: ```yaml command: ["python", "-m", "cleveragents"] args: - "server" - "serve" - "--app" - "cleveragents.a2a.asgi:app" - "--host" - {{ .Values.server.host | quote }} - "--port" - {{ .Values.server.port | quote }} - "--workers" - {{ .Values.server.workers | quote }} - "--log-level" - {{ .Values.server.logLevel | quote }} ``` ## Expected Behavior There should be a single source of truth for these configuration values. Since the CLI arguments in `deployment.yaml` already take precedence and are the authoritative source, the redundant entries in `configmap.yaml` should be removed. The ConfigMap should only contain values that are not already passed as CLI arguments. ## Acceptance Criteria - [ ] `k8s/templates/configmap.yaml` no longer contains `CLEVERAGENTS_SERVER_HOST`, `CLEVERAGENTS_SERVER_PORT`, or `CLEVERAGENTS_LOG_LEVEL` entries. - [ ] `k8s/templates/deployment.yaml` continues to pass `--host`, `--port`, and `--log-level` as CLI arguments (no change). - [ ] The Helm chart renders correctly (`helm template` produces valid output). - [ ] Any code paths that previously relied on the env-var fallback are verified to work via CLI args instead, or are updated accordingly. - [ ] Helm chart documentation (if any) is updated to reflect the single-source-of-truth approach. ## Supporting Information - **Files affected**: `k8s/templates/configmap.yaml`, `k8s/templates/deployment.yaml` - **Category**: consistency / maintainability - **Impact**: Low — no functional regression; purely a maintenance improvement. - **Suggested fix**: Remove the three duplicate keys from `configmap.yaml`. If any code path genuinely requires these env vars as a fallback (i.e., reads them directly rather than via CLI), that code path should be refactored to use the CLI args or a dedicated config mechanism instead. ## Subtasks - [ ] Audit all code paths that read `CLEVERAGENTS_SERVER_HOST`, `CLEVERAGENTS_SERVER_PORT`, and `CLEVERAGENTS_LOG_LEVEL` env vars directly to confirm they are not relying on the ConfigMap fallback. - [ ] Remove `CLEVERAGENTS_SERVER_HOST`, `CLEVERAGENTS_SERVER_PORT`, and `CLEVERAGENTS_LOG_LEVEL` from `k8s/templates/configmap.yaml`. - [ ] Run `helm template` and `helm lint` to verify the chart renders without errors. - [ ] Update any Helm chart documentation or comments that reference the dual-source pattern. - [ ] Run `nox` (all default sessions), fix any errors. - [ ] Verify coverage >= 97% via `nox -s coverage_report`. ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly (`fix(k8s): remove duplicate config values from ConfigMap, rely on CLI args`), followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly (`fix/k8s-helm-config-single-source-of-truth`). - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: Bug Hunt | Agent: ca-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:12:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#399 Epic: Post-MVP Server & Clients
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#4152
No description provided.