Skip to content

Document safe credential handling in troubleshoot specs - #4418

Open
banjoh wants to merge 7 commits into
mainfrom
evansmungai/sc-139336/docs-examples-showing-env-on-runpod-let-alone
Open

Document safe credential handling in troubleshoot specs#4418
banjoh wants to merge 7 commits into
mainfrom
evansmungai/sc-139336/docs-examples-showing-env-on-runpod-let-alone

Conversation

@banjoh

@banjoh banjoh commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

The docs had no example of runPod with env, let alone env.valueFrom.secretKeyRef — currently the only non-literal way to get a credential into a collector on KOTS.

Story: sc-139336

Preview

Changes

  • New examples of runPod with env.valueFrom.secretKeyRef, for support bundles (support-bundle-examples.mdx) and preflights (preflight-defining.mdx#credentials).
  • Placeholders instead of real-looking credentials in the Redis/MySQL and modular spec examples: my-secret-pw, default:replicated, default:password<PASSWORD>.
  • Warnings where there were none: a rendered collector spec is deployed to the cluster and can be collected back into a support bundle in plain text, and Helm template functions and KOTS config options do not prevent that. The docs previously stated that a template function avoided exposing the credential; that sentence was removed in May 2026 and nothing replaced it.
  • New guidance on using a credential in a preflight check: recommends a pre-existing Secret, since a Secret created by the application's own chart is not available when preflight checks run — including when annotated helm.sh/hook: pre-install. On Embedded Cluster v3, an extension chart can create the Secret, because extensions.helmCharts[].values supports Replicated template functions and a config screen password can be templated in. Embedded Cluster v2 has no template function support in its Config, so the recommendation there is a support bundle after the install completes.

Not covered

The redactor reference still shows values: redaction without noting that the redactor spec is itself plain text, and preflight-support-bundle-about still lists passwords and database connection strings as automatically redacted without qualification. Both need the actual redact.go coverage confirmed before the claims are rewritten.

The underlying gap is that troubleshoot.sh/v1beta2 has no non-literal credential form for the database collectors, which is a product issue rather than a docs one.

Testing

npm run build passes, with no broken links or anchors on any changed page.

Adds a support bundle example that passes a credential to a runPod
collector via a Secret reference, and warns against literal credentials
in collector specs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@banjoh
banjoh requested a review from a team as a code owner August 24, 2026 19:13
@netlify

netlify Bot commented Aug 24, 2026

Copy link
Copy Markdown

Deploy Preview for replicated-docs ready!

Name Link
🔨 Latest commit 0f5ef29
🔍 Latest deploy log https://app.netlify.com/projects/replicated-docs/deploys/6a8e964aa367c40008c79862
😎 Deploy Preview https://deploy-preview-4418--replicated-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 24, 2026

Copy link
Copy Markdown

Deploy Preview for replicated-docs-upgrade ready!

Name Link
🔨 Latest commit 0f5ef29
🔍 Latest deploy log https://app.netlify.com/projects/replicated-docs-upgrade/deploys/6a8e964a84f91c00085f5861
😎 Deploy Preview https://deploy-preview-4418--replicated-docs-upgrade.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@replicated-ci replicated-ci added type::docs Improvements or additions to documentation type::feature labels Aug 24, 2026
@banjoh
banjoh marked this pull request as draft August 24, 2026 19:13
banjoh and others added 5 commits August 25, 2026 23:46
Replaces real-looking credentials in the Redis, MySQL, and modular spec
examples with placeholders, and adds an admonition to the support bundle
and preflight examples noting that Helm template functions and KOTS
config options do not protect a credential in a collector uri.

Also demotes the runPod secretKeyRef example to a subsection of the
existing runPod section.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds a section to preflight-defining covering runPod with
env.valueFrom.secretKeyRef, the requirement that the Secret already
exist when preflights run, and the two ways to meet it.

Replaces the previous guidance to avoid credentialed collectors in
preflight checks, which offered no alternative.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Promotes the customer-supplied existing Secret from one of two options
to the recommended design, and notes that a pre-install Helm hook does
not make a chart-created Secret available to preflight checks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Uses literal placeholder values for the host, user, database, namespace,
and Secret name so the example does not template values into a preflight
spec.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Only v3 supports Replicated template functions in
extensions.helmCharts[].values, so only v3 can template a
user-provided password into a Secret created by an extension.

For v2, recommend a support bundle after the install completes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@banjoh
banjoh force-pushed the evansmungai/sc-139336/docs-examples-showing-env-on-runpod-let-alone branch from 8ccfe6e to 61e26ff Compare August 26, 2026 07:20
The support bundle section said the secretKeyRef pattern does not apply
to preflight checks, which contradicts the preflight section that shows
exactly that pattern. The real constraint is that the Secret must
already exist when preflight checks run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@banjoh banjoh changed the title Add runPod example using env.valueFrom.secretKeyRef Document safe credential handling in troubleshoot specs Aug 26, 2026
@banjoh
banjoh marked this pull request as ready for review August 26, 2026 07:38
@seanoseanohay

Copy link
Copy Markdown
Contributor

docs/vendor/support-bundle-examples.mdx line 113:

"This pattern does not apply to preflight checks, which run before the application is deployed. For more information, see Define preflight checks (/vendor/preflight-defining)."

docs/vendor/preflight-defining.mdx line 77:

"To check a credentialed resource without exposing the credential, use a runPod collector and pass the credential to the Pod with env.valueFrom.secretKeyRef. The kubelet resolves the credential when the Pod starts, so the credential never appears in the spec."

To me one says the secretKeyRef pattern does not apply to preflights. The other is a how-to for using that same pattern in a preflight. Those two can’t both be true.

@seanoseanohay

Copy link
Copy Markdown
Contributor

docs/vendor/support-bundle-examples.mdx line 113:

"This pattern does not apply to preflight checks, which run before the application is deployed. For more information, see Define preflight checks (/vendor/preflight-defining)."

docs/vendor/preflight-defining.mdx line 77:

"To check a credentialed resource without exposing the credential, use a runPod collector and pass the credential to the Pod with env.valueFrom.secretKeyRef. The kubelet resolves the credential when the Pod starts, so the credential never appears in the spec."

To me one says the secretKeyRef pattern does not apply to preflights. The other is a how-to for using that same pattern in a preflight. Those two can’t both be true.

Discussed offline and fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type::docs Improvements or additions to documentation type::feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants