• Stars
    star
    163
  • Rank 231,141 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Telescopes is a cloud instance types and full cluster layout recommender consisting of on-demand and spot/preemptible AWS EC2, Google, Azure, Oracle and Alibaba cloud instances.

CircleCI Go Report Card license CII Best Practices

Telescopes is a world-class left that offers lots of surfing flexibility and allows entry to a flawless, steady tube section. It's predictable and rarely pinches, is deeper than other reefs and handles the constant traffic of intermediates and experts alike.

Telescopes is a cloud instance types and full cluster layout recommender consisting of on-demand and spot/preemptible AWS EC2, Google, Azure, Oracle and Alibaba cloud instances. Based on predefined resource requirements as CPU, memory, GPU, network, etc it recommends a diverse set of cost optimized node pools.

Telescopes

The Banzai Cloud Telescopes is a cluster recommender application; its main purpose is to recommend cluster instance types and full cluster layouts consisting EC2 spot or Google Cloud preemptible instances. The application operates on cloud provider product information retrieved from the Cloudinfo application.

Banzai Cloud Telescopes exposes a rest API for accepting recommendation requests

Quick start

Building the project is as simple as running a make build command. The result is a statically linked executable binary in the ./build directory.

make build

The application can be started with the following arguments:

Usage of ./build/telescopes:
      --cloudinfo-address string   the address of the Cloud Info service to retrieve attribute and pricing info [format=scheme://host:port/basepath] (default "http://localhost:9090/api/v1")
      --dev-mode                   development mode, if true token based authentication is disabled, false by default
      --help                       print usage
      --listen-address string      the address where the server listens to HTTP requests. (default ":9090")
      --log-format string          log format
      --log-level string           log level (default "info")
      --metrics-address string     the address where internal metrics are exposed (default ":9900")
      --metrics-enabled            internal metrics are exposed if enabled
      --tokensigningkey string     The token signing key for the authentication process
      --vault-address string       The vault address for authentication token management (default ":8200")

We have recently added Oauth2 (bearer) token based authentication to telescopes which is enabled by default. In order for this to work, the application needs to be connected to a component (eg.: Banzai Cloud Pipeline ) capable to emit the bearer token The connection is made through a vault instance (which' address must be specified by the --vault-address flag) The --token-signing-key also must be specified in this case (this is a string secret that is shared with the token emitter component)

The authentication can be switched off by starting the application in development mode (--dev-mode flag) - please note that other functionality can also be affected!

For more information on how to set up Banzai Cloud Pipeline instance for using it for authentication (emitting bearer tokens) please check the following documents:

API calls

For a complete OpenAPI 3.0 documentation, check out this URL.

POST: api/v1/recommender/provider/:provider/service/:service/region/:region/cluster

This endpoint returns a recommended cluster layout on a specific provider in a specific region, that contains on-demand and spot priced node pools.

Request parameters:

sumCpu: requested sum of CPUs in the cluster (approximately)

sumMem: requested sum of Memory in the cluster (approximately)

minNodes: minimum number of nodes in the cluster (optional)

maxNodes: maximum number of nodes in the cluster

onDemandPct: percentage of on-demand (regular) nodes in the cluster

allowBurst: signals whether burst type instances are allowed or not in the recommendation (defaults to true)

zones: availability zones in the cluster - specifying multiple zones will recommend a multi-zone cluster

sameSize: signals if the resulting instance types should be similarly sized, or can be completely diverse

allowBurst: are burst instances allowed in recommendation

networkPerf: networkPerf specifies the network performance category

excludes: excludes is a blacklist - a list with vm types to be excluded from the recommendation

includes: includes is a whitelist - a list with vm types to be contained in the recommendation

cURL example

curl -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ8.eyJhdWQiOiJodHRwczovL3BpcGVsaW5lLmJhbnphaWNsb3VkLmNvbSIsImp0aSI6IjUxMWE1ODQyLWYxMmUtNDk1NC04YTg2LTVjNmUyOWRmZTg5YiIsImlhdCI6MTUyODE5MTM0MSwiaXNzIjoiaHR0cHM6Ly9iYW56YWljbG91ZC5jb20vIiwic3ViIjoiMSIsInNjb3BlIjoiYXBpOmludm9rZSIsInR5cGUiOiJ1c2VyIiwidGV4dCI6ImxwdXNrYXMifQ.azhx0MbuLp7vQ1XmwPYrOqFG5vWZVh-hkzmHig8nnvs' \POST -d '{"sumCpu": 100, "sumMem":200, "sumGpu":0, "minNodes":10, "maxNodes":30, "sameSize":true, "onDemandPct":30, "zones":[]}' "localhost:9090/api/v1/recommender/provider/amazon/service/compute/region/eu-central-1/cluster" | jq .

Sample response:

{
  "Provider": "amazon",
  "zones": [
      "eu-west-1a",
      "eu-west-1b",
      "eu-west-1c",
  ],
  "NodePools": [
    {
      "VmType": {
        "Type": "c5.xlarge",
        "AvgPrice": 0.07325009009008994,
        "OnDemandPrice": 0.19200000166893005,
        "Cpus": 4,
        "Mem": 8,
        "Gpus": 0
      },
      "SumNodes": 8,
      "VmClass": "regular"
    },
    {
      "VmType": {
        "Type": "m1.xlarge",
        "AvgPrice": 0.03789999999999985,
        "OnDemandPrice": 0.3790000081062317,
        "Cpus": 4,
        "Mem": 15,
        "Gpus": 0
      },
      "SumNodes": 4,
      "VmClass": "spot"
    },
    {
      "VmType": {
        "Type": "m2.2xlarge",
        "AvgPrice": 0.05499999999999986,
        "OnDemandPrice": 0.550000011920929,
        "Cpus": 4,
        "Mem": 34.20000076293945,
        "Gpus": 0
      },
      "SumNodes": 4,
      "VmClass": "spot"
    },
    {
      "VmType": {
        "Type": "m2.4xlarge",
        "AvgPrice": 0.10999999999999972,
        "OnDemandPrice": 1.100000023841858,
        "Cpus": 8,
        "Mem": 68.4000015258789,
        "Gpus": 0
      },
      "SumNodes": 2,
      "VmClass": "spot"
    },
...
  ]
}

FAQ

1. Will this project start instances on my behalf on my cloud provider?

No, this project will never start instances. The API response is a cluster description built from node pools of different instance types.It is the responsibility of the user to start and manage the autoscaling groups based on the response. The Pipeline and Hollowtrees projects are helping with that.

2. How does the recommender decide which instance types to include in the recommendation?

The recommender will list one node pool that contains on-demand (regular) instances. The instance type of the on-demand node pool is decided based on price, and the CPU/memory ratio and the min/max cluster size in the request. For the spot type node pools: all the instance types in the region are getting a price score - based on the Prometheus or AWS API info - and are sorted by that score. Depending on the cluster's size the first N types are returned, and the number of instances are calculated to have about equal sized pools in terms of sum CPU/memory.

3. Why do I see node pools with SumNodes=0 in the recommendation?

Those instance types are the next best recommendations after the node pools that contain instances in the response, but it's not needed to further diversify the cluster with them. Because the response is only a recommendation and it won't start instances on the cloud provider, it is possible to fine tune the recommendation before creating a cluster. It means that a user can remove recommended node pools (e.g.: because they don't want burstable instance types, like t2) and can also add new ones. If they want to add new node pools (e.g. instead of a recommended one), it makes sense for them to include one of the 0-sized node pools and to increase the node count there.

4. How are availability zones handled?

Requested availability zones must be sent in the API request. When listing multiple zones, the response will contain a multi-zone recommendation, and all node pools in the response are meant to span across multiple zones. Having different node pools in different zones are not supported. Because spot prices can be different across availability zones, in this case the instance type price score is averaged across availability zones.

5. How is this project different from EC2 Spot Advisor and Spot Fleet?

The most important difference is that Telescopes is working across different cloud providers, instead of locking in to AWS. Otherwise the recommender is similar to the EC2 Spot Advisor, it is also recommending different spot instance types to have diverse clusters. But the EC2 Spot Advisor has no externally available API, it is only available from the AWS Console, and it is only available to create Spot Fleets. We wanted to build an independent solution where the recommendation can be used in an arbitrary way and it doesn't require Spot Fleets to work. We are also keeping Kubernetes in mind - primarily to build our PaaS, Pipeline - and Kubernetes doesn't support Spot Fleets out of the box for starting clusters (via Kubicorn, kops or any other tool) or for autoscaling, rather it uses standard Auto Scaling Groups for node pools and that model fits the recommendation perfectly. We also wanted to include on-demand instances to keep some part of the cluster completely safe.

6. There's no bid pricing on Google Cloud, what will the recommender take into account there?

Even there's no bid pricing, Google Cloud can take your preemptible VMs away any time, and it still makes sense to diversify your node pools and minimize the risk of losing all your instances at once. Second, Google Cloud VM types are also complicated - there are standard, high-memory, high-cpu instances in different sizes, also special VM types, like shared-core and custom machine types, not to mention GPUs - so it makes sense to have a recommendation that takes these things into account as well. Managing a long-running cluster built from preemptible instances is also a hard task, we're working on that as well as part of the Hollowtrees project.

7. How is this project related to Pipeline?

Pipeline is able to start clusters with multiple node pools. This API is used in the Pipeline UI and CLI to recommend a cluster setup and to make it easy for a user to start a properly diversified spot instance based cluster. The recommender itself is not starting instances, it is the responsibility of Pipeline. The recommendation can also be customized on the UI and CLI before sending the cluster create request to Pipeline.

Pipeline also provides the bearer token to be used for authentication when accessing the telescope API.

8. Can the authentication be disabled from the telescopes API?

Authentication is enabled by default on the API. It is however possible to disable it by starting the application in development mode. (just start the app with the --dev-mode flag)

Beware that (unrelated) behavior of the application may be affected in this mode (logging for example) It's not recommended to use the application in production with this flag!

9. How is this project related to Hollowtrees

This project is only capable of recommending a static cluster layout that can be used to start a properly diversified spot cluster. But that is only one part of the whole picture: after the cluster is started it is still needed to be managed. Spot instances can be taken away by the cloud provider or their price can change, so the cluster may need to be modified while running. This maintenance work is done by Hollowtrees, that project is keeping the spot instance based cluster stable during its whole lifecycle. When some spot instances are taken away, Hollowtrees can ask the recommender to find substitutes based on the current layout.

10. What happens when the spot price of one of the instance types is rising after my cluster is running?

It is out of the scope of this project, but Hollowtrees will be able to handle that situtation. See the answer above for more information.

11. Is this project production ready?

Almost there. We are using this already internally and plan to GA it soon.

12. What is on the project roadmap for the near future?

The first priority is to stabilize the API and to make it production ready (see above). Other than that, these are the things we are planning to add soon:

  • GPU support
  • filters for instance type I/O performance
  • handle the sameSize switch to recommend similar types

License

Copyright (c) 2017-2019 Banzai Cloud, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

bank-vaults

A Vault swiss-army knife: a K8s operator, Go client with automatic token renewal, automatic configuration, multiple unseal options and more. A CLI tool to init, unseal and configure Vault (auth methods, secret engines). Direct secret injection into Pods.
Go
1,864
star
2

pipeline

Banzai Cloud Pipeline is a solution-oriented application platform which allows enterprises to develop, deploy and securely scale container-based applications in multi- and hybrid-cloud environments.
Go
1,494
star
3

logging-operator

Logging operator for Kubernetes based on Fluentd and Fluentbit
Go
1,027
star
4

koperator

Oh no! Yet another Apache Kafka operator for Kubernetes
Go
782
star
5

istio-operator

An operator that manages Istio deployments on Kubernetes
Go
534
star
6

banzai-charts

Curated list of Banzai Cloud Helm charts used by the Pipeline Platform
Mustache
367
star
7

thanos-operator

Kubernetes operator for deploying Thanos
Go
280
star
8

pke

PKE is an extremely simple CNCF certified Kubernetes installer and distribution, designed to work on any cloud, VM or bare metal.
Go
263
star
9

hpa-operator

Horizontal Pod Autoscaler operator for Kubernetes. Annotate and let the HPA operator do the rest.
Go
239
star
10

dast-operator

Dynamic Application and API Security Testing
Go
189
star
11

spark-metrics

Spark metrics related custom classes and sinks (e.g. Prometheus)
Scala
175
star
12

cloudinfo

Cloud instance type and price information as a service
Go
165
star
13

hollowtrees

A ruleset based watchguard to keep spot/preemptible instance based clusters safe, with plugins for VMs, Kubernetes, Prometheus and Pipeline
Go
155
star
14

kurun

Run main.go in Kubernetes with one command, also port-forward your app into Kubernetes
Go
132
star
15

jwt-to-rbac

JWT-to-RBAC lets you automatically generate RBAC resources based on JWT tokens
Go
113
star
16

service-tools

Prepare your Node.js application for production
TypeScript
99
star
17

nodepool-labels-operator

Nodepool Labels operator for Kubernetes
Go
69
star
18

drone-kaniko

A thin shim-wrapper around the official Google Kaniko Docker image to make it behave like the Drone Docker plugin.
Shell
56
star
19

pvc-operator

Go
51
star
20

satellite

Determine your cloud provider with a simple HTTP call
Go
50
star
21

prometheus-jmx-exporter-operator

Go
45
star
22

chartsec

Helm Chart security scanner
Go
45
star
23

anchore-image-validator

Anchore Image Validator lets you automatically detect or block security issues just before a Kubernetes pod starts.
Go
44
star
24

spot-price-exporter

Prometheus exporter to track spot price history
Go
41
star
25

logrus-runtime-formatter

Golang runtime package based automatic function, line and package fields for Logrus
Go
40
star
26

kubeconfiger

Example tool for cleaning up untrusted kubeconfig files
Go
36
star
27

spot-termination-exporter

Prometheus spot instance exporter to monitor AWS instance termination with Hollowtrees
Go
36
star
28

imps

ImagePullSecrets controller allows you to distribute image pull secrets based on namespace/pod matches.
Go
32
star
29

banzai-cli

CLI for Banzai Cloud Pipeline platform
Go
30
star
30

allspark

AllSpark is a simple building block for quickly building web microservice deployments for demo purposes.
Go
26
star
31

istio-client-go

Golang API representation for Istio resources
Go
23
star
32

istio-external-demo

Working example for restricting access to external services from an Istio service mesh
23
star
33

k8s-cncf-meetup

Kubernetes and Cloud Native Computing Meetup slides
DIGITAL Command Language
19
star
34

spot-config-webhook

A Kubernetes mutating admission webhook that sets the scheduler of specific pods based on a ConfigMap.
Go
19
star
35

aws-billing-alarm

Shell
15
star
36

aws-autoscaling-exporter

Prometheus exporter with AWS auto scaling group and instance level metrics for Hollowtrees
Go
14
star
37

docker-cruise-control

Linkedin's Cruise Control container image built for Koperator (https://github.com/banzaicloud/koperator)
Shell
13
star
38

lambda-slack-bot

AWS Lambda Golang Slack bot to list running EC2 instances
Go
12
star
39

fluent-plugin-label-router

Fluentd plugin to route records based on Kubernetes labels and namespace
Ruby
11
star
40

preemption-exporter

Prometheus preemptible instance exporter to monitor GCP instance termination with Hollowtrees
Go
11
star
41

docker-kafka

Dockerfile to building Docker image for Apache Kafka
Dockerfile
10
star
42

ht-k8s-action-plugin

Hollowtrees plugin used to interact with Kubernetes on specific event triggers
Go
10
star
43

crd-updater

Helm 3 library chart that emulates Helm 2 CRD update behavior.
Go
10
star
44

jmx-exporter-loader

Java
10
star
45

go-code-generation-demo

Go
9
star
46

bank-vaults-workshop

Material for the Hacktivity 2019 - Bank-Vaults workshop
7
star
47

pipeline-cp-launcher

Pipeline ControlPlane launcher using AWS Cloudformation or Azure ARM template, running on Kubernetes
Makefile
7
star
48

go-cruise-control

It's client library written in Golang for interacting with Linkedin Cruise Control using its HTTP API.
Go
6
star
49

zeppelin-pdi-example

6
star
50

bank-vaults-docs

Bank-Vaults documentation
Shell
5
star
51

logging-operator-docs

Logging operator documentation
Shell
4
star
52

koperator-docs

Documentation for Koperator - the operator for managing Apache Kafka on Kubernetes
HTML
4
star
53

banzai-types

Common types, configs and utils used across several Banzai Cloud projects
Go
4
star
54

circleci-orbs

Makefile
3
star
55

ht-aws-asg-action-plugin

Hollowtrees plugin to detach instances from auto scaling groups
Go
3
star
56

drone-plugin-sonar

Drone plugin for static code analysis
Go
3
star
57

fluent-plugin-tag-normaliser

Fluent output plugin to transform tags based on record content
Ruby
2
star
58

cicd-go

A Go client for the Pipeline CI/CD subsystem
Go
2
star
59

gin-utilz

Gin framework utilities
Go
2
star
60

banzailint

Custom lint rules for Banzai Cloud code
Makefile
2
star
61

docker-jmx-exporter

Docker image for JMX-exporter
Dockerfile
2
star
62

.github

Github default files
1
star
63

developer-guide

Guide for developers on writing code and maintaining projects
1
star
64

cadence-aws-sdk

Cadence wrapper around the AWS Go SDK to make working with the AWS API easier in Cadence workflows
Go
1
star
65

drone-plugin-k8s-client

Drone plugin implementation for k8s operations
Go
1
star
66

thanos-operator-docs

Thanos operator documentation
Shell
1
star
67

dynamic-class-gen

Java
1
star
68

custom-runner

go custom runner
Go
1
star
69

cluster-registry

Go
1
star
70

log-socket

Service and CLI tool for forwarding logs through a WebSocket connection
Go
1
star
71

kube-service-annotate

A Kubernetes mutating webhook to annotate services based on rules
Go
1
star
72

pipeline-sdk

SDK for extending Pipeline
Go
1
star
73

integrated-service-sdk

Client SDK for the Integrated Service Operator
Go
1
star
74

pipeline-cp-images

Pipeline ControlPlane images
Shell
1
star
75

dockerized-newman

Automated end-2-end testing with Postman in Docker
1
star
76

drone-plugin-zeppelin-client

Zeppelin REST API client plugin for Drone. A step in the Pipeline PaaS CI/CD component to provision a Kubernetes cluster or use a managed one
Go
1
star