Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix note about explicit kubectl contexts in k8s backend #22040

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions docs/docs/kubernetes/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ First, activate the relevant backend in `pants.toml`:
backend_packages = [
...
"pants.backend.experimental.k8s",
...
]
```

Expand Down Expand Up @@ -104,10 +103,13 @@ pants experimental-deploy src/k8s:webpages
✓ src/k8s:webpages deployed to context kind-kind
```

note::: To prevent accidentally deploying kubernetes manifests to the wrong
cluster, the context field is required on `k8s_bundle` for deployment. For
deploying the same `k8s_bundle` to multiple contexts, consider using
`parametrize` like `k8s_bundle(..., context=parametrize("stage", "prod"))`. For
CI agents which will only have access to a single context, set the
:::note Explicitly set kubectl contexts
To prevent accidentally deploying kubernetes manifests to the wrong cluster,
the context field is required on `k8s_bundle` for deployment. For deploying the
same `k8s_bundle` to multiple contexts, consider using [`parametrize`
builtin](../using-pants/key-concepts/targets-and-build-files.mdx#parametrizing-targets)
like `k8s_bundle(..., context=parametrize("stage", "prod"))`. For CI agents
which will only have access to a single context, set the
`[kubectl].pass_context` to false in `pants.toml` to have them use their
default context.
:::