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

add crane agent , int crane agent it contained the node-qos-ensurance-policy-controller #5

Merged
merged 5 commits into from
Dec 16, 2021

Conversation

yan234280533
Copy link
Contributor

to instead pr#4 which is lost associated

@yan234280533 yan234280533 self-assigned this Nov 22, 2021
@yan234280533 yan234280533 force-pushed the dev-ensurance-2-crane-agent branch 12 times, most recently from f103c04 to 946dbce Compare November 25, 2021 12:22
pkg/ensurance/executor/interface.go Outdated Show resolved Hide resolved
@@ -0,0 +1,12 @@
package opamock

func OpaEval(metricName string, targetValue float64, value float64) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here the function interface should be something like Eval(ctx, input).
metricName, targetValue... all these kind of things should not be placed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

type Logic interface {
EvalWithMetric(metricName string, targetValue float64, value float64) (bool, error)
EvalWithRaw(input string, rule string) (bool, error)
}

I modified it like this, please have a look it feasible now ?

- apiGroups:
- ""
resources:
- podqosensurancepolicies.ensurance.crane.io
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we design a more general thing replacing podqosensurancepolicies & nodeqosensurancepolicies?

@yan234280533 yan234280533 force-pushed the dev-ensurance-2-crane-agent branch 10 times, most recently from bc4c244 to cf69220 Compare November 30, 2021 12:58
@yan234280533 yan234280533 force-pushed the dev-ensurance-2-crane-agent branch 10 times, most recently from 398698e to 693fed1 Compare December 10, 2021 08:23
pkg/ensurance/avoidance/manager.go Outdated Show resolved Hide resolved
pkg/ensurance/avoidance/manager.go Outdated Show resolved Hide resolved
build.sh Outdated Show resolved Hide resolved
cmd/crane-agent/app/manager.go Outdated Show resolved Hide resolved
cmd/crane-agent/app/manager.go Outdated Show resolved Hide resolved
pkg/ensurance/grpcc/connection.go Show resolved Hide resolved
pkg/ensurance/informer/node.go Show resolved Hide resolved
pkg/ensurance/statestore/metricsserver/metricsserver.go Outdated Show resolved Hide resolved
pkg/ensurance/statestore/statstore.go Outdated Show resolved Hide resolved
pkg/ensurance/statestore/nodelocal/cpu.go Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/analyzer.go Outdated Show resolved Hide resolved

// Run runs the crane-agent with options. This should never exit.
func Run(ctx context.Context, opts *options.Options) error {
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Copy link
Member

Choose a reason for hiding this comment

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

Please remove all controller-runtime related codes since we don't use it in agent

build.sh Outdated Show resolved Hide resolved
pkg/ensurance/analyzer/analyzer.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/evict.go Outdated Show resolved Hide resolved
import (
v1 "k8s.io/api/core/v1"

einformer "github.com/gocrane/crane/pkg/ensurance/informer"
Copy link
Member

Choose a reason for hiding this comment

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

s/einformer/ensuranceinformer/g

pkg/ensurance/executor/schedule.go Outdated Show resolved Hide resolved
pkg/ensurance/executor/schedule.go Outdated Show resolved Hide resolved

// Run starts k8s informers
func (c *Context) Run() {
if c.podFactory != nil {
Copy link
Member

Choose a reason for hiding this comment

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

missing the check for start error and WaitForCacheSync error?

@@ -0,0 +1,208 @@
package runtime

import (
Copy link
Member

Choose a reason for hiding this comment

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

Since this pr is only about NodeQoS implement, these runtime and container codes can submit later?

@yan234280533 yan234280533 force-pushed the dev-ensurance-2-crane-agent branch 6 times, most recently from de24dde to b3318f8 Compare December 16, 2021 07:49
@yan234280533 yan234280533 force-pushed the dev-ensurance-2-crane-agent branch 2 times, most recently from c3d8143 to a686700 Compare December 16, 2021 08:28
@mfanjie mfanjie merged commit cb703b5 into gocrane:main Dec 16, 2021
@mfanjie
Copy link
Contributor

mfanjie commented Dec 16, 2021

/lgtm

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.

None yet

4 participants