Git Product home page Git Product logo

kubernetes-http-loadbalancer's Introduction

kubernetes-http-loadbalancer

a complete working example of a HTTP loadbalancer using nginx & kubernetes.

It uses:

  • nginx-loadbalancer: nginx + confd based loadbalancer (in this case etcd is used as a backend).
  • loadbalancer-feeder: kubelistener listens to kubernetes pod events and changes etcd accordingly following our loadbalancer rules.
  • helloworld: It renders the 'Hello from <hostname>' message as a http response in order to identify if it's actually doing the load balancing.
$> etcdctl ls --recursive /lb
/lb/hosts
/lb/hosts/lisa.contoso.com
/lb/hosts/lisa.contoso.com/listeners
/lb/hosts/lisa.contoso.com/listeners/ls1 = {"protocol":"http","address":"0.0.0.0:80"}
/lb/hosts/lisa.contoso.com/locations 
/lb/hosts/lisa.contoso.com/locations/loc1 = {"path":"/","upstream":"helloworld-"}
/lb/upstreams
/lb/upstreams/helloworld-
/lb/upstreams/helloworld-/servers
/lb/upstreams/helloworld-/servers/eb636d5d-f8c0-11e4-b35e-080027520379 = {"url":"10.244.49.30:8080"}
/lb/upstreams/helloworld-/servers/eb63c855-f8c0-11e4-b35e-080027520379 = {"url":"10.244.49.31:8080"}
/lb/upstreams/helloworld-/servers/eb63e9d7-f8c0-11e4-b35e-080027520379 = {"url":"10.244.49.32:8080"}

Note: No! - is not a typo error, it's the generateName parameter if pod was created using a replication controller :-).

kubernetes-http-loadbalancer's People

Contributors

glerchundi avatar

Stargazers

小张 avatar Jono Wells avatar  avatar Olaf avatar

Watchers

James Cloos avatar  avatar thibault deheurles avatar  avatar

kubernetes-http-loadbalancer's Issues

How to set the conf data?

I setup the three pods included in the example. From my master server I manually set the /lb/hosts keys using etcdctl set ...

But how are the /lb/upstreams/helloworld- keys supposed to be set? What are the subkeys under /servers (in the example they are guids, referring to what?)

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.