Giter Site home page Giter Site logo

zenika / karto Goto Github PK

View Code? Open in Web Editor NEW
46.0 12.0 5.0 2.1 MB

A simple static analysis tool to explore a Kubernetes cluster : observe your cluster state in real time, diagnosticate network policies, and more!

License: MIT License

Go 31.97% HTML 0.23% JavaScript 67.77% CSS 0.02% Dockerfile 0.01%
kubernetes kubernetes-deployment kubernetes-service golang d3js

karto's Introduction

demo

Karto

A simple static analysis tool to explore a Kubernetes cluster.

Latest release Docker pulls GitHub Downloads Build Status

Explore you cluster interactively!

deployment-demo

Observe your cluster change in real time!

deployment-demo

Diagnosticate network policies

network-policy-demo

Main features

The left part of the screen contains the controls for the main view:

  • View: choose your view
    • Workloads: deployments, controllers, pods, services, ingresses... and how they interact with each other
    • Network policies: network routes allowed between pods, based on network policy declarations
    • Health: health information about the pods
  • Filters: filter the items to display
    • by pod namespace
    • by pod labels
    • by pod name
    • [Network policies view only] Include ingress neighbors: also display pods that can reach those in the current selection
    • [Network policies view only] Include egress neighbors: also display pods that can be reached by those in the current selection
  • Display options: customize how items are displayed
    • Auto-refresh: automatically refresh the view every 2 seconds
    • Auto-zoom: automatically resize the view to fit all the elements to display
    • Show namespace prefix: add the namespace to the name of the displayed items
    • Always display large datasets: try to render the data even if the number of item is high (may slow down your browser)
    • [Network policies view only] Highlight non isolated pods (ingress): color pods with no ingress network policy
    • [Network policies view only] Highlight non isolated pods (egress): color pods with no egress network policy
    • [Health view only] Highlight pods with container not running: color pods with at least one container not running
    • [Health view only] Highlight pods with container not ready: color pods with at least one container not ready
    • [Health view only] Highlight pods with container restarted: color pods with at least one container which restarted

The main view shows the graph or list of items, depending on the selected view, filters and display options:

  • Zoom in and out by scrolling
  • Drag and drop graph elements to draw the perfect map of your cluster
  • Hover over any graph element to display details: name, namespace, labels, isolation (ingress/egress)... and more!

In the top left part of the screen you will find action buttons to:

  • Export the current graph as PNG to use it in slides or share it
  • Go fullscreen and use Karto as an office (or situation room) dashboard!

Installation

There are two ways to install and run Karto:

  • To deploy it inside the Kubernetes cluster to analyze, proceed to the Run inside a cluster section.
  • To run it on any machine outside the Kubernetes cluster to analyze, refer to the Run outside a cluster section.

Run inside a cluster

Deployment

Simply apply the provided descriptor:

kubectl apply -f deploy/k8s.yml

This will:

  • create a karto namespace
  • create a karto service account with a role allowing to watch the resources displayed by Karto (namespaces, pods, network policies, services, deployments...)
  • deploy an instance of the application in this namespace with this service account

Exposition

Once deployed, the application must be exposed. For a quick try, use port-forward:

kubectl -n karto port-forward <pod name> 8000:8000

The will exposed the app on your local machine on localhost:8000.

For a long-term solution, investigate the use of a LoadBalancer service or an Ingress.

Remember to always secure the access to the application as it obviously displays sensitive data about your cluster.

Cleanup

Delete everything using the same descriptor:

kubectl delete -f deploy/k8s.yml

Run outside a cluster

For this to work, a local kubeconfig file with existing connection information to the target cluster must be present on the machine (if you already use kubectl locally, you are good to go!).

Simply download the Karto binary from the releases page and run it!

Development

Prerequisites

The following tools must be available locally:

  • Go (tested with Go 1.18)
  • NodeJS (tested with NodeJS 16)

Run the frontend in dev mode

In the front directory, execute:

yarn start

This will expose the app in dev mode on localhost:3000 with a proxy to localhost:8000 for the API calls.

Run the backend locally

In the back directory, execute:

go build karto
./karto

Test suites

To run the entire backend test suite, execute in the back directory:

go test ./...

Compile the go binary from source

In production mode, the frontend is packaged in the go binary using embed. In this configuration, the frontend is served on the / route and the API on the /api route.

To compile the Karto binary from source, first compile the frontend source code. In the front directory, execute:

yarn build

This will generate a build directory in front.

Then, make a copy in a directory visible by the backend module:

cp -R front/build/* back/exposition/frontend

Finally, compile the go binary in the back directory:

go build karto

karto's People

Contributors

romainvernoux avatar tazminia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

karto's Issues

Authentification mechanism

In the case when Karto is exposed publicly through a NodePort, HostPort or Ingress, a basic authentification mechanism would be nice to avoid exposing sensitive details.

We probably need some kind of interceptor in api.go?

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.