All Projects → lotusload → Lotus

lotusload / Lotus

Licence: mit
Kubernetes controller for running load testing

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Lotus

Mycontroller V1 Legacy
The Open Source Controller
Stars: ✭ 135 (+46.74%)
Mutual labels:  automation, controller
carvel-secretgen-controller
secretgen-controller provides CRDs to specify what secrets need to be on Kubernetes cluster (to be generated or not)
Stars: ✭ 54 (-41.3%)
Mutual labels:  controller, k8s
Controllerx
Create controller-based automations with ease to control your home devices and scenes.
Stars: ✭ 141 (+53.26%)
Mutual labels:  automation, controller
Apisix Ingress Controller
ingress controller for K8s
Stars: ✭ 139 (+51.09%)
Mutual labels:  controller, k8s
K3sup
bootstrap Kubernetes with k3s over SSH < 1 min 🚀
Stars: ✭ 4,012 (+4260.87%)
Mutual labels:  automation, k8s
Arkade
Open Source Kubernetes Marketplace
Stars: ✭ 2,343 (+2446.74%)
Mutual labels:  automation, k8s
Tower Operator
DEPRECATED: This project was moved and renamed to: https://github.com/ansible/awx-operator
Stars: ✭ 87 (-5.43%)
Mutual labels:  automation, k8s
Gardener
Kubernetes-native system managing the full lifecycle of conformant Kubernetes clusters as a service on Alicloud, AWS, Azure, GCP, OpenStack, EquinixMetal, vSphere, MetalStack, and Kubevirt with minimal TCO.
Stars: ✭ 2,093 (+2175%)
Mutual labels:  controller, k8s
Kubewebhook
Go framework to create Kubernetes mutating and validating webhooks
Stars: ✭ 275 (+198.91%)
Mutual labels:  controller, k8s
bilrost
Kubernetes controller/operator to set up OAUTH2/OIDC security on any ingress based service
Stars: ✭ 17 (-81.52%)
Mutual labels:  controller, k8s
Kubernetes Pfsense Controller
Integrate Kubernetes and pfSense
Stars: ✭ 100 (+8.7%)
Mutual labels:  controller, k8s
Admiral
Admiral provides automatic configuration generation, syncing and service discovery for multicluster Istio service mesh
Stars: ✭ 323 (+251.09%)
Mutual labels:  automation, k8s
Community.kubernetes
Kubernetes Collection for Ansible
Stars: ✭ 214 (+132.61%)
Mutual labels:  automation, k8s
kube-code-generator
Kubernetes code generator docker image
Stars: ✭ 60 (-34.78%)
Mutual labels:  controller, k8s
Ingressmonitorcontroller
A Kubernetes controller to watch ingresses and create liveness alerts for your apps/microservices in UptimeRobot, StatusCake, Pingdom, etc. – [✩Star] if you're using it!
Stars: ✭ 306 (+232.61%)
Mutual labels:  controller, k8s
Kooper
Kooper is a simple Go library to create Kubernetes operators and controllers.
Stars: ✭ 388 (+321.74%)
Mutual labels:  controller, k8s
Nps
NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
Stars: ✭ 1,285 (+1296.74%)
Mutual labels:  automation
Patrowlhears
PatrowlHears - Vulnerability Intelligence Center / Exploits
Stars: ✭ 89 (-3.26%)
Mutual labels:  automation
Flexget
The official FlexGet repository
Stars: ✭ 1,279 (+1290.22%)
Mutual labels:  automation
Shortcuts Js
A JavaScript iOS 12 Shortcuts creator
Stars: ✭ 1,278 (+1289.13%)
Mutual labels:  automation

Lotus PRs Welcome MIT Licensed

Lotus is a Kubernetes controller for running load testing. Lotus schedules & monitors the load test workers, collects & stores the metrics and notifies the test result.

Once installed, Lotus provides the following features:

  • GRPC and HTTP support
  • Ability to write the scenario by any language you want
  • Automation-friendly
    • Checks (like asserts, fails in normal test) for easy and flexible CI configuration
    • Test is configured by using declarative Kubernetes CRD for version control friendliness
  • Flexible metrics storage and visualization
    • Ability to view visualized time series by Grafana
    • Ability to persist time series data to a long-term storage like GCS or S3
    • Ability to notify and store the result summary to multiple receivers: GCS, Slack, Logger...

I am thinking about adding a feature that helps us determine the maximum number of users (requests) the target services can handle. This can be done by automatically running the load tests with the number of virtual users increasing gradually until one of the checks fails. Or a feature that helps us determine the needed resources of the target services so that they can handle the given number of users. more

Installation

Firstly, you need to install Lotus controller on your Kubernetes cluster to start using. Lotus requires a Kubernetes cluster of version >=1.9.0.

The Lotus controller can be installed either by using the helm chart or by using Kubernetes manifests directly. (Using the helm chart is recommended.)

helm install --name lotus ./install/helm

See install for more details.

Running Lotus

We have 2 steps to start running a load test:

  • Writing a load test scenario
  • Writing a Lotus CRD configuration

1. Writing a load test scenario

Theoretically, you can write your scenarios by using any language you like. The only thing you need to have is a metrics exporter for Prometheus.

In the case of Golang, I have already prepared some util packages (e.g. metrics, virtualuser) that help you write your scenarios faster and easier.

  • Expose a metrics server in your scenario's main.go
import "github.com/lotusload/lotus/pkg/metrics"

m, err := metrics.NewServer(8081)
if err != nil {
    return err
}
defer m.Stop()
go m.Run()
  • In case you want to send gRPC's rpcs to your load server, let's set grpcmetrics.ClientHandler as the StatsHandler of your gRPC connection.
grpc.Dial(
    grpc.WithStatsHandler(&grpcmetrics.ClientHandler{}),
)
  • In case you want to send HTTP requests to your load server, let's use the Transport from httpmetrics package.
http.Client{
    Transport: &httpmetrics.Transport{},
}
  • That is all. Now let's build your scenario image and publish to your container registry.

2. Writing a Lotus CRD configuration

apiVersion: lotus.lotusload.com/v1beta1
kind: Lotus
metadata:
  name: simple-scenario-12345                                  // The unique testID
spec:
  worker:
    runTime: 10m                                               // How long the load test will be run
    replicas: 15                                               // How many workers should be created
    metricsPort: 8081                                          // What port number should be used to collect metrics
    containers:
      - name: worker
        image: your-registry/your-worker-image                 // The scenario image you published above
        ports:
          - name: metrics
            containerPort: 8081
  checks:                                                      // You can add some checks to be checked while running
    - name: GRPCHighErrorRate
      expr: lotus_grpc_client_failure_percentage > 10
      for: 30s

Then apply this file to your Kubernetes cluster. Lotus will handle this test for you.

See crd-configurations.md for all configurable fields.

See examples for more examples.

Outputs

  • Test summary

Lotus collects the metrics data and evaluates the checks to build a summary result for each test. Lotus can be configured to upload this summary file to external services (e.g: GCS, Slack...) or to log into stdout. 3 formats of the summary file are supported: Text, Markdown, JSON.

TestID:        test-scenario-12345
TestStatus:    Succeeded
Start:         09:02:59 2018-12-03
End:           09:12:59 2018-12-03

MetricsSummary:

1. Virtual User
  - Started:             1M
  - Failed:              0

2. GRPC
  - RPCTotal:            25M
  - FailurePercentage:   2.507

GroupByMethod:
                        RPCs      Failure%  Latency   SentBytes  RecvBytes

  - helloworld.Hello    12.5M     1.015     105       15        8
  - helloworld.Profile  12.5M     1.415     152       8         256
  - all                 25M       1.207     135       12        245

Grafana: http://localhost:3000/dashboard/db/grpc?from=1543827779598&to=1543828379598
  • Grafana dashboards

To be able to fully explore and understand your test, Lotus is providing some Grafana dashboards to view the visualizations of the metrics. You can also set up Lotus to persist the time series data to a long-term storage (GCS or S3) for accessing after the test is deleted.

  • Test Status

After applying the Lotus CRD to your Kubernetes cluster you can also use the following command to check the status of your test.

kubectl describe Lotus your-lotus-name

Your test can be one of these status: Pending, Preparing, Running, Cleaning, FailureCleaning, Failed, Succeeded

Examples

Please checkout /examples directory that contains some prepared examples.

FAQ

Refer to FAQ.md

Development

Refer to development.md

LICENSE

Lotus is released under the MIT license. See LICENSE file for the details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].