Coder Social home page Coder Social logo

fizzbuzz-kube's Introduction

FizzBuzz in Kubernetes

A distributed, fault-tolerant, production-ready FizzBuzz implementation for the microservice cloud.

example.gif

Run the FizzBuzz

Dependencies:

  • aws cli (pip install --upgrade --user awscli)
  • jq (brew install jq)
  • kops (brew install kops)
  • kubectl (brew install kubectl)
  • An existing Route53 Hosted Zone that is correctly serving DNS queries.
    • Easiest way to do this is simply set up a Hosted Zone for a subdomain already handled in Route53. Something like cluster.example.com.
  • aws cli must be authenticated with a user that has the following group policies
    • arn:aws:iam::aws:policy/AmazonEC2FullAccess
    • arn:aws:iam::aws:policy/AmazonRoute53FullAccess
    • arn:aws:iam::aws:policy/AmazonS3FullAccess
    • arn:aws:iam::aws:policy/IAMFullAccess
    • arn:aws:iam::aws:policy/AmazonVPCFullAccess

Then, finally,

./bin/get-programming-job.sh cluster.example.com

What Happens

  • Create an S3 bucket to store the kops state,
  • Create a multi-zone Kubernetes cluster using kops,
  • Wait for the cluster to spin up and schedule pods,
  • Deploy an ElasticSearch StatefulSet,
  • Deploy a fluentd DaemonSet running a pod on each node in the cluster which forwards logs to ElasticSearch for indexing,
  • Deploy a 100-replica StatefulSet of the fizzbuzzer container, which accepts a StatefulSet hostname (fizzbuzzer-n) as an argument and computes whether or not it should output Fizz, Buzz, FizzBuzz, or n.
  • Waits for all of those pods to have spun up and then,
  • Queries the ElasticSearch Search API to collect all of the logs from the fizzbuzzer pods,
  • Outputs the result of the FizzBuzz,
  • Tears everything down (cluster, s3 bucket)

Why

Someone had to.

Issues

Occasionally there are DNS and connectivity issues, but I'm just going to ignore them because I've spent enough time on this as it is and it works most of the time.

fizzbuzz-kube's People

Contributors

shrugs avatar

Watchers

Mhd Sami Al Mouhtaseb avatar satnami-bot 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.