Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(analytics): Analytics refactor #307

Merged
merged 2 commits into from
May 17, 2022
Merged

Conversation

qmhu
Copy link
Member

@qmhu qmhu commented May 9, 2022

What type of PR is this?

Feature

What this PR does / why we need it:

Use RecommendationMission to track recommendation's lifecycle.
Add docs for Analytics and Recommendation.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2022

♻️ PR Preview 3449055 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@github-actions
Copy link
Contributor

github-actions bot commented May 12, 2022

🎉 Successfully Build Images.

Overview: https://finops.coding.net/public-artifacts/gocrane/crane/packages

Image Pull Command
crane-agent:pr-307-3449055 docker pull finops-docker.pkg.coding.net/gocrane/crane/crane-agent:pr-307-3449055
dashboard:pr-307-3449055 docker pull finops-docker.pkg.coding.net/gocrane/crane/dashboard:pr-307-3449055
metric-adapter:pr-307-3449055 docker pull finops-docker.pkg.coding.net/gocrane/crane/metric-adapter:pr-307-3449055
craned:pr-307-3449055 docker pull finops-docker.pkg.coding.net/gocrane/crane/craned:pr-307-3449055


分析和推荐提供了一套自动化的成本优化能力,它帮助用户自动的发现问题并提供优化的方案。就像电脑/手机助手一样,它会定期的扫描、分析你的集群并给出推荐建议。目前,我们提供了两种优化能力:

- **资源推荐**: 基于应用的历史资源使用推荐 Container 合适的 requests 和 limits
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **资源推荐**: 基于应用的历史资源使用推荐 Container 合适的 requests 和 limits
- **资源推荐**: 基于应用的历史资源使用,为 Container 推荐合适的 requests 和 limits

kubectl apply -f https://raw.githubusercontent.com/gocrane/crane/main/examples/analytics/analytics-hpa.yaml
kubectl get analytics -n crane-system
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2022-05-12 22 29 54

We can use this feature to show details if the user wants.

Don't forget to enable this feature in mkdocs.yml.

markdown_extensions:
  - pymdownx.details

Suggested change
??? example "analytics-hpa.yaml"
```yaml
apiVersion: analysis.crane.io/v1alpha1
kind: Analytics
metadata:
name: craned-hpa
namespace: crane-system
spec:
type: HPA # This can only be "Resource" or "HPA".
completionStrategy:
completionStrategyType: Periodical # This can only be "Once" or "Periodical".
periodSeconds: 600 # analytics selected resources every 10 minutes
resourceSelectors: # defines all the resources to be select with
- kind: Deployment
apiVersion: apps/v1
name: craned
---
apiVersion: analysis.crane.io/v1alpha1
kind: Analytics
metadata:
name: metric-adapter-hpa
namespace: crane-system
spec:
type: HPA # This can only be "Resource" or "HPA".
completionStrategy:
completionStrategyType: Periodical # This can only be "Once" or "Periodical".
periodSeconds: 3600 # analytics selected resources every 1 hour
resourceSelectors: # defines all the resources to be select with
- kind: Deployment
apiVersion: apps/v1
name: metric-adapter
```

@qmhu qmhu force-pushed the analytics_refactor branch 2 times, most recently from a666a56 to 4a6ab20 Compare May 13, 2022 03:46
@qmhu qmhu force-pushed the analytics_refactor branch 3 times, most recently from 436c50c to a491692 Compare May 15, 2022 12:41
@yufeiyu
Copy link
Contributor

yufeiyu commented May 16, 2022

LGTM

@qmhu qmhu force-pushed the analytics_refactor branch 2 times, most recently from 0bd184b to 7c3447e Compare May 16, 2022 09:11
docs/tutorials/analytics-and-recommendation.md Outdated Show resolved Hide resolved
docs/tutorials/hpa-recommendation.md Outdated Show resolved Hide resolved
docs/tutorials/hpa-recommendation.md Outdated Show resolved Hide resolved
docs/tutorials/hpa-recommendation.md Outdated Show resolved Hide resolved
docs/tutorials/hpa-recommendation.md Outdated Show resolved Hide resolved
docs/tutorials/resource-recommendation.md Outdated Show resolved Hide resolved
docs/tutorials/resource-recommendation.md Outdated Show resolved Hide resolved
docs/tutorials/resource-recommendation.zh.md Outdated Show resolved Hide resolved
Co-authored-by: zsnmwy <35299017+zsnmwy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete recommendation CR after its workload got removed.
3 participants