GithubHelp home page GithubHelp logo

evertonsa / allspark Goto Github PK

View Code? Open in Web Editor NEW

This project forked from banzaicloud/allspark

0.0 1.0 0.0 51 KB

AllSpark is a simple building block for quickly building web microservice deployments for demo purposes.

License: Apache License 2.0

Dockerfile 0.92% Makefile 9.24% Go 87.67% Shell 2.17%

allspark's Introduction

AllSpark

AllSpark is a simple building block for quickly building web microservice deployments for demo purposes.

It supports at most one workload and arbitary number of subsequent requests to other services that will be called on a single request.

Workload

The used workload can be set using the WORKLOAD environment variable.

Currently the following workloads are supported:

PI

Calculates PI to generate CPU and memory usage

Available options:

  • PI_COUNT - how many goroutines to use

Echo

Simply echos back a set string

Available options:

  • EHCO_STR - string to echo back

Subsequent requests

Subsequent request URLs can be set using the REQUESTS environment variable. Multiple URLs can be set and must be separated by space. A count must also be set for each URL using the following syntax: URL#count.

Example deployment

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: ratings-v1
  labels:
    app: ratings
    version: v1
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: ratings
        version: v1
    spec:
      containers:
      - name: ratings
        image: banzaicloud/allspark:0.0.2
        imagePullPolicy: Always
        ports:
        - containerPort: 9080
        env:
        - name: SERVER_LISTENADDRESS
          value: 0.0.0.0:9080
        - name: WORKLOAD
          value: Echo
        - name: ECHO_STR
          value: "ratings service response"
        - name: REQUESTS
          value: "http://analytics:8080/#1"
---
apiVersion: v1
kind: Service
metadata:
  name: ratings
  labels:
    app: ratings
    service: ratings
spec:
  ports:
  - port: 9080
    name: http
  selector:
    app: ratings
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: analytics-v1
  labels:
    app: analytics
    version: v1
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: analytics
        version: v1
    spec:
      containers:
      - name: analytics
        image: banzaicloud/allspark:0.0.2
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
        env:
        - name: WORKLOAD
          value: PI
        - name: PI_COUNT
          value: "20000"
---
apiVersion: v1
kind: Service
metadata:
  name: analytics
  labels:
    app: analytics
    service: analytics
spec:
  ports:
  - port: 8080
    name: http
  selector:
    app: analytics

allspark's People

Contributors

khernyo avatar laci21 avatar waynz0r avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.