Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 181
Provide agent context for ACS deployments with roxie #21407
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
Open
mclasmeier
wants to merge
2
commits into
master
Choose a base branch
from
mc/agent-context-roxie
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+289
−93
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.4.1 | ||
| 0.4.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # Deploying StackRox/ACS with roxie | ||
|
|
||
| This file describes the "roxie" deployment tool for deploying StackRox/ACS. | ||
|
|
||
| The tool roxie (https://github.com/stackrox/roxie) is the primary deployment tool | ||
| for StackRox/ACS development. | ||
| It should be leveraged for requests to deploy StackRox/ACS by default and you, | ||
| the agent, should be able to assist with questions about roxie and its usage. | ||
|
|
||
| Usage of the old deployment scripts should only be suggested if explicitly asked | ||
| to use those. In this case, suggest to the user to contact the ACS Install team | ||
| in case the roxie based deployment flow is lacking certain features for the user. | ||
|
|
||
| If the information in this directory is not sufficient, use WebFetch on https://raw.githubusercontent.com/stackrox/roxie/main/README.md | ||
| to retrieve the most up-to-date documentation for roxie. | ||
|
|
||
| ## Installation | ||
|
|
||
| See @deploy/README.md, specifically the section "Installation" for installation instructions. | ||
| The section also briefly describes the roxie backend supported by the `deploy/deploy.sh` shell | ||
| script and enabled with `USE_ROXIE_DEPLOY=true`. You should be aware of this feature, but don't | ||
| prominently suggest its usage. It is much better to install roxie on your system or -- | ||
| alternatively -- use `scripts/roxie.sh`, a wrapper that downloads roxie automatically. | ||
|
|
||
| ## Usage | ||
|
|
||
| See @deploy/README.md, specifically the section "Usage" for documentation on how to use roxie. | ||
| The config file schema described there might not be 100% up-to-date. To see the latest config struct, use WebFetch on https://raw.githubusercontent.com/stackrox/roxie/main/internal/deployer/config.go. | ||
|
|
||
| ## Non-interactive mode (important for agents) | ||
|
|
||
| roxie's default interactive mode spawns a sub-shell after deployment, which agents cannot use. | ||
| When invoking roxie, always use `--envrc <path>` to write the post-deployment environment | ||
| (endpoint URL, admin password, etc.) to a file instead. Use a temporary file path, e.g. | ||
| `--envrc /tmp/roxie-envrc-central.sh`. | ||
|
|
||
| After deployment: | ||
| 1. Tell the user the envrc file path and show its contents. | ||
| 1. For subsequent roxie commands that depend on this environment (e.g. deploying a secured cluster | ||
| after central), source the envrc file before running the command: | ||
| `source /tmp/roxie-envrc-central.sh && roxie deploy securedcluster ...` | ||
|
|
||
| Note, in case the human user is intending to deploy in interactive mode, it is perfectly fine | ||
| to suggest roxie commands without `--envrc`. The interactive sub-shell might be useful for the user. | ||
| Using the non-interactive mode with `--envrc` is useful in automated flows or when an agent | ||
| is tasked with deploying ACS. | ||
|
|
||
| ## Examples | ||
|
|
||
| Here are some complete examples: | ||
| ``` | ||
| roxie deploy --tag 4.11.0 --envrc /tmp/roxie-<some random identifier>.envrc | ||
| ``` | ||
|
|
||
| This deploys both components, Central and SecuredCluster (besides the operator). | ||
| To interact with central, load the generated envrc file. After that `roxctl` and `roxcurl` can be | ||
| used without further setup. | ||
|
|
||
| After use, the deployment can be torn down using | ||
| ``` | ||
| roxie teardown | ||
| ``` | ||
|
|
||
| This command tears down Central and SecuredCluster. If you also want to tear down the operator, | ||
| use `roxie teardown all`. | ||
|
|
||
| Usually one can rely on roxie managing the operator under the hood, it doesn't need to be explicitly | ||
| torn down or reinstalled. | ||
|
|
||
| When roxie succeeds (exit code 0), it can be assumed that the deployment succeeded. | ||
| For extra verification, `kubectl` can be used for checking deployment health. | ||
|
|
||
| When roxie deploys with `earlyReadiness: true` (default), roxie only waits until the deployments | ||
| "central" and/or "sensor" are ready. If `earlyReadiness: false` is used, roxie waits for all | ||
| workloads to be ready. Hence, it is normal that, by default, not all deployments are ready when | ||
| roxie returns. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| ## Crafting configs and invocations | ||
|
|
||
| You should be able to craft roxie deployment configs and roxie deployment invocations for the user, | ||
| based on the referenced documentation in the README.md. In particular, keep in mind that the | ||
| `--set` flag and the YAML paths `central.spec`/`securedCluster.spec` can be used for crafting | ||
| very specific custom resources for a given development or testing use-case. | ||
|
|
||
| Also note that this `spec`-patching mechanism can also be combined with the `spec.overlays` feature | ||
| of the Central and the SecuredCluster custom resource definitions. This allows not only patching the | ||
| CR specs, but even patching the operand resources after the Helm rendering. For example, the config | ||
|
|
||
| ```yaml | ||
| roxie: | ||
| version: 4.11.0 | ||
|
|
||
| central: | ||
| namespace: stackrox | ||
| resourceProfile: auto | ||
| spec: | ||
| overlays: | ||
| - apiVersion: apps/v1 | ||
| kind: Deployment | ||
| name: central | ||
| patches: | ||
| - path: spec.template.spec.containers[name:central].image | ||
| value: quay.io/custom-repo/main:4.12.x-123-g12ab5ae408 | ||
| ``` | ||
|
|
||
| can be used for deploying ACS 4.11.0 while replacing the main image for the central deployment. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You can’t perform that action at this time.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Don't print the envrc or pin it to a shared
/tmpname.--envrccarries credentials, so telling the agent to show the file contents leaks secrets. The fixed/tmp/roxie-envrc-central.shexample is also reusable; use a unique temp file (for example viamktemp) and only report the path.🔧 Safer shape
🤖 Prompt for AI Agents