These are simple node projects that allows you to connect to the Spotinst API and set the capacity limits for your EMR Elastigroup
Upload Zip Through the Spotinst Console (SetEMRCapacity.zip)
- Go to the Spotinst Functions console and select “+ Create Function”
- Input:
- Name: “Set EMR Elastigroup Capacity"
- Runtime: NodeJS 8.3
- Application: Wherever you want
- Environment: Wherever you want
- Handler: “main”
- Select “Upload ZIP/JAR file” and select the zip file that you downloaded from above
- Change Security to Public
- Open Advanced and Create the Environment Variables:
- spotToken : <Your Spotinst API Token>
- spotAccount : <Your Spotinst Account ID>
- spotEMR : <Your Spotinst EMR Elastigroup ID>
- target : <The Target Number of Instances>
- min : <Min Number of Instances>
- max : <Max Number of Instance>
- Select “+ Create Function“ at the bottom of the screen
- Do this for both functions
Test Function
- Once the function has been deployed go to the “Testing” tab
- Select Run Test
- You should see “Success” on the console
- You can check the logs in the next tab and there you will see the request and response that you just made
** NOTE: It may take up to a minute for you function to load the first time
Set Up Timer
- In the Spotinst Console Under the function go to the “Triggers” tab
- Select “Add Trigger”
- Input the cron function you want it to run on. For help checkout the cronguru.com
- Once your function has updated check back on the logs to make sure that it is working right
Comments
0 comments
Please sign in to leave a comment.