Skip to content
/ klevr Public

Pull based task manager & agent for remote infrastructure management in the other separated networks.

License

Notifications You must be signed in to change notification settings

Klevry/klevr

Repository files navigation

klevr_logo.png
https://opensource.klevr.dev

  • Image click to Youtube:
  • Klevr concept diagram

Klevr: Kloud-native everywhere

Hyper-connected Cloud-native delivery solution for SaaS

  • Asynchronous distributed infrastructure management console and agent for separated networks.
  • Supports for:
    • Baremetal server in the On-premise datacenter
    • PC/Workstation in the Office/intranet
    • Laptop at everywhere
    • Public-cloud

Kickstart for klevr demo

  • docker-compose command

    git clone https://github.com/klevry/klevr.git
    sudo docker-compose -f klevr/docker-compose.yml up -d
    
  • Then visit the console at http://localhost:8091

  • Lending page (default ID/PW = admin/admin) image

  • Main page image

Diagram Overview

  • Image click to Youtube:
  • Diagram Overview

Features

  • Agent
    • Provisioning: Docker, Kubernetes, Micro K8s(on Linux laptop) with Vagrant & VirtualBox, Prometheus
    • Get & Run: Hypervisor(via libvirt container or Multipass), Terraform, Prometheus, Beacon, Helm chart
    • Metric data aggregate & delivery
  • Manager
  • Host pool management
  • Resource management
  • Primary host management
  • Task management(To be)
  • Service catalog management(To be)
  • Service delivery to Dev./Stg./Prod.(To be)
  • Docker images
  • KV store(Consul)

Simple logic of asynchronous task management - (Click to Youtube for details)

  • Primary election of agent

Architecture

Scheme of Database

  • AGENT_GROUPS: Zone(A.K.A Group) information of Agents. Task will be seperated by Zone base
  • AGENTS: Manage the status of Agents allowed access to the Manager and information on the Zone to which the Agent belongs
  • API_AUTHENTICATIONS: API key management to go through the authentication process to access the functions provided by the Manager
  • TASK_LOCK: Informs the Manager that it can provide the function of the job by preempting the lock.
  • TASKS: Overall task and status management
  • TASK_DETAIL: Detailed setting contents of each task
  • TASK_STEPS: Manage the steps that perform the actual work of the task
  • TASK_LOGS: Task log

Structure

  • Klevr has a web-based management tool (console) implemented in React.
    • The user manual of the console can be viewed at [here] (./console/Manual-KR.md).
    • It provides user (admin) authentication and can manage Task, Credential, Zone, Agent, and API Key.
    • By setting "REACT_APP_API_URL" in the ".env" file, you can specify the Manager you want to connect to from the console.
  • Klevr consists of Manager, Agent and DB. Klevr Elements
  • Background tasks to manage tasks and agents in Manager
    • Lock:Check the lock status by scheduler background-1
    • EventHandler: Notification of task change status with WebHook background-2
    • AgentStatus: Continuously check and change the current status of the Agent background-3
    • ScheduledTask: Task status is Scheduled and the status of tasks before the scheduled time is changed to waitPolling status. background-4
    • TaskHandOverUpdater: DB status change of tasks whose status is HandOver background-5
  • Manage Tasks and Agents in Manager
    • Task execution task execution
    • Task state transition task status
    • Primary Agent management
      • The Agent who initially requested HandShake from the Manager is selected as Primary
      • After this, Agents requesting HandShake are selected as Secondary
      • Secondary Agents monitor the status of Primary Agent. The first secondary agent that detects an abnormality in the primary agent reports the status of the primary agent to the manager and is selected as the primary agent.

Usage

Swagger-UI API

1. Zone

  • Create
    • [POST] /inner/groups
  • Listing
    • [GET] /inner/groups/{groupID}
  • Delete
    • [DELETE] /inner/groups/{groupID}

2. API KEY

  • Create
    • [POST] /inner/groups/{groupID}/apikey
  • Listing
    • [GET] /inner/groups/{groupID}/apikey
  • Modify
    • [PUT] /inner/groups/{groupID}/apikey

3. TASK

  • Create
    • [POST] /inner/tasks
  • Show
    • [GET] /inner/tasks
  • Listing
    • [GET] /inner/tasks/{taskID}
  • Cancel
    • [DELETE] /inner/tasks/{taskID}
  • Reserved word command information
    • [GET] /inner/commands

Requirement for use

  • Docker/Docker-compose/Docker-registry
    • Beacon
    • Libvirt
    • Task manage to ProvBee
  • Terraform of container by ProvBee
  • KVM(libvirt) by ProvBee
  • Multipass for Hosted Virtual-machine
  • Micro K8s K3s
  • Prometheus by ProvBee
  • Grafana by ProvBee
  • Helm by ProvBee
  • Vault(maybe)
  • Packer(maybe)
  • Vagrant
  • Consul

Description for Directories and files

.
├── README.md                   // This Screen as you see. :)
├── docker-compose.yml          // Kickstarter: Bootstraping by docker-compose
├── Dockerfiles                  // Directory for docker image build
│   ├── libvirt
│   └── manager                 // Actual binary file of manager will be move to this link directory for the docker build
├── assets
│   └── [Images & Contents]
├── cmd                         // Actual artifacts fpr Klevr agent & manager(webserver) 
│   ├── klevr-agent
│   │   ├── Makefile
│   │   ├── agent_installer.sh  // Remote installer via curl command as a generated script by Manager
│   │   ├── klevr               // Actual `Klevr` agent binary
│   │   └── main.go             // main source code of the Agent
│   └── klevr-manager
│       ├── Docker -> ../../Dockerfiles/manager  // Binary artifact send to this directory for Docker build  
│       ├── Makefile
│       └── main.go             // main source code of the Manager
├── conf
│   ├── klevr-manager-db.sql.create        // Database for Manager initializing & running
│   ├── klevr-manager-db.sql.modify        // Database for 
│   └── klevr-manager-local.yml // Config file for Manager running
├── pkg
│   ├── common                  // 'common' package directory
│   │   ├── config.go
│   │   ├── error.go
│   │   ├── http.go
│   │   ├── log.go
│   │   └── orm.go
│   ├── communicator            // 'communicator' package directory
│   │   ├── README.md
│   │   └── communicator.go
│   └── manager                 // 'manager' package directory
│       ├── api.go
│       ├── api_agent.go
│       ├── api_install.go
│       ├── api_legacy.go
│       ├── api_model.go
│       ├── handler.go
│       ├── persist_model.go
│       ├── repository.go
│       └── server.go
├── go.mod
├── go.sum
└── scripts                    // Operation script for Provisioning
    └── [Provisioning scripts]