Skip to content

Commit efed2a6

Browse files
committed
release 0.3.0
1 parent 6bd6ce8 commit efed2a6

File tree

5 files changed

+245
-225
lines changed

5 files changed

+245
-225
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ image-metric-adapter: ## Build docker image with the metric adapter.
144144
docker build --build-arg LDFLAGS=$(LDFLAGS) --build-arg PKGNAME=metric-adapter -t ${ADAPTER_IMG} .
145145

146146
.PHONY: push-images
147-
push-images: push-image-craned push-image-crane-agent push-image-metric-adapter
147+
push-images: push-image-craned push-image-crane-agent push-image-metric-adapter push-image-dashboard
148148

149149
.PHONY: push-image-craned
150150
push-image-craned: ## Push images.

README.md

Lines changed: 21 additions & 223 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ Crane (FinOps Crane) is a cloud native open source project which manages cloud r
2222
- [Getting Started](#getting-started)
2323
- [Installation](#installation)
2424
- [Get your Kubernetes Cost Report](#get-your-kubernetes-cost-report)
25-
- [Analytics and Recommend Pod Resources](#analytics-and-recommend-pod-resources)
26-
- [Analytics and Recommend HPA](#analytics-and-recommend-hpa)
25+
- [Analytics and Recommendation](#analytics-and-recommendation)
2726
- [RoadMap](#roadmap)
2827
- [Contributing](#Contributing)
2928
- [Code of Conduct](#Code-of-Conduct)
@@ -46,8 +45,8 @@ The goal of Crane is to provide a one-stop-shop project to help Kubernetes users
4645
## Features
4746
### Time Series Prediction
4847

49-
Crane predictor fetches metric data, and then outputs the prediction results.
50-
The prediction result can be consumed by other crane components, like [EHPA](#effective-horizontalpodautoscaler) and [Analytics](#analytics).
48+
TimeSeriesPrediction defines metric spec to predict kubernetes resources like Pod or Node.
49+
The prediction module is the core component that other crane components relied on, like [EHPA](#effective-horizontalpodautoscaler) and [Analytics](#analytics).
5150

5251
Please see [this document](./docs/tutorials/using-time-series-prediction.md) to learn more.
5352

@@ -82,8 +81,9 @@ Crane is composed of the following components:
8281
- **Predictor** - Predicts resources metrics trends based on historical data.
8382
- **AnalyticsController** - Analyzes resources and generate related recommendations.
8483
- **RecommendationController** - Recommend Pod resource requests and autoscaler.
85-
- **NodeResourceController** - Re-allocate node resource based on prediction result.
86-
- **EffectiveHPAController** - Effective HPA based on prediction result.
84+
- **ClusterNodePredictionController** - Create Predictor for nodes.
85+
- **EffectiveHPAController** - Effective HPA for horizontal scaling.
86+
- **EffectiveHPAController** - Effective VPA for vertical scaling.
8787
- [metric-adaptor](cmd/metric-adapter). - Metric server for driving the scaling.
8888
- [crane-agent](cmd/crane-agent). - Ensure critical workloads SLO based on abnormally detection.
8989
- [gocrane/api](https://github.com/gocrane/api). This repository defines component-level APIs for the Crane platform.
@@ -139,13 +139,18 @@ kubectl get deploy -n crane-system
139139

140140
The output is similar to:
141141
```console
142-
NAME READY UP-TO-DATE AVAILABLE AGE
143-
craned 1/1 1 1 60m
144-
fadvisor 1/1 1 1 60m
145-
grafana 1/1 1 1 60m
146-
metric-adapter 1/1 1 1 60m
147-
prometheus-kube-state-metrics 1/1 1 1 61m
148-
prometheus-server 1/1 1 1 61m
142+
NAME READY STATUS RESTARTS AGE
143+
crane-agent-8h7df 1/1 Running 0 119m
144+
crane-agent-8qf5n 1/1 Running 0 119m
145+
crane-agent-h9h5d 1/1 Running 0 119m
146+
craned-5c69c684d8-dxmhw 2/2 Running 0 20m
147+
grafana-7fddd867b4-kdxv2 1/1 Running 0 41m
148+
metric-adapter-94b6f75b-k8h7z 1/1 Running 0 119m
149+
prometheus-kube-state-metrics-6dbc9cd6c9-dfmkw 1/1 Running 0 45m
150+
prometheus-node-exporter-bfv74 1/1 Running 0 45m
151+
prometheus-node-exporter-s6zps 1/1 Running 0 45m
152+
prometheus-node-exporter-x5rnm 1/1 Running 0 45m
153+
prometheus-server-5966b646fd-g9vxl 2/2 Running 0 45m
149154
```
150155

151156
you can see [this](https://github.com/gocrane/helm-charts) to learn more.
@@ -179,218 +184,11 @@ kubectl --namespace crane-system port-forward $POD_NAME 3000
179184

180185
visit [Cost Report](http://127.0.0.1:3000/dashboards) here with account(admin:admin).
181186

182-
### Analytics and Recommend Pod Resources
187+
### Analytics and Recommendation
183188

184-
Create an **Resource** `Analytics` to give recommendation for deployment: `craned` and `metric-adapter` as a sample.
189+
Crane supports analytics and give recommend advise for your k8s cluster.
185190

186-
```console
187-
kubectl apply -f https://raw.githubusercontent.com/gocrane/crane/main/examples/analytics/analytics-resource.yaml
188-
kubectl get analytics -n crane-system
189-
```
190-
191-
The output is:
192-
193-
```console
194-
NAME AGE
195-
craned-resource 15m
196-
metric-adapter-resource 15m
197-
```
198-
199-
You can get created recommendation from analytics status:
200-
201-
```console
202-
kubectl get analytics craned-resource -n crane-system -o yaml
203-
```
204-
205-
The output is similar to:
206-
207-
```console
208-
apiVersion: analysis.crane.io/v1alpha1
209-
kind: Analytics
210-
metadata:
211-
name: craned-resource
212-
namespace: crane-system
213-
spec:
214-
completionStrategy:
215-
completionStrategyType: Periodical
216-
periodSeconds: 86400
217-
resourceSelectors:
218-
- apiVersion: apps/v1
219-
kind: Deployment
220-
labelSelector: {}
221-
name: craned
222-
type: Resource
223-
status:
224-
lastSuccessfulTime: "2022-01-12T08:40:59Z"
225-
recommendations:
226-
- name: craned-resource-resource-j7shb
227-
namespace: crane-system
228-
uid: 8ce2eedc-7969-4b80-8aee-fd4a98d6a8b6
229-
```
230-
231-
The recommendation name presents on `status.recommendations[0].name`. Then you can get recommendation detail by running:
232-
233-
```console
234-
kubectl get recommend -n crane-system craned-resource-resource-j7shb -o yaml
235-
```
236-
237-
The output is similar to:
238-
239-
```console
240-
apiVersion: analysis.crane.io/v1alpha1
241-
kind: Recommendation
242-
metadata:
243-
name: craned-resource-resource-j7shb
244-
namespace: crane-system
245-
ownerReferences:
246-
- apiVersion: analysis.crane.io/v1alpha1
247-
blockOwnerDeletion: false
248-
controller: false
249-
kind: Analytics
250-
name: craned-resource
251-
uid: a9e6dc0d-ab26-4f2a-84bd-4fe9e0f3e105
252-
spec:
253-
completionStrategy:
254-
completionStrategyType: Periodical
255-
periodSeconds: 86400
256-
targetRef:
257-
apiVersion: apps/v1
258-
kind: Deployment
259-
name: craned
260-
namespace: crane-system
261-
type: Resource
262-
status:
263-
conditions:
264-
- lastTransitionTime: "2022-01-12T08:40:59Z"
265-
message: Recommendation is ready
266-
reason: RecommendationReady
267-
status: "True"
268-
type: Ready
269-
lastSuccessfulTime: "2022-01-12T08:40:59Z"
270-
lastUpdateTime: "2022-01-12T08:40:59Z"
271-
resourceRequest:
272-
containers:
273-
- containerName: craned
274-
target:
275-
cpu: 114m
276-
memory: 120586239m
277-
```
278-
279-
The `status.resourceRequest` is recommended by crane's recommendation engine.
280-
281-
Something you should know about Resource recommendation:
282-
* Resource Recommendation use historic prometheus metrics to calculate and propose.
283-
* We use **Percentile** algorithm to process metrics that also used by VPA.
284-
* If the workload is running for a long term like several weeks, the result will be more accurate.
285-
286-
### Analytics and Recommend HPA
287-
288-
Create an **HPA** `Analytics` to give recommendation for deployment: `craned` and `metric-adapter` as an sample.
289-
290-
```console
291-
kubectl apply -f https://raw.githubusercontent.com/gocrane/crane/main/examples/analytics/analytics-hpa.yaml
292-
kubectl get analytics -n crane-system
293-
```
294-
295-
The output is:
296-
297-
```console
298-
NAME AGE
299-
craned-hpa 5m52s
300-
craned-resource 18h
301-
metric-adapter-hpa 5m52s
302-
metric-adapter-resource 18h
303-
304-
```
305-
306-
You can get created recommendation from analytics status:
307-
308-
```console
309-
kubectl get analytics craned-hpa -n crane-system -o yaml
310-
```
311-
312-
The output is similar to:
313-
314-
```console
315-
apiVersion: analysis.crane.io/v1alpha1
316-
kind: Analytics
317-
metadata:
318-
name: craned-hpa
319-
namespace: crane-system
320-
spec:
321-
completionStrategy:
322-
completionStrategyType: Periodical
323-
periodSeconds: 86400
324-
resourceSelectors:
325-
- apiVersion: apps/v1
326-
kind: Deployment
327-
labelSelector: {}
328-
name: craned
329-
type: HPA
330-
status:
331-
lastSuccessfulTime: "2022-01-13T07:26:18Z"
332-
recommendations:
333-
- apiVersion: analysis.crane.io/v1alpha1
334-
kind: Recommendation
335-
name: craned-hpa-hpa-2f22w
336-
namespace: crane-system
337-
uid: 397733ee-986a-4630-af75-736d2b58bfac
338-
```
339-
340-
The recommendation name presents on `status.recommendations[0].name`. Then you can get recommendation detail by running:
341-
342-
```console
343-
kubectl get recommend -n crane-system craned-resource-resource-j7shb -o yaml
344-
```
345-
346-
The output is similar to:
347-
348-
```console
349-
apiVersion: analysis.crane.io/v1alpha1
350-
kind: Recommendation
351-
metadata:
352-
name: craned-hpa-hpa-2f22w
353-
namespace: crane-system
354-
ownerReferences:
355-
- apiVersion: analysis.crane.io/v1alpha1
356-
blockOwnerDeletion: false
357-
controller: false
358-
kind: Analytics
359-
name: craned-hpa
360-
uid: b216d9c3-c52e-4c9c-b9e9-9d5b45165b1d
361-
spec:
362-
completionStrategy:
363-
completionStrategyType: Periodical
364-
periodSeconds: 86400
365-
targetRef:
366-
apiVersion: apps/v1
367-
kind: Deployment
368-
name: craned
369-
namespace: crane-system
370-
type: HPA
371-
status:
372-
conditions:
373-
- lastTransitionTime: "2022-01-13T07:51:18Z"
374-
message: 'Failed to offer recommend, Recommendation crane-system/craned-hpa-hpa-2f22w
375-
error EHPAAdvisor prediction metrics data is unexpected, List length is 0 '
376-
reason: FailedOfferRecommend
377-
status: "False"
378-
type: Ready
379-
lastUpdateTime: "2022-01-13T07:51:18Z"
380-
```
381-
382-
The `status.resourceRequest` is recommended by crane's recommendation engine. The fail reason is demo workload don't have enough run time.
383-
384-
Something you should know about HPA recommendation:
385-
* HPA Recommendation use historic prometheus metrics to calculate, forecast and propose.
386-
* We use **DSP** algorithm to process metrics.
387-
* We recommend using Effective HorizontalPodAutoscaler to execute autoscaling, you can see [this document](./docs/tutorials/using-time-series-prediction.md) to learn more.
388-
* The Workload need match following conditions:
389-
* Existing at least one ready pod
390-
* Ready pod ratio should larger that 50%
391-
* Must provide cpu request for pod spec
392-
* The workload should be running for at least **a week** to get enough metrics to forecast
393-
* The workload's cpu load should be predictable, **too low** or **too unstable** workload often is unpredictable
191+
Please follow [this guide](./docs/tutorials/analytics-and-recommendation.md) to learn more.
394192

395193
## RoadMap
396194
Please see [this document](./docs/roadmaps/roadmap-1h-2022.md) to learn more.

0 commit comments

Comments
 (0)