Giter Club home page Giter Club logo

demoapp's Introduction

demoapp

  • This app is created to reproduce mis-balancing in HAproxytech's ingress controller. It only servs /serverId endpoint which returns a json with serverId key and a random string which is the unique identifier for that server. For example: {serverId: ABCDEF}
  • Ingress object of demoapp is configured like following:
    ingress:
      enabled: true
      className: "haproxy"
      annotations:
        haproxy.org/timeout-tunnel: "3600s"
        haproxy.org/backend-config-snippet: |
          balance url_param RouteToken check_post
      hosts:
        - host: test.demoapp
          paths:
          - path: /serverId
            pathType: Prefix
  • HAproxy is configured to balance based on url_param RouteToken

Steps to install demoapp

  1. Install HAproxy Ingress Controller with Nodeport service type

  2. Install demoapp using chart given in demoapp repository

    helm install --create-namespace --namespace demoapp demoapp path/to/chart/given/in/repo

test-ha.py

  • It is simple script that creates a hashmap serverId<->routeToken map. Here routeToken also is random string which signifies to which pod the request should endup. The hope is whenever there is RouteToken parameter in url HAproxy should always send the request to appropriate pod.
  • For example, If script creates serverid map like following:
    serverId<->routeToken
    ABC<->123
    PQR<->456
    XYZ<->789
    • Then request with url http://test.demoapp:30080/serverId?RouteToken=123 should always endup on demoapp pod with serverId=ABC. The problem it deosn't happen number when pods are very high for example 50 demoapp pods
  • There is function in test-ha.py test_serverid_mismatch which tests the above explain behaviour
  • To run the script
    python test-ha.py http://test.demoapp:<whatever-nodeport-you-have-configured>  

demoapp's People

Contributors

rash419 avatar

Stargazers

 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.