From b579241874534ee7d8291705671986bf11734fbd Mon Sep 17 00:00:00 2001 From: Sarthak Jain Date: Thu, 29 Aug 2024 18:38:15 +0530 Subject: [PATCH] updated readme, to add API-KEY to secret Signed-off-by: Sarthak Jain --- harness-chaos/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/harness-chaos/README.md b/harness-chaos/README.md index 453b9e54..7c94a989 100644 --- a/harness-chaos/README.md +++ b/harness-chaos/README.md @@ -21,12 +21,19 @@ 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: '' @@ -34,7 +41,6 @@ substitutions: _PROJECT_ID: '' _EXPERIMENT_ID: '' _EXPECTED_RES_SCORE: '100' - _X_API_KEY: '' // required for authorization ``` ### Flags