Like Komodor, just mini [••]

Minikom - like Komodor, just mini [••]

Congratulations for receiving Komodor home assignment!

If you made it this far, it means we're curious, and would love to see your code.

For this exercise we've created a miniature version of Komodor, in which you will implement a key component of Komodor.

This exercise will give you a sense of development at Komodor, and we hope you will find it enjoyable.

Background

Komodor's system consists of three main components:

  1. Komodor agent - a stable, efficient process that watches for updates in Kubernetes resources and routes them to Komodor server
  2. Komodor server - a highly-available, scalable backend that gets information from Komodor agent, and organizes it so it can be later visible through Komodor app
  3. Komodor app - a user-friendly web application that is loved by hundreds of developers and dev-ops engineers

In this exercise you will implement a simplified version of the Komodor server, Minikom.

We have already included a very simplified version of the Komodor agent, Komobox.

How Komobox works

  • In our environment, which Komobox monitors, we have a few services. At any certain point, each service can be in exactly one state: idle, deploy or issue.
  • While a service is in a state of deploy or issue, Komobox will attempt every second to send an event to Minikom with the current state.
  • While a service is in a state of idle, Komobox won't send anything about the service.
  • Komobox might send events in a small delay (up to 10 seconds) and does not guarantee the order of the events.
  • Komobox code is given to you for reference. The basic terms of event delay and order cannot be changed.

Getting started

  1. Fork this repository
  2. Clone your fork to your dev machine
  3. Run docker compose up to confirm your runtime works (see docker compose)

Instructions

You need to implement Minikom, an HTTP server that accepts events from Komobox, and exposes the endpoints below.

# Accept a single event from Komobox
Method: POST
Endpoint: /event
Request type: JSON object
Request structure: {
  "service_name": string
  "state": "deploy" or "issue"
  "timestamp": number (unix time) # the time the event took place at the source
}
Response: 200 OK # No body
# List all services that have been seen by Minikom so far
Method: GET
Endpoint: /services
Response type: JSON object
Response structure: {
  <service_name>: {
    state: "idle" or "deploy" or "issue" # latest state of the service
    since: number (unix time) # the time the latest state started
  }
}
# List latest events (max: 50) for service
Method: GET
Endpoint: /services/<service_name>/latest-events
Response type: JSON array
Response structure: [{ # element per event
   state: "deploy" or "issue" # the state type (idle should not be included)
   start_time: number (unix time) # the time the state started
   end_time: number (unix time) or null # the time the state ended (null if still ongoing)
}]

Notes

  1. You may implement the server in Python, Javascript, or Typescript
  2. Minikom should be accessible to Komobox via docker compose
  3. We should be able to run the entire system just by running docker compose up
  4. The server should be exposed to the local machine on port 8080
  5. Please include system tests with your solution, with instructions how to run them

Good luck!
Komodor [••]

Similar Resources

provide api for cloud service like aliyun, aws, google cloud, tencent cloud, huawei cloud and so on

cloud-fitter 云适配 Communicate with public and private clouds conveniently by a set of apis. 用一套接口,便捷地访问各类公有云和私有云 对接计划 内部筹备中,后续开放,有需求欢迎联系。 开发者社区 开发者社区文档

Dec 20, 2022

Kubernetes OS Server - Kubernetes Extension API server exposing OS configuration like sysctl via Kubernetes API

KOSS is a Extension API Server which exposes OS properties and functionality using Kubernetes API, so it can be accessed using e.g. kubectl. At the moment this is highly experimental and only managing sysctl is supported. To make things actually usable, you must run KOSS binary as root on the machine you will be managing.

May 19, 2021

Act is a task runner and supervisor with some great features like act name matching, subacts, etc. We use this in nosebit workspaces.

Act Act is a task runner and supervisor tool written in Go which aims to provide the following features: process supervision in a project level allow

May 8, 2022

This repo includes several winrm applications like transfering files, running commands.

This repo includes several winrm applications like transfering files, running commands.

WinRM Tools This repo includes several WinRM tools written with Go: File transfering between two Powershell session. Running command on remote Powersh

Nov 26, 2022

Golang CRUD using database PostgreSQL, adding some fremework like mux and pq.

Golang CRUD with PostgreSQL Table of contents 👀 General info Technologies Blog Setup General info GOPOST or Go-Post is a Golang REST API made to show

Nov 27, 2021

Execute multiple shell commands like Docker-Compose

parx parx is a simple tool to run multiple commands in parallel while having the output structured like Docker Compose does that. This is useful when

Aug 15, 2022

concurrent map implementation using bucket list like a skip list.

Skip List Map in Golang Skip List Map is an ordered and concurrent map. this Map is goroutine safety for reading/updating/deleting, no-require locking

Oct 8, 2022

An Alert notification service is an application which can receive alerts from certain alerting systems like System_X and System_Y and send these alerts to developers in the form of SMS and emails.

Alert-System An Alert notification service is an application which can receive alerts from certain alerting systems like System_X and System_Y and sen

Dec 10, 2021

I'd like to share random apps in the spare times. Thus, I'm going to try learning some concepts of Go and as much as I can I try to clarify each line.

go-samples I'd like to share random apps in the spare times. Thus, I'm going to try learning some concepts of Go and as much as I can I try to clarify

Mar 16, 2022
Related tags
🥝 Mini ECS CLI Command 🥝

miniecs ?? miniecs is a CLI tool for AWS ECS. ?? Requirement go 1.17.x or later �Installation go install github.com/jedipunkz/miniecs@latest Usage $ m

Oct 26, 2022
Collection of mini-programs demonstrating Kubernetes client-go usage.

Kubernetes client-go examples Collection of mini-programs covering various client-go use cases. The intention (at least so far) is to test (more or le

Jan 3, 2023
Based on the electron Cross-platform Mini browser

Based on the electron Cross-platform Mini browser

May 1, 2022
Mini file storage with Go (Golang)

#Microstorage This is my exercise of creating simple file storage with GoLang Purpose: store and manipulate with user`s images in my pet projects ##Ve

Nov 2, 2022
A plugin for argo which behaves like I'd like

argocd-lovely-plugin An ArgoCD plugin to perform various manipulations in a sensible order to ultimately output YAML for Argo CD to put into your clus

Dec 27, 2022
Just yet another Prometheus exporter for Cosmos Hub (Gaia).

gaiad_exporter Just yet another Prometheus exporter for Cosmos Hub (Gaia). Build Use the make, Luke! $ make Usage $ gaiad_exporter --help usage: gaiad

Nov 27, 2021
Horusec is an open source tool that improves identification of vulnerabilities in your project with just one command.
Horusec is an open source tool that improves identification of vulnerabilities in your project with just one command.

Table of contents 1. About 2. Getting started 2.1. Requirements 2.2. Installation 3. Usage 3.1. CLI Usage 3.2. Using Docker 3.3. Older versions 3.4. U

Jan 7, 2023
Just a dummy Kubernetes Operator, playing with another dummy service

My first operator Just playing/learning to create a K8S operator in go. I will create a dummy operator that creates pods to open a shell inside It is

Dec 16, 2021
Making it easy to write shell-like scripts in Go
Making it easy to write shell-like scripts in Go

import github.com/bitfield/script What is script? script is a Go library for doing the kind of tasks that shell scripts are good at: reading files, ex

Jan 9, 2023
Feels like Cloud Foundry. Runs on Kubernetes.

Migrate Cloud Foundry applications to Kubernetes using Kf As your teams standardize on Kubernetes, migrating applications from existing platforms like

Dec 23, 2022