GithubHelp home page GithubHelp logo

ads-infra-nats's Introduction

HAProxy+Kontrol pod

Overview

This project is a Docker image packaging NATS 0.9.4 together with Kontrol. It is meant to be included in a Kubernetes pod.

The container will run its own control-tier which will re-configure the routes anytime brokers are added or removed. Please note we do not allow for custom configuration settings at this point.

Lifecycle

The initial state will render the telegraf configuration and add the statsd input. The local broker logfile will be written under /data and rotated via logrotate. The state will then cycle thru one or more configuration sequences with the broker configuration written as /data/gnatsd.conf. All other brokers currently reporting via kontrol will be included in the routes. Please note the client port is TCP 4242 and the internal cluster port is TCP 4244.

Any change detected by kontrol will trip the state-machine back to that configuration state. The broker itself is restarted via supervisord.

Building the image

Pick a distro and build from the top-level directory. For instance:

$ docker build -f alpine-3.5/Dockerfile .

Manifest

Simply use this pod in a deployment and assign it to an array with external access using a node-port service to clamp onto the desired port. For instance:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: haproxy
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: nats
        role: broker
        tier: data
      annotations:
        kontrol.unity3d.com/master: nats.default.svc
        kontrol.unity3d.com/opentsdb: kairosdb.us-east-1.applifier.info

    spec:
      nodeSelector:
        unity3d.com/array: data
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: app
                    operator: In
                    values: 
                    - nats
              topologyKey: "kubernetes.io/hostname"
      containers:
       - image: registry2.applifier.info:5005/ads-infra-nats-alpine-3.5
         name: nats
         imagePullPolicy: Always
         ports:
         - containerPort: 4242
           protocol: TCP
         - containerPort: 4244
           protocol: TCP
         - containerPort: 8000
           protocol: TCP
         env:
          - name: NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace

Support

Contact [email protected] for more information about this project.

ads-infra-nats's People

Contributors

opaugam-unity 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.