Skip to content

Commit

Permalink
updated readme, to add API-KEY to secret
Browse files Browse the repository at this point in the history
Signed-off-by: Sarthak Jain <[email protected]>
  • Loading branch information
SarthakJain26 committed Aug 29, 2024
1 parent a3c571d commit b579241
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions harness-chaos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,26 @@ Next step is to create a chaos experiment and get the experiment ID to launch th
## How to run launch chaos experiment using cloud builder

Once the chaos experiment is created and we have the values for the required flags, here’s an example demonstrating how to launch and validate a chaos experiment using cloud builder. Users can pass the `--workflow-id` flag(`workflow-id` is same as experiment ID) along with the `--expected-resilience-score` flag to ensure that the actual resilience score of the experiment run meets the expected threshold, along with other necessary flags.
We recommend to store and use the API-KEY as a secret.

**Example:**
```
steps:
- name: 'gcr.io/$PROJECT_ID/harness-chaos'
args: ['generate', '--api=run-and-monitor-experiment', '--account-id=${_ACCOUNT_ID}','--org-id=${_ORG_ID}','--project-id=${_PROJECT_ID}', '--workflow-id=${_EXPERIMENT_ID}', '--expected-resilience-score=${_EXPECTED_RES_SCORE}', '--api-key=${_X_API_KEY}' ]
- name: 'gcr.io/$PROJECT_ID/harness-chaos'
secretEnv: ['API_KEY']
args: ['generate', '--api=run-and-monitor-experiment', '--account-id=${_ACCOUNT_ID}','--org-id=${_ORG_ID}','--project-id=${_PROJECT_ID}', '--workflow-id=${_EXPERIMENT_ID}', '--expected-resilience-score=${_EXPECTED_RES_SCORE}', '--api-key=$$API_KEY' ]
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/x-api-key/versions/latest
env: API_KEY
substitutions:
_ACCOUNT_ID: '<ACCOUNT_ID>'
_ORG_ID: '<ORG_ID>'
_PROJECT_ID: '<PROJECT_ID>'
_EXPERIMENT_ID: '<EXPERIMENT_ID>'
_EXPECTED_RES_SCORE: '100'
_X_API_KEY: '<X_API_KEY>' // required for authorization
```

### Flags
Expand Down

0 comments on commit b579241

Please sign in to comment.