Skip to content

Commit

Permalink
Merge pull request #10 from kubeshop/argocd-testworkflow
Browse files Browse the repository at this point in the history
Add ArgoCD example
  • Loading branch information
techmaharaj authored Sep 10, 2024
2 parents aaf1215 + 46d2a12 commit cc65d9a
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ArgoCD/README.md
Original file line number Diff line number Diff line change
@@ -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.
35 changes: 35 additions & 0 deletions ArgoCD/basic-k6.yaml
Original file line number Diff line number Diff line change
@@ -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: {}

0 comments on commit cc65d9a

Please sign in to comment.