项目作者: getninjas

项目描述 :
auto spot curator for AWS
高级语言: Go
项目地址: git://github.com/getninjas/spot-ninja.git
创建时间: 2019-05-17T13:11:38Z
项目社区:https://github.com/getninjas/spot-ninja

开源协议:Apache License 2.0

下载


spot-ninja

Go Report Card
Build Status
GoDoc

Available translations:

This software is responsible for all the intelligence in increasing and decreasing AutoScalingGroups size based on Spotfleet health.

License

spot ninja is released under the terms of the Apache License. See LICENSE file for more information or see apache.

Requirements

  • Docker >=v1.13.1
  • Docker Compose >=1.23.1
  • Go >= 1.12.7
  • aws-sdk-go Module
  • yaml.v2 Module
  • Polices:
    • CloudWatchReadOnlyAccess
    • AmazonEC2SpotFleetAutoscaleRole
    • AutoScalingConsoleFullAccess

Architecture

spot-ninja

ENVs configuration

To configure the spot-ninja, you need to configure some environment variables. The variables are:

  • AWS_REGION
    • Default us-east-1
  • DATA_POINT_CONFIG
    • Default 30
  • STATISTIC_CONFIG
    • Default Average
  • FLEET_TYPE_CONFIG
    • Default FleetRequestId
  • ID_METRIC_CONFIG
    • Default metric
  • SCAN_TYPE_CONFIG
    • Default TimestampDescending
  • METRIC_NAME_CONFIG
    • Default PendingCapacity
  • NAMESPACE_CONFIG
    • Default AWS/EC2Spot
  • UNIT_CONFIG
    • Default Count
  • TIME_TO_CONFIG
    • Default 5
  • SPEED_CONFIG
    • Default 10
  • DIVIDER_CONFIG
    • Default 4
  • FLEET_IGNORED
    • Default none
  • ENABLE_EVENTS_ON_SQS
    • Default false
  • SQS_URL
    • Default none
  • PREFIX
    • Default ecs-
  • TIME_TO_LIVE
    • In seconds Default 15 min.

Installing with docker-compose

1 - Build

  1. docker-compose build

2 - Run spot-ninja

  1. docker-compose up

Project Structure

  • cmd/
    • main spot-ninja
  • config/
    • general configs to spot ninja
  • pkg/
    • general libs

References