Code Monkey home page Code Monkey logo

kraph's Introduction

THIS IS a PoC

GoDoc Go Report Card License Travis CI

kraph

kraph is an experimental Go module which allows to build a graph of API objects. The resulting graph can be represented as gonum.Graph which allows for advanced graph analysis!

You can query the resulting graph nodes and edges based on various attributes. Equally, you can also retrieve a subgraph of a chosen node and perform further analysis on it.

At the moment only kubernetes API object graph is implemented, but the module defines pluggable interfaces which should allow for expanding the support for arbitrary API objects, such as AWS etc.

Getting started

The project provides a simple Makefile which makes basic tasks, such as running tests and building the module simple:

Get dependencies:

make dep

Run tests:

make test

Build module:

make build

kctl

The project provides a simple command line utility which allows to build and query API object graphs.

At the moment only build command is implemented with a kubernetes subcommand which allows to build and query the kubernetes API object graph.

HOWTO

The project Makefile provides kctl task which makes building the cli utility a breeze:

Build:

make kctl

kctl command line options:

$ ./kctl help
NAME:
   kctl - build and query API object graphs

USAGE:
   kctl [global options] command [command options] [arguments...]

COMMANDS:
   build    build a graph
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h  show help (default: false)

kctl currently only supports building the graph of the the Kubernetes API objects and storing them in in-memory store. It allows to dump the graph in DOT GraphViz format. This can be piped into the GraphViz tool for further processing. kctl is in the pre-alpha state (if it can be called that at all!) and it's more of a debugging help tool at the moment as the focus of the project is the graph mapping.

NOTE: You must have kubeconfig properly configured.

$ ./kctl build k8s -format "dot" | dot -Tsvg > cluster.svg && open cluster.svg

NOTE: dot format is the only available and default format so you can get the same results as above by running the command below, too:

$ ./kctl build k8s | dot -Tsvg > cluster.svg && open cluster.svg

kraph's People

Contributors

milosgajdos avatar agonzalezro 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.