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

Put recommendation result into target's annotation #98

Closed
qmhu opened this issue Jan 12, 2022 · 6 comments
Closed

Put recommendation result into target's annotation #98

qmhu opened this issue Jan 12, 2022 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers kind/feature

Comments

@qmhu
Copy link
Member

qmhu commented Jan 12, 2022

Describe the feature

currently the recommendation result is present on recommendation.status, we can also put it into target's annotation.
this feature should be an option in recommendation's spec.

@qmhu qmhu added enhancement New feature or request good first issue Good for newcomers labels Jan 12, 2022
@mfanjie
Copy link
Contributor

mfanjie commented Jan 14, 2022

can you elaborate more about what's the reason of putting the recommendation to annotation?

@qmhu
Copy link
Member Author

qmhu commented Jan 18, 2022

Currently we put the recommendation result in recommendation.status like this:

apiVersion: analysis.crane.io/v1alpha1
kind: Analytics
metadata:
  name: craned-hpa
  namespace: crane-system
spec:
  completionStrategy:
    completionStrategyType: Periodical
    periodSeconds: 86400
  resourceSelectors:
  - apiVersion: apps/v1
    kind: Deployment
    labelSelector: {}
    name: craned
  type: HPA
status:
  lastSuccessfulTime: "2022-01-13T07:26:18Z"
  recommendations:
  - apiVersion: analysis.crane.io/v1alpha1
    kind: Recommendation
    name: craned-hpa-hpa-2f22w
    namespace: crane-system
    uid: 397733ee-986a-4630-af75-736d2b58bfac

We can also put the result into target's annotation, then user can view the result from target's annotation, it's convenient for dashboard requirements and so on.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: php-apache
  annotations:
    analysis.crane.io/recommend-hpa: {json encoded string}

@mfanjie
Copy link
Contributor

mfanjie commented Jan 26, 2022

firstly I think the reference is defined in Analytics and Recommendation, so if dashboard need the relation, it can get directly.
secondly, if we really want a reversed annotation in deployment, the recommendation name is enough already, right?

@qmhu
Copy link
Member Author

qmhu commented Jan 27, 2022

firstly I think the reference is defined in Analytics and Recommendation, so if dashboard need the relation, it can get directly. secondly, if we really want a reversed annotation in deployment, the recommendation name is enough already, right?

If customer have a deployment list and want to show the recommendation about it, if we only provide name, then they need to fetch N times to get all deployment's recommendation.

@qmhu
Copy link
Member Author

qmhu commented Feb 14, 2022

Api design :
gocrane/api#40

@qmhu
Copy link
Member Author

qmhu commented Mar 21, 2022

implement by #192

@qmhu qmhu closed this as completed Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers kind/feature
Projects
None yet
Development

No branches or pull requests

2 participants