Writing a Kubernetes Operator — Locust Operator

Writing a Kubernetes Operator — Locust Operator

In my previous article, I discussed how two frameworks can generate the basic structure for a Kubernetes Operator. I would discuss how to build on top of the base generated by the framework, so I would go through how to build an operator with simple functionality. If you are don’t know about Kubernetes operators check out the session where I talk about operators in detail.

I will be building an operator for Locust. Locust is a framework for load testing written in python. It is easy to use and supports distributed mode for simulating a higher load. But running locust in distributed mode needs more effort and a good understanding of infrastructure.

Main functions expected from Locust Operator:

  • Deploy locust in standalone mode
  • Deploy locust in distributed mode
  • Create Kubernetes Deployments and Services
  • Number of slaves can be customized

Generate Resources

operator-sdk new locust-operator --repo=github.com/amila-ku/locust-operator

operator-sdk add api --api-version=locustload.cndev.io/v1alpha1 --kind=Locust

Defining the API of Locust custom resource.

type definitions are created under_ pkg_/_api/locustload/v1alpha1/ _in locust_types.go file, struct is already generated by operator SDK with a default value but I would replace with values for our locust operator.

locust cloud-native kubernetes load-testing kubernetes-operator

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

50+ Useful Kubernetes Tools for 2020 - Part 2

Our original Kubernetes tool list was so popular that we've curated another great list of tools to help you improve your functionality with the platform.

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

Multi-cloud Spending: 8 Tips To Lower Cost

Mismanagement of multi-cloud expense costs an arm and leg to business and its management has become a major pain point. Here we break down some crucial tips to take some of the management challenges off your plate and help you optimize your cloud spend.

Kubernetes in the Cloud: Strategies for Effective Multi Cloud Implementations

This article explains how you can leverage Kubernetes to reduce multi cloud complexities and improve stability, scalability, and velocity.

Cloud Performance Testing: Benefits and Approach - TopDevelopers.co

Learn about the benefits of Cloud Performance Testing along with the correct approaches for an effective solution, while developing web and mobile apps.