Giter Club home page Giter Club logo

rancher-demo's Introduction

Rancher/Kubernetes Demo Application

This is a Go demo application used for demonstrating Kubernetes and load balancing.

It will create a colored icon for each replica within a ReplicaSet and indicate which one most recently served a response. Replicas which haven't been heard from will begin to fade out, until after a configurable number of seconds they will disappear. This is useful for demonstrating scaling up/down or in the case of an application like Rio, for showing scale-in of an upgraded application.

Environment Variables

  • TITLE: sets title in demo app
  • SHOW_VERSION: show version of app in ui (VERSION env var)
  • REFRESH_INTERVAL: interval in milliseconds for page to refresh (default: 1000)
  • EXPIRE_INTERVAL: how long a replica can go without being seen before we remove it from the display (default: 10s)
  • REMOVE_INTERVAL: how long after EXPIRE_INTERVAL until we remove the icon (default: 20s)
  • SKIP_ERRORS: set this to prevent errors from counting (useful on janky load balancers)
  • METADATA: extra text at bottom of info area
  • COW_COLOR: what color the cow background should be (default: black). Valid options are any color from the CSS pallete, including:
    • red
    • orange
    • yellow
    • olive
    • green
    • teal
    • blue
    • violet
    • purple
    • pink
    • black

Build

docker build -t monachus/rancher-demo .

Paths

By default the loaded page will reach back to /demo every REFRESH_INTERVAL and use the returned information to update the display. Other paths are:

  • /info - returns some additional information about the replica serving the request
  • /load - adds a 2s delay to the response from /info - use this for putting artificial load on the system and watching the replicas scale

Ports

The container will listen for traffic on port 8080.

Running

  1. Edit base/configs/source-vars.yaml and set the following:
    • MY_NAMESPACE: the namespace into which the app will be deployed (default: rancher-demo). This will be created if it does not already exist.
    • URL_HOST: the hostname portion of the URL that the ingress will answer on (default: rancher-demo.cl.monach.us)
  2. Run kubectl apply -k base to deploy the application.

rancher-demo's People

Contributors

ehazlett avatar oskapt avatar ibuildthecloud avatar tobias-schaefer avatar mbentley avatar superseb avatar chrisurwin 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.