Giter Site home page Giter Site logo

flagger's Introduction

Flagger

Flagger aims to be a simple feature flag management system.

Goals

  • To allow users to sign-up.
  • To allow users to authenticate in to the system.
  • To allow authenticated users to create projects, environments and flags.
  • To allow authenticated users to toggle the status of the flag i.e. on or off.
  • To allow applications to fetch the current status of the provided flag.

Tech Stack

Flagger is built using the Go programming language, MongoDB for database, Redis as the cache, and GRPC for communications.

Development

Flagger requires Docker and Kubernetes for running.

  1. Copy the sample env files sample.env and secret_sample.env files to k8s/base using:

    cp sample.env k8s/base/.env
    cp secret_sample.env k8s/base/.env.secret

    Once copied enter the values for the variables in k8s/base/.env.secret.

  2. Start a Kubernetes cluster on your machine. I've used minikube and so the instructions here are going to be with reference to minikube. Start a minikube cluster using:

    minikube start
  3. Set up the Docker environment for minikube using:

    eval $(minikube docker-env)

    This will allow us to build the images directly into minikube.

  4. To build the development image, run:

    make build-dev
  5. [Optional] To build the debug image, run:

    make build-debug
  6. To start the application in development mode, run:

    kubectl apply -k k8s/overlays/dev
  7. [Optional] To start the application in debug mode, run:

    kubectl apply -k k8s/overlays/debug
  8. When the application first starts the API server will not be able to run as MongoDB replicaset has not been setup up yet. To do so first, we to spin up a new MongoDB pod using:

    kubectl run mongo --image mongo --rm -it -- bash
  9. After a bash session has started, connect to the primary MongoDB instance using:

    mongosh mongodb://mongo-0.mongo-hlsvc
  10. Initiate the replicaset using the following mongosh command:

    rs.initiate({
        _id: "rs0",
        members: [
            { _id: 0, host: "mongo-0.mongo-hlsvc" },
            { _id: 1, host: "mongo-1.mongo-hlsvc" },
            { _id: 2, host: "mongo-2.mongo-hlsvc" },
        ],
    });
  11. The replicaset will take a little while to initiate. The status of the replicaset can be checked using the following mongosh command:

    rs.status();

    Once you see one primary server and 2 secondary servers, you are ready to go.

  12. Now, just wait for the API server to restart automatically and every thing should work.

  13. To make requests to the API, you'll first need to get the IP of minikube using:

    minikube ip
  14. Next you'll need the port on which the API server is running. To get that run:

    kubectl get service/api-server

    The port that you need will be mapped under the "PORT(S)" column.

  15. Now you can make requests to the service on the IP $(minikube ip):<PORT>.

Note: Once you delete your local minikube cluster, you'll have to repeat steps 7 through 11 to setup the replicaset.

Tearing down

To stop the all the deployed units in the cluster, run:

kubectl delete -k k8s/overlays/<overlay>

Here, replace <overlay> with the overlay used to deploy units.

To delete all resources started by minikube, run:

minikube delete

flagger's People

Contributors

dependabot[bot] avatar waduhek 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.