Code Monkey home page Code Monkey logo

go-discover-kubernetes's Introduction

Go Discover Nodes for Cloud Providers Build Status GoDoc

go-discover is a Go (golang) library and command line tool to discover ip addresses of nodes in cloud environments based on meta information like tags provided by the environment.

See go-discover for full details.

This library is an extension to go-discover to add Kubernetes support, specifically to discover addresses of load-balanced applications from its related Service object.

Supported Providers

Additional cloud providers herein include:

Config Example

# Kubernetes
provider=kubernetes namespace=mynamespace label_key=role label_value=consul

Command Line Tool Usage

Install the command line tool with:

go get -u github.com/continuul/go-discover/cmd/discover

The build it with:

make build

Then run it with:

$ kubectl create -f nginx.yaml
$ kubectl create -f discover.yaml

Library Usage

Install the library with:

go get -u github.com/continuul/go-discover

You can then either support discovery for all available providers or only for some of them.

// support discovery for all supported providers
d := discover.Discover{}

// support discovery for AWS and GCE only
d := discover.Discover{
	Providers : map[string]discover.Provider{
		"aws": discover.Providers["aws"],
		"gce": discover.Providers["gce"],
		"kubernetes": &kubernetes.Provider{},
	}
}

// use ioutil.Discard for no log output
l := log.New(os.Stderr, "", log.LstdFlags)

cfg := "provider=kubernetes namespace=default ..."
addrs, err := d.Addrs(cfg, l)

go-discover-kubernetes's People

Watchers

James Cloos 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.