Giter Club home page Giter Club logo

dcos-autoscaler's Introduction

dcos-autoscaler

Build Status

!! In development !!

Experimental project

Autoscaling a DCOS cluster hosted in a cloud provider, either Private or Public, by specifying options.

!! In development using Microsoft Azure, but more that welcome to have contribution for AWS, GCE and others providers...

You can either use switch (ex: --timer) or environement variables (ex: export AS_TIMER=60)

Option Variable Description Default
--provider-name AS_PROVIDER_NAME provider who host the cluster. ex: Azure, GCE, AWS...
--timer AS_TIMER time in seconds between successive checks 60
--scale-up-cap AS_SCALE_UP_MAX Threshold to kick the scale Up in percentage 80
--scale-down-cap AS_SCALE_DOWN_MAX Threshold to kick the scale Down in percentage 20
--scale-max AS_SCALE_MAX Maximum nodes limitation to scale 20
--scale-min AS_SCALE_MIN Minimum nodes limitation to scale 3
--azure-subscription-id AZURE_SUBSCRIPTION_ID Azure Subscription ID
--azure-tenant-id AZURE_TENANT_ID Azure Tenant ID
--azure-client-id AZURE_CLIENT_ID Azure Client ID
--azure-client-secret AZURE_SECRET_ID Azure Client Secret
--azure-location AZURE_LOCATION Azure DC Location
--azure-resource-group AZURE_RG Azure Resource Group
--azure-vmss-name AZURE_VMSS Azure VMSS Name to scale
--v --vv --vvv AS_VERBOSE The debug noise level -vv

High level orverview of the very simple code architecture :

Output in debug mode :


2017-06-23 20:20:41,287 - dcos-autoscaler - DEBUG - Debug mode activated
2017-06-23 20:20:41,287 - dcos-autoscaler - DEBUG - Provider Name : Azure
2017-06-23 20:20:41,287 - dcos-autoscaler - DEBUG - Timer : 5
2017-06-23 20:20:41,287 - dcos-autoscaler - DEBUG - Scale Up Cap : 80
2017-06-23 20:20:41,288 - dcos-autoscaler - DEBUG - Scale Down Cap : 20
2017-06-23 20:20:41,288 - dcos-autoscaler - DEBUG - Maximum Nodes : 20
2017-06-23 20:20:41,288 - dcos-autoscaler - DEBUG - Minimum Nodes : 3
2017-06-23 20:20:41,288 - dcos-autoscaler - DEBUG - Azure Subscription ID : 8f26a68d-8613-4a0c-a2a6-2d2d0e261910
2017-06-23 20:20:41,288 - dcos-autoscaler - DEBUG - Azure Tenant ID : 333c7f36-ba66-49f1-9d8a-a450816e8516
2017-06-23 20:20:41,288 - dcos-autoscaler - DEBUG - Azure Client ID : 5308694f-bed6-494a-9c19-335b3c40b8b3
2017-06-23 20:20:41,288 - dcos-autoscaler - DEBUG - Azure Client Secret : myP@ssw0rd1
2017-06-23 20:20:41,288 - dcos-autoscaler - DEBUG - Azure Resource Group : myResourceGroup
2017-06-23 20:20:41,289 - dcos-autoscaler - DEBUG - Azure Location : eastus
2017-06-23 20:20:41,289 - dcos-autoscaler - DEBUG - Azure VMSS Targeted : dcos-agentprivsl-1453224-vmss
2017-06-23 20:20:41,289 - dcos-autoscaler - INFO - DC/OS Autoscaler Started
2017-06-23 20:20:41,289 - dcos-autoscaler - DEBUG - Provider Azure used
2017-06-23 20:20:41,518 - dcos-autoscaler - DEBUG - Get Health Cluster
2017-06-23 20:20:41,529 - dcos-autoscaler - DEBUG - Health from : http://leader.mesos:5050/slaves
2017-06-23 20:20:41,530 - dcos-autoscaler - DEBUG - Filter the health object to get only the stateless nodes
2017-06-23 20:20:41,530 - dcos-autoscaler - DEBUG - 10.1.0.5 - Added to the stateless pool
2017-06-23 20:20:41,530 - dcos-autoscaler - DEBUG - 10.1.0.7 - Added to the stateless pool
2017-06-23 20:20:41,530 - dcos-autoscaler - DEBUG - 10.1.0.4 - Added to the stateless pool
2017-06-23 20:20:41,530 - dcos-autoscaler - DEBUG - 10.1.0.6 - Added to the stateless pool
2017-06-23 20:20:41,530 - dcos-autoscaler - DEBUG - 10.1.0.8 - Added to the stateless pool
2017-06-23 20:20:41,530 - dcos-autoscaler - INFO - Total Cluster CPU = 10.0 - Total Cluster CPU = 29715.0
2017-06-23 20:20:41,530 - dcos-autoscaler - INFO - Total Used CPU = 7.0 - Total Cluster MEM = 3584.0
2017-06-23 20:20:41,531 - dcos-autoscaler - INFO - Ratio CPU = 70.0% - Ratio MEM = 12.061248527679624%

Running the autoscaler in your cluster

Marathon.json

Example for Microsoft Azure :

Documentation in progress...

In this example, you:

From inside the cluster, run this command :

docker run -it -d --name=autoscaler
    -e AZURE_CLIENT_ID='5308694f-bed6-494a-9c19-335b3c40b8b3'
    -e AZURE_CLIENT_SECRET='myP@ssw0rd1!' 
    -e AZURE_TENANT_ID='333c7f36-ba66-49f1-9d8a-a450816e8516'
    -e AZURE_SUBSCRIPTION_ID='8f26a68d-8613-4a0c-a2a6-2d2d0e261910' 
    julienstroheker/dcos-autoscaler python main.py -vv 
    --provider-name Azure 
    --azure-location eastus
    --azure-resource-group myResourceGroup
    --azure-vmss-name dcos-agentprivsl-1453224-vmss

TO DO :

  • Tests
  • Documentation
  • CI

dcos-autoscaler's People

Contributors

julienstroheker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

paegun dreambeam

dcos-autoscaler's Issues

Security - Remove CLI options method of passing Azure credentials

Please remove the CLI options method of passing Azure credentials.

The Azure CLI, AWS CLI, and boto client all follow the security best practice of not passing credentials via the command line, see the following:
https://docs.microsoft.com/en-us/azure/xplat-cli-connect
http://boto3.readthedocs.io/en/latest/guide/configuration.html

The MySQL docs provide the rationale, see the following (specifically the paragraph starting w/ "This is convenient but insecure ....") :
https://dev.mysql.com/doc/refman/5.7/en/password-security-user.html

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.