Skip to content
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

Add ArgoCD example #10

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: {}
Loading