Code Monkey home page Code Monkey logo

straw's Introduction

Straw

==========================

Straw is an etcdshim that consume event from transport instead of etcd. Which enable your Kubernetes to List/Watch resources through the straw.

Implements

  • Runs an informer to consume(List/Watch) resources from a transport
  • Implements an etcdshim to translate the transport to etcd API
  • Initializes a Provider to send data to the transport
    1. List and watch resources from etcd to local cache
    2. Send resources from the cache to transport
    3. Resend cache data to transport periodically

One more step

Build a multi-cluster management prototype based on the above implementation. It can achieve the following goals: resync

  • Deploy a resource(deployment) on the cluster1 namespace of hub
  • The resource(deployment) is propagated to cluster1 by transport
  • Report the resource status(deployment.Status.AvailableReplicas) on cluster1 to hub(add an AvailableReplicas annotation to the original deployment) through transport

Demo

Start a MQTT Protocol

To run a sample MQTT broker using docker:

docker run -it --rm --name mosquitto -p 1883:1883 eclipse-mosquitto:2.0 mosquitto -c /mosquitto-no-auth.conf
# with config
# docker run -it --rm --name mosquitto -p 1883:1883 -v `pwd`/resource/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto

Watch Secret by the Transport

# Build binary
make build

# reflector from hub

 ./bin/reflector --broker 127.0.0.1:1883 --client-id hub-cluster-id --send-topic /event/signal --receive-topic /event/payload

References

straw's People

Contributors

yanmxa avatar

Watchers

 avatar  avatar

straw's Issues

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.