Code Monkey home page Code Monkey logo

chronos's Introduction

Chronos

A custom Kubernetes Controller to watch Pods in all namespaces

Introduction

Chronos is a kubernetes controller that I wrote to understand the internal workings of controllers. I followed a pattern that was widely used by many production ready custom controllers like Kubewatch and Nginx ingress. Important topics that you would understand are:

  1. Informers
  2. Work Queues

The command line is written using Cobra CLI Framework.

Installation

You need to have 'go' installed and setup on the system.
After cloning the repository,you can run this program by executing:

#/>go run main.go -k {path to the kubeconfig}
                    or  
You can also choose to build the program and run it.  
                    or  
Build a docker image and deploy it as a pod in a Kubernetes cluster \\
and it will use the Incluster Config file to communicate with API server.\\
Create a role and rolebinding to provide access to Kubernetes Object store.

Check the help menu by passing -h or --help:

#/>go run main.go -h  
Kubernetes event collector and notifier  

Usage:  
  chronos [flags]  
  chronos [command]  

Available Commands:  
  help        Help about any command  
  version     chronos version  

Flags:  
  -h, --help                help for chronos  
  -k, --kubeconfig string   path to kubeconfig file  

Use "chronos [command] --help" for more information about a command.  

What does it do

The current version of Chronos tracks the status of Pods in all namespaces and logs on the command line whenever it detects a state change for a Pod.

References

Find the below links that I refered to write the controller:

  1. https://engineering.bitnami.com/articles/kubewatch-an-example-of-kubernetes-custom-controller.html
  2. https://github.com/bitnami-labs/kubewatch/blob/master/pkg/controller/controller.go

chronos's People

Contributors

arunprasadhexaware avatar k-e-r-n-e-l-p-a-n-i-c avatar

Stargazers

Gabriele avatar domain avatar Hugo O. Matus avatar Julien Laurenceau avatar  avatar Hamza Rhaouati avatar

Watchers

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