Skip to content

feat(agent): add Helm chart support for Conjur JWT authentication - #824

Merged
mladen-rusev-cyberark merged 1 commit into
jetstack:masterfrom
roeezis:split/07-helm-chart
Aug 27, 2026
Merged

feat(agent): add Helm chart support for Conjur JWT authentication#824
mladen-rusev-cyberark merged 1 commit into
jetstack:masterfrom
roeezis:split/07-helm-chart

Conversation

@roeezis

@roeezis roeezis commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Part 7 (final) of the SMS/Conjur JWT authentication series (split out of #817). Stacked on the prior 6 PRs in this series — diff will shrink to just this PR's own change once they merge.

Exposes config.cyberark's new Conjur JWT fields (serviceId, account, jwtSource) in values.yaml/values.schema.json, and documents per-cluster Conjur onboarding as a prerequisite in the chart README — the tenant administrator's own Conjur Cloud credentials, no admin credential needed at deploy time.

Test plan

  • go build ./...
  • helm lint deploy/charts/disco-agent/

@mladen-rusev-cyberark mladen-rusev-cyberark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chart renders cleanly and the env-var changes are right — ARK_SUBDOMAIN stays required, legacy keys become optional, so JWT-only installs need no username/password. expirationSeconds: 600 is the API-server minimum and works out fine given the kubelet rotates the file in place and jwtsource re-reads per exchange, so the 8-minute Conjur cache never outlives the projected token.

Findings are all in the volume wiring and the docs. One I couldn't leave inline:

Generated docs are stale. The ## Values section of README.md and values.schema.json are both generated by helm-tool (make/_shared/helm/helm.mk:98,106), and the new config.cyberark.* values are absent from the <!-- AUTO-GENERATED --> block (lines 146–520). So either the verify target fails in CI, or the schema was hand-edited into a shape helm-tool wouldn't produce. Please run make generate and commit the result — the existing values.yaml entries carry # +docs:property markers and the new block has none, which may be why generation skipped it.

Also: jwtSource has no enum in the schema, so a typo (fille) renders fine, deploys fine, and CrashLoops. Worth "enum": ["", "file"].

Comment thread deploy/charts/disco-agent/templates/deployment.yaml
Comment thread deploy/charts/disco-agent/templates/deployment.yaml Outdated
Comment thread deploy/charts/disco-agent/README.md
@roeezis
roeezis force-pushed the split/07-helm-chart branch 3 times, most recently from dbe96b8 to 2d4fc64 Compare August 24, 2026 12:19
@roeezis

roeezis commented Aug 24, 2026

Copy link
Copy Markdown
Author

Blocker fixed — took your recommended second option: dropped the jwtFilePath knob entirely (removed from values.yaml/values.schema.json/configmap.yaml) rather than trying to template mountPath from it. The agent's jwtsource.DefaultTokenPath already matches the chart's fixed mount path, so there's nothing left to misconfigure. Re-verified with your exact repro command — jwt_file_path no longer appears in the rendered config at all, and the mount is unconditionally the working path.

@roeezis

roeezis commented Aug 24, 2026

Copy link
Copy Markdown
Author

Fixed — gated both the volume and the mount on a new disco-agent.conjurJWTEnabled named template (serviceId set AND jwtSource unset-or-"file"), used in both places so they can't drift out of sync again. A pure username/password install now renders zero references to the conjur-token volume.

On audience: documented in the README's troubleshooting table that it's fixed at conjur, not a values.yaml setting, rather than adding a config knob nothing currently needs.

@roeezis

roeezis commented Aug 24, 2026

Copy link
Copy Markdown
Author

Both addressed:

  • The startup-failure claim is now actually true independent of sendSecretValues — fixed the underlying agent-side gap in feat(agent): wire Conjur JWT config into the top-level CyberArk client #823 (config-validation now requires service_id or ARK_USERNAME at ValidateAndCombineConfig time, not deferred to first upload), so kept the README sentence as-is rather than hedging it.
  • Replaced the kubectl patch --type=json snippet with two plain kubectl create secret variants (with/without ARK_DISCOVERY_API) — simpler, no shell-quoting/base64-portability issues.

Comment thread deploy/charts/disco-agent/values.schema.json
Comment thread deploy/charts/disco-agent/README.md
@roeezis
roeezis force-pushed the split/07-helm-chart branch from 41cb738 to 66362e7 Compare August 26, 2026 09:05
@roeezis

roeezis commented Aug 26, 2026

Copy link
Copy Markdown
Author

Added "enum": ["", "file"] — a typo now fails at helm install instead of a CrashLoopBackOff.

@roeezis

roeezis commented Aug 26, 2026

Copy link
Copy Markdown
Author

Dropped the markers — nothing regenerates this chart, and they implied otherwise. The cyberark.* fields stay hand-documented above the section, where they already were.

@roeezis
roeezis force-pushed the split/07-helm-chart branch 2 times, most recently from 6887b13 to 4e55179 Compare August 26, 2026 10:21
@roeezis
roeezis force-pushed the split/07-helm-chart branch 2 times, most recently from 83cbcaf to 286b005 Compare August 26, 2026 13:47
Exposes config.cyberark's Conjur JWT fields (serviceId, account,
jwtSource) in values.yaml/values.schema.json, and documents per-cluster
Conjur onboarding as a prerequisite in the chart README — the tenant
administrator's own Conjur Cloud credentials, no admin credential needed
at deploy time.

Drops the jwtFilePath knob: it let an operator set a path the chart's
projected-volume mount couldn't actually honor (mountPath was hardcoded
independently of it), producing a deployment that renders cleanly but
never authenticates. The agent's own DefaultTokenPath already matches
the chart's fixed mount path, so there's nothing to configure.

Gates the projected token volume on serviceId being set, not just
jwtSource (which defaults to "file") — a pure username/password install
was getting an unused audience=conjur token volume for no reason,
unnecessary surface for clusters with admission policies constraining
projected-token audiences. Factored the condition into a named template
since it's needed in two places and needs to stay in sync.

Documents that the volume's audience is fixed at conjur, not a
values.yaml setting, and that the config-validation fix in the previous
PR makes the README's "fails closed at startup" claim actually true
(previously that only held because sendSecretValues:true is the chart
default and triggers eager authenticator construction).

jwtSource now has an enum constraint in values.schema.json, so a typo
fails at `helm install` with a clear message instead of a CrashLoopBackOff
— ValidateJWTSource already rejects it at agent startup, this just moves
where the operator finds out.

Dropped the <!-- AUTO-GENERATED --> markers around the Values section:
nothing regenerates it for this chart (the repo's generate target only
covers venafi-kubernetes-agent), and the markers implied otherwise —
the cyberark.* fields are already hand-documented above, outside that
block, which the markers made look like an oversight rather than intent.
@roeezis
roeezis force-pushed the split/07-helm-chart branch from 286b005 to f4d98e9 Compare August 27, 2026 13:03
@mladen-rusev-cyberark
mladen-rusev-cyberark merged commit 42ac4e5 into jetstack:master Aug 27, 2026
5 checks passed
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.

2 participants