{"id":13742714,"url":"https://github.com/dastergon/vegeta-operator","last_synced_at":"2025-03-21T23:31:33.372Z","repository":{"id":57565335,"uuid":"263023916","full_name":"dastergon/vegeta-operator","owner":"dastergon","description":"Kubernetes Operator for running HTTP load testing scenarios with Vegeta","archived":false,"fork":false,"pushed_at":"2020-05-26T11:41:51.000Z","size":73,"stargazers_count":34,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-22T14:32:22.725Z","etag":null,"topics":["benchmarking","crd","go","golang","k8s","kubernetes","kubernetes-cluster","kubernetes-operator","load-testing","operator","operator-sdk","testing-scenarios","vegeta"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dastergon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-11T11:33:13.000Z","updated_at":"2024-04-20T03:08:32.000Z","dependencies_parsed_at":"2022-09-03T12:20:48.233Z","dependency_job_id":null,"html_url":"https://github.com/dastergon/vegeta-operator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fvegeta-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fvegeta-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fvegeta-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dastergon%2Fvegeta-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dastergon","download_url":"https://codeload.github.com/dastergon/vegeta-operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221820503,"owners_count":16886185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmarking","crd","go","golang","k8s","kubernetes","kubernetes-cluster","kubernetes-operator","load-testing","operator","operator-sdk","testing-scenarios","vegeta"],"created_at":"2024-08-03T05:00:35.325Z","updated_at":"2024-10-28T11:11:26.747Z","avatar_url":"https://github.com/dastergon.png","language":"Go","funding_links":[],"categories":["Repository is obsolete"],"sub_categories":["Awesome Operators in the Wild"],"readme":"# Vegeta Operator\nA Kubernetes Operator for running load testing scenarios with [Vegeta](https://github.com/tsenart/vegeta).\n\n## Status\nThe Vegeta Operator is currently in **alpha**.\n\n## Description\n[Vegeta](https://github.com/tsenart/vegeta) is an HTTP load testing tool and library. The Vegeta [Operator](https://coreos.com/blog/introducing-operators.html) provides an API to make it easy to deploy and run load testing scenarios in Kubernetes.\n\n## Overview\n\nThe Operator supports most of the [current](https://github.com/tsenart/vegeta#usage-manual) features of Vegeta, and it also has the ability to store the generated reports to a remote blob storage system (bucket) via [rclone](https://rclone.org/). By default, Vegeta returns the generated report to the `stdout`. Consequently, you need to specify the output (filename) and the blob storage destination explicitly via the Custom Resource. Check the [CRD](deploy/crds/vegeta.dastergon.gr_vegeta_crd.yaml) spec for more options.\n\nVegeta runs as a [Job](https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/). Therefore, once it's done running the load testing scenario, no more Pods are created but the Pods are not deleted either. They are kept around in case we want to view(`kubectl logs`) the logs of completed pods. However, any local files (reports) inside the container are deleted once the Job is complete. To address this situation, there's support to store the generated report to remote blob storage of a cloud provider.\n\n## Notes\n\n* Currently, the remote storage feature supports AWS S3 only. Feel free to submit pull requests to support more blob storage systems.\n* The `rclone` tool is configured to authenticate to the blob storage system via environment variables of a specific format. Check its supported [format](https://rclone.org/docs/#config-file) first.\n\n## Prerequisites\n\n* Go \u003e= v1.13+.\n* Kubernetes \u003e= 1.13+.\n\n## Quick Start\n\nBefore running the operator, the Custom Resource Definition (CRD) must be registered with the Kubernetes apiserver:\n\n    $ kubectl create -f deploy/crds/vegeta.dastergon.gr_vegeta_crd.yaml\n\nOnce this is done, there are two options to run the operator:\n\n1. Locally\n2. In the Kubernetes cluster\n\n### Running locally\n\nTo run the Operator locally for development or testing, we use the [operator-sdk](https://github.com/operator-framework/operator-sdk).\n\n#### Prerequisites:\n\n* kubectl\n* [operator-sdk](https://github.com/operator-framework/operator-sdk) installed\n* [kind](https://github.com/kubernetes-sigs/kind) or [minikube](https://github.com/kubernetes/minikube)\n\nDespite the fact that both `kind` and`minikube` automatically set the context, make sure that you are in the desired context and change it if it's not the intended one.\n\nYou can use a specific `kubeconfig` via the flag `--kubeconfig=\u003cpath/to/kubeconfig\u003e`.\n\nIn the terminal we execute:\n\n    $ operator-sdk run --local --watch-namespace=\u003cnamespace\u003e\n\nThen, we proceed with the steps as in any other cluster.\n\n###  Running it in the Kubernetes cluster\n\nThe Deployment manifest is generated at`deploy/operator.yaml`. If you want to use an image other than the one available in the registry,  make sure to update the image field.\n\nSetup RBAC and deploy the vegeta-operator:\n\n    $ kubectl create -f deploy/service_account.yaml\n    $ kubectl create -f deploy/role.yaml\n    $ kubectl create -f deploy/role_binding.yaml\n    $ kubectl create -f deploy/operator.yaml\n\nTo verify that the operator is up and running:\n\n    $ kubectl get deployment\n\n### Custom Resource Examples\n\nThe following snippets are some examples of the custom resource. For `target`, put your desired endpoint.\n\nThe following snippet shows how to execute a load testing scenario of a duration of 1 second and generate the report in JSON format. By default, it's a binary format.\n\n```yaml\napiVersion: vegeta.dastergon.gr/v1alpha1\nkind: Vegeta\nmetadata:\n  name: example-vegeta\nspec:\n  target: \"http://10.96.146.172:9876/info\"\n  attack:\n    duration: 1s\n    report:\n      type: json\n```\n\nThe following examples shows how to execute a load testing scenario with 100 requests per second:\n\n```yaml\napiVersion: vegeta.dastergon.gr/v1alpha1\nkind: Vegeta\nmetadata:\n  name: example-vegeta\nspec:\n  target: \"http://10.96.146.172:9876/info\"\n  attack:\n    duration: 1s\n    rate: 100/1s\n    report:\n      type: json\n```\n\nThe following snippet shows how to execute a load testing scenario and store the report in JSON format to an AWS S3 bucket.\nFor **production** use it's highly recommended to use [Secrets](https://kubernetes.io/docs/concepts/configuration/secret/).\n\n```yaml\napiVersion: vegeta.dastergon.gr/v1alpha1\nkind: Vegeta\nmetadata:\n  name: example-vegeta\nspec:\n  target: \"http://10.96.146.172:9876/info\"\n  attack:\n    duration: 1s\n    report:\n      output: report.json\n      type: json\n  blobStorage:\n    name: bucketname\n    provider: aws\n    env:\n    - name: RCLONE_CONFIG_S3_TYPE\n      value: s3\n    - name: RCLONE_CONFIG_S3_ACCESS_KEY_ID\n      value: XXXX\n    - name: RCLONE_CONFIG_S3_SECRET_ACCESS_KEY\n      value: YYYY\n    - name: RCLONE_CONFIG_S3_REGION\n      value: eu-central-1\n```\n\nTo apply the custom resource, use `kubectl`:\n\n    kubectl apply -f \u003cfile\u003e.yaml\n\nTo check the progress of the execution run `kubectl get pods --watch`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdastergon%2Fvegeta-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdastergon%2Fvegeta-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdastergon%2Fvegeta-operator/lists"}