From 46d2a121457909388ad854773e22631ce6541a4f Mon Sep 17 00:00:00 2001 From: Atulpriya Sharma Date: Tue, 10 Sep 2024 13:34:42 +0530 Subject: [PATCH] Add ArgoCD example --- ArgoCD/README.md | 24 ++++++++++++++++++++++++ ArgoCD/basic-k6.yaml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 ArgoCD/README.md create mode 100644 ArgoCD/basic-k6.yaml diff --git a/ArgoCD/README.md b/ArgoCD/README.md new file mode 100644 index 0000000..a62477f --- /dev/null +++ b/ArgoCD/README.md @@ -0,0 +1,24 @@ +# K6 Test Workflow with ArgoCD + +This folder contains a K6 test workflow file, `basic-k6.yaml` which automates running K6 load tests in your environment. We will use this repo as part of and ArgoCD application. + +## Folder Contents + +- `basic-k6.yaml`: The K6 test workflow file for aload testing. + +## Prerequisites + +Before setting up the workflow, ensure you have the following: + +- ArgoCD installed and configured in your Kubernetes cluster. +- Testkube installed and configured in your Kubernetes cluster. + +## Steps to Configure + +Follow these steps to set up and configure the K6 test workflow with ArgoCD: + +1. Clone this repository to your local machine. +2. Create a new ArgoCD application for the K6 test workflow - *this allows ArgoCD to track the test.yaml file and deploy the workflow to your Kubernetes cluster*. +3. After the application is created, sync it with your repository to deploy the workflow. +4. Monitor the deployment using ArgoCD’s web UI or CLI. +5. Once the workflow is deployed, you can trigger the test workflow using testkube cli or dashboard. diff --git a/ArgoCD/basic-k6.yaml b/ArgoCD/basic-k6.yaml new file mode 100644 index 0000000..1f590e4 --- /dev/null +++ b/ArgoCD/basic-k6.yaml @@ -0,0 +1,35 @@ +kind: TestWorkflow +apiVersion: testworkflows.testkube.io/v1 +metadata: + name: basic-k6-workflow + namespace: testkube + labels: + docs: example +spec: + content: + files: + - path: /data/example.js + content: |- + import http from 'k6/http'; + import { sleep } from 'k6'; + export default function () { + http.get('https://test.k6.io'); + sleep(1); + }; + steps: + - name: Run Tests + workingDir: /data + run: + image: grafana/k6:0.49.0 + env: + - name: K6_WEB_DASHBOARD + value: "true" + - name: K6_WEB_DASHBOARD_EXPORT + value: k6-test-report.html + args: + - run + - example.js + artifacts: + paths: + - k6-test-report.html +status: {} \ No newline at end of file