Coder Social home page Coder Social logo

k8s-graph's Introduction

Build Status

Visualize Your Kubernetes Cluster

Image

Abstract

This project contains 3 parts to visualize your k8s graph.

Docker container is already available on DockerHub so you can skip part 1. and 2. and just create the k8s deployment.

  1. Node server, that polls the information from k8s api and creates a graph using D3.
  2. Dockerfile, that creates the container.
  3. k8s yaml file, that will create a service and a deployment with two containers.
    1. kubectl started with proxy, so the node server can access the k8s api.
    2. Node server, that renders the graph using D3.

Node server

Relevant files for the node server are server.js, k8s.html and package.json.

The node server polls - by default - every second the k8s api and extracts the relevant information to create the graph visualization which is implemented in the html file.

The following list shows the values, that can be configured via env variables:

Dockerfile

Yeah, this is the Dockerfile that creates the docker container with the node server. Docker container is published at DockerHub rilleralle/k8s-graph

K8s Yaml File

Yaml file creates one service and one deployment - with two container.

Service:

By default the service type is NodePort. If you are running k8s on a cloud service like AWS or Google you can also use aLoadBalancer. Read more about Service Types.

Deployment:

Creates a deployment with two container.

  1. kubectl container, that starts with proxy command so the node server can access the k8s api to fetch the required information to render the graph.
  2. Node server container. Docker image is available on DockerHub docker pull rilleralle/k8s-graph Set env variables to configure node server. See section Node server

Create deployment

$ kubectl apply -f k8s-graph.yaml

RBAC

With K8S 1.9.2 the default user does not have access to the API any more. Please create a service account that has read access for the endpoints nodes and pods. Use this account to execute the graph container. You can also bypass the RBAC by making the default user a cluster-admin. Please be aware, that this could be a secutiry issue!

kubectl create clusterrolebinding kube-system-default-admin   --clusterrole=cluster-admin --serviceaccount=default:default

k8s-graph's People

Contributors

rilleralle avatar fxpester 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.