Skip to content
forked from gocrane/crane

Crane (FinOps Crane) is an opensource project which manages cloud resource on Kubernetes stack, it is inspired by FinOps concepts.

License

Notifications You must be signed in to change notification settings

sammyluck/crane

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crane: Cloud Resource Analytics and Economics

Go Report Card GoDoc License GoVersion

Crane logo


Crane (FinOps Crane) is a cloud native open source project which manages cloud resources on Kubernetes stack, it is inspired by FinOps concepts.

Introduction

The goal of Crane is to provide a one-stop-shop project to help Kubernetes users to save cloud resource usage with a rich set of functionalities:

  • Time Series Prediction based on monitoring data
  • Usage and Cost visibility
  • Usage & Cost Optimization including:
    • R2 (Resource Re-allocation)
    • R3 (Request & Replicas Recommendation)
    • Effective Pod Autoscaling (Effective Horizontal & Vertical Pod Autoscaling)
    • Cost Optimization
  • Enhanced QoS based on Pod PriorityClass

Crane Overview

Features

Time Series Prediction

Crane predictor fetches metric data, and then outputs the prediction results. The prediction result can be consumed by other crane components, like EHPA and Analytics.

Please see this document to learn more.

Effective HorizontalPodAutoscaler

EffectiveHorizontalPodAutoscaler helps you manage application scaling in an easy way. It is compatible with native HorizontalPodAutoscaler but extends more features like prediction-driven autoscaling.

Please see this document to learn more.

Analytics

Analytics model analyzes the workload and provide recommendations about resource optimize.

Two Recommendations are currently supported:

  • ResourceRecommend: Recommend container requests & limit resources based on historic metrics.
  • Effective HPARecommend: Recommend which workloads are suitable for autoscaling and provide optimized configurations such as minReplicas, maxReplicas.

QoS Ensurance

Repositories

Crane is composed of the following components:

  • craned. - main crane control plane.
    • Predictor - Predicts resources metrics trends based on historical data.
    • AnalyticsController - Analyzes resources and generate related recommendations.
    • RecommendationController - Recommend Pod resource requests and autoscaler.
    • NodeResourceController - Re-allocate node resource based on prediction result.
    • EffectiveHPAController - Effective HPA based on prediction result.
  • metric-adaptor. - Metric server for driving the scaling.
  • crane-agent. - Ensure critical workloads SLO based on abnormally detection.
  • gocrane/api. This repository defines component-level APIs for the Crane platform.
  • gocrane/fadvisor Financial advisor which collect resource prices from cloud API.

Getting Started

Prerequisites

  • Kubernetes 1.18+
  • Helm 3.1.0

Installation

Installing prometheus components with helm chart

Note: If you already deployed prometheus, prometheus-node-exporter, then you can skip this step.

Export the following env if you want to use default settings, or specify customized value if you want to customize the installation.

export NAMESPACE=monitoring
export RELEASE_NAME=myprometheus

Crane use prometheus to be the default metric provider. Using following command to install prometheus components.

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update

helm install $RELEASE_NAME -n $NAMESPACE --set kubeStateMetrics.enabled=false --set pushgateway.enabled=false --set alertmanager.enabled=false --set server.persistentVolume.enabled=false --create-namespace  prometheus-community/prometheus

Configure Prometheus Address

The following command will configure prometheus http address for crane. Specify CUSTOMIZE_PROMETHEUS if you have existing prometheus server.

export CUSTOMIZE_PROMETHEUS=
if [ ! $CUSTOMIZE_PROMETHEUS ]; then sed -i '' "s/PROMETHEUS_ADDRESS/http:\/\/${RELEASE_NAME}-server.${NAMESPACE}.svc.cluster.local/" deploy/craned/deployment.yaml ; else sed -i '' "s/PROMETHEUS_ADDRESS/${CUSTOMIZE_PROMETHEUS}/" deploy/craned/deployment.yaml ; fi

Deploying Crane

You can deploy Crane by apply YAML declaration.

kubectl apply -f deploy/manifests 
kubectl apply -f deploy/craned 
kubectl apply -f deploy/metric-adapter

About

Crane (FinOps Crane) is an opensource project which manages cloud resource on Kubernetes stack, it is inspired by FinOps concepts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.2%
  • Makefile 2.3%
  • Other 0.5%