Giter Site home page Giter Site logo

sltd's Introduction

sltd

Build Status Docker Repository on Quay GitHub release

Tag ELB from service label in kubernetes cluster for Datadog monitoring. Service Label to Tag by Daemon = sltd

  • kube_namespace filter in Metrics Explorer

example

  • Kubernetes with ELB requests and status in Dashboard

example

  • Dashboard with 2XX / request_count

example

"q": "100 * sum:aws.elb.httpcode_backend_2xx{$pod,$replication_controller,$namespace,$cluster,$scope,$kube_name,$kube_deployment}.as_count() / sum:aws.elb.request_count{$pod,$replication_controller,$namespace,$cluster,$scope,$kube_name,$kube_deployment}.as_count()"

Table of Contents

Created by gh-md-toc

Requirements

  • Kubernetes 1.3 or later
  • AWS Credentials keys (need DescribeTags, AddTags, RemoveTags)

Installation

Using Homebrew (OS X only)

Formula is available at koudaiii/homebrew-tools.

$ brew tap koudaiii/tools
$ brew install sltd

Precompiled binary

Precompiled binaries for Windows, OS X, Linux are available at Releases.

From source

$ go get -d github.com/koudaiii/sltd
$ cd $GOPATH/src/github.com/koudaiii/sltd
$ make deps
$ make install

Run in a Docker container

docker image is available at quay.io/koudaiii/sltd.

# -t is required to colorize logs
$ docker run \
    --rm \
    -t \
    -e AWS_ACCESS_KEY_ID="XXXXXXX" \
    -e AWS_SECRET_ACCESS_KEY="XXXX" \
    -e AWS_DEFAULT_REGION="ap-northeast-1" \
    -e AWS_REGION="ap-northeast-1" \
    -v $HOME/.kube/config:/.kube/config \
    quay.io/koudaiii/sltd:latest \
    --in-cluster=false

Usage

  • sltd make tag ELB from labels in kubernetes cluster.

    • cluster name is kubernetescluster key
    • namespace is kube_namespace key
    • service name is kube_name key
  • --onetime option

$ sltd --onetime
  • --sync-interval option
$ sltd  --sync-interval=10s

kubeconfig file

if sltd uses out of cluster, ~/.kube/config as default.

Options

Option Description Required Default
--onetime=bool run one time and exit. optional false
--in-cluster=bool if sltd uses out of cluster,need --in-cluster=false optional true
--sync-interval=string the time duration between template processing. optional 60s
-h, -help Print command line usage
-v, -version Print version

Development

Clone this repository and build using make.

$ go get -d github.com/koudaiii/sltd
$ cd $GOPATH/src/github.com/koudaiii/sltd
$ make

Deployment Guide

Kubernetes

      containers:
      - image: "quay.io/koudaiii/sltd:latest"
        name: sltd
          resources:
            requests:
              cpu: 100m
              memory: 30Mi
          command:
            - "/sltd"
          args:
            - "--sync-interval=600s"
        env:
        - name: AWS_DEFAULT_REGION
          value: "ap-northeast-1"
        - name: AWS_REGION
          value: "ap-northeast-1"
        - name: AWS_ACCESS_KEY_ID
          valueFrom:
            secretKeyRef:
              name: dotenv
              key: aws-access-key-id
        - name: AWS_SECRET_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: dotenv
              key: aws-secret-access-key

Author

@koudaiii

License

MIT License

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.