-
Notifications
You must be signed in to change notification settings - Fork 376
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
add crane agent , int crane agent it contained the node-qos-ensurance-policy-controller #5
Conversation
f103c04
to
946dbce
Compare
pkg/ensurance/opamock/opamock.go
Outdated
@@ -0,0 +1,12 @@ | |||
package opamock | |||
|
|||
func OpaEval(metricName string, targetValue float64, value float64) (bool, error) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ?
deploy/deploy/crane-agent/rbac.yaml
Outdated
- apiGroups: | ||
- "" | ||
resources: | ||
- podqosensurancepolicies.ensurance.crane.io |
There was a problem hiding this comment.
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?
bc4c244
to
cf69220
Compare
398698e
to
693fed1
Compare
693fed1
to
618c625
Compare
cmd/crane-agent/app/manager.go
Outdated
|
||
// 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{ |
There was a problem hiding this comment.
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
import ( | ||
v1 "k8s.io/api/core/v1" | ||
|
||
einformer "github.com/gocrane/crane/pkg/ensurance/informer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/einformer/ensuranceinformer/g
|
||
// Run starts k8s informers | ||
func (c *Context) Run() { | ||
if c.podFactory != nil { |
There was a problem hiding this comment.
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 ( |
There was a problem hiding this comment.
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?
de24dde
to
b3318f8
Compare
c3d8143
to
a686700
Compare
/lgtm |
to instead pr#4 which is lost associated