Skip to content

refactor(kubeaid-agent): make the exporters local subcharts - #220

Merged
ashish1099 merged 1 commit into
masterfrom
refactor/agent-subcharts
Aug 18, 2026
Merged

refactor(kubeaid-agent): make the exporters local subcharts#220
ashish1099 merged 1 commit into
masterfrom
refactor/agent-subcharts

Conversation

@ashish1099

Copy link
Copy Markdown
Member

Moves the two exporters into charts/security-exporter and charts/backup-exporter, each with its own Chart.yaml, values.yaml and templates/. The parent's templates/ drops from 26 files to 8, and its values.yaml from 584 lines to 170.

They resolve from the working tree: no repository field, no Chart.lock, no helm dependency update. This is NOT the pattern used for vendored upstream charts, where the source is checked in twice -- nothing here is duplicated.

Two bugs the flat layout had introduced come out in the wash, both invisible until now because backup-exporter defaults to off:

  • Its image tag is restored. image.tag defaults to .Chart.AppVersion, which after the fold-in was kubeaid-agent's "0.0.3" rather than backup-exporter's own "v1.2.2" -- so enabling it would have pulled a tag that does not exist. The subchart carries its original version and appVersion again.
  • Its container was named kubeaid-agent, from .Chart.Name. Inside a subchart that is backup-exporter, which is also why app.kubernetes.io/name -- the label kubeaid-agent and kubeaid-cli discover this exporter by -- is now correct by construction instead of pinned by hand.

Values keys follow the subchart names: securityExporter -> security-exporter, backupExporter -> backup-exporter. An alias would have kept the old camelCase, but it rewrites .Chart.Name to the alias too, which puts that discovery label back at risk; the rename is the safer trade.

The promtool workflow follows the templates into the subchart and now enables backup-exporter explicitly, since the rules no longer render by default.

Verified by rendering master and this branch and diffing the objects: same 16 objects by default and 25 with backup-exporter enabled, none missing, none new, and no difference beyond metadata.labels -- where helm.sh/chart now names the subchart -- plus the two backup-exporter fixes above.

Moves the two exporters into charts/security-exporter and charts/backup-exporter,
each with its own Chart.yaml, values.yaml and templates/. The parent's
templates/ drops from 26 files to 8, and its values.yaml from 584 lines to 170.

They resolve from the working tree: no repository field, no Chart.lock, no
`helm dependency update`. This is NOT the pattern used for vendored upstream
charts, where the source is checked in twice -- nothing here is duplicated.

Two bugs the flat layout had introduced come out in the wash, both invisible
until now because backup-exporter defaults to off:

  - Its image tag is restored. image.tag defaults to .Chart.AppVersion, which
    after the fold-in was kubeaid-agent's "0.0.3" rather than backup-exporter's
    own "v1.2.2" -- so enabling it would have pulled a tag that does not exist.
    The subchart carries its original version and appVersion again.
  - Its container was named kubeaid-agent, from .Chart.Name. Inside a subchart
    that is backup-exporter, which is also why app.kubernetes.io/name -- the
    label kubeaid-agent and kubeaid-cli discover this exporter by -- is now
    correct by construction instead of pinned by hand.

Values keys follow the subchart names: securityExporter -> security-exporter,
backupExporter -> backup-exporter. An alias would have kept the old camelCase,
but it rewrites .Chart.Name to the alias too, which puts that discovery label
back at risk; the rename is the safer trade.

The promtool workflow follows the templates into the subchart and now enables
backup-exporter explicitly, since the rules no longer render by default.

Verified by rendering master and this branch and diffing the objects: same 16
objects by default and 25 with backup-exporter enabled, none missing, none new,
and no difference beyond metadata.labels -- where helm.sh/chart now names the
subchart -- plus the two backup-exporter fixes above.
@ashish1099
ashish1099 merged commit 4bc6d77 into master Aug 18, 2026
7 checks passed
@ashish1099
ashish1099 deleted the refactor/agent-subcharts branch August 18, 2026 12:33
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.

1 participant