sokar

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2020 License: LGPL-3.0 Imports: 22 Imported by: 0

README

Sokar

Go Report Card Maintainability Coverage Status FOSSA Status

Quality Gate Status Code Smells Lines of Code Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities

Overview

Purpose

Sokar is a generic alert based auto-scaler for cloud systems.

If you are running your microservices on a container orchestration system like Nomad or kubernetes, then you are probably also need to scale them based on the load varying over time. The same situation applies if your system runs directly on AWS EC2 instances and thus they have to be scaled out with increased and scaled in with a reduction of the load. Usually the decision to scale is made based on metrics like current CPU/ RAM utilization or requests per second. But often you might want to use custom metrics like the length of a job-queue, the number of processed images per second or even a combination of those.

Here comes sokar into play. Sokar is a generic auto-scaler that makes scale up/ down decisions based on scale alerts. He constantly evaluates the incoming scaling alerts, aggregates them and then scales the desired ScaleObject (i.e. microservice or an EC2 instance). Even if multiple metrics shall be taken into account for scaling the ScaleObject, those metrics just have to be expressed as scaling alerts and sokar will use them accordingly for scaling.

doc/overview_coarse.png

Benefit
  1. Possibility to combine multiple metrics to be taken into account for the scaling decisions. The impact of those metrics, expressed as scale alerts, can be easily adjusted by configuring suitable weights.
  2. Use the connectors to scale the actual ScaleObject. No need to implement the communication with the Container Orchestration System in this regard. The supported connectors can be found here.
  3. Configurable and ready to use capacity planning, providing separate cool downs for up and down scaling. Further more it is possible to select the planning mode which fits best for your workload.
State

At the moment sokar is able to scale Nomad jobs, Nomad instances (running on AWS) and AWS EC2 instances. For details about the changes see the changelog.

Build and Run

One can build and run sokar either in docker or directly on the host.

On Host
# build
make build

# run (as scaler for nomad jobs)
make run.nomad-job
Docker
# build
make docker.build

# pull it from docker hub
docker pull thobe/sokar

# run (as scaler for nomad jobs)
docker run -p 11000:11000 thobe/sokar:latest
# example
docker run -p 11000:11000 thobe/sokar:latest

For more configuration options and how to specify if sokar shall run as scaler for nomad jobs, nomad instances or AWS instances see Config.md.

Features

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
aws
test
mocks
Package mock_main is a generated GoMock package.
Package mock_main is a generated GoMock package.
mocks/aws
Package mock_aws is a generated GoMock package.
Package mock_aws is a generated GoMock package.
mocks/capacityplanner
Package mock_capacityplanner is a generated GoMock package.
Package mock_capacityplanner is a generated GoMock package.
mocks/logging
Package mock_logging is a generated GoMock package.
Package mock_logging is a generated GoMock package.
mocks/metrics
Package mock_metrics is a generated GoMock package.
Package mock_metrics is a generated GoMock package.
mocks/nomad
Package mock_nomad is a generated GoMock package.
Package mock_nomad is a generated GoMock package.
mocks/nomadWorker
Package mock_nomadWorker is a generated GoMock package.
Package mock_nomadWorker is a generated GoMock package.
mocks/scaler
Package mock_scaler is a generated GoMock package.
Package mock_scaler is a generated GoMock package.
mocks/sokar
Package mock_sokar is a generated GoMock package.
Package mock_sokar is a generated GoMock package.
integration Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL