-
Notifications
You must be signed in to change notification settings - Fork 83
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
WIP - feat: New ScalingSet CRD to deploy isolated interceptors+scalers #1014
base: main
Are you sure you want to change the base?
Conversation
54a9f5e
to
4e793d6
Compare
Signed-off-by: Jorge Turrado <[email protected]>
4e793d6
to
6e1700a
Compare
Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
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.
I like this approach very much, here is a couple of minor nitpicks from the first pass, I will take a deeper look later today
} | ||
|
||
// HTTPInterceptorConfigurationSepc defines the desired state of Interceptor configuration | ||
type HTTPInterceptorConfigurationSepc struct { |
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.
nit:
type HTTPInterceptorConfigurationSepc struct { | |
type HTTPInterceptorConfigurationSpec struct { |
// Port to be used for admin operations | ||
AdminPort *int32 `json:"adminPort,omitempty"` | ||
// +optional | ||
// Timeout for stablishing the connection |
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.
nit:
// Timeout for stablishing the connection | |
// Timeout for establishing the connection |
} | ||
|
||
// HTTPInterceptorSepc defines the desired state of Interceptor component | ||
type HTTPInterceptorSepc struct { |
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.
nit:
type HTTPInterceptorSepc struct { | |
type HTTPInterceptorSpec struct { |
} | ||
|
||
// HTTPScalerConfigurationSepc defines the desired state of scaler configuration | ||
type HTTPScalerConfigurationSepc struct { |
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.
nit:
type HTTPScalerConfigurationSepc struct { | |
type HTTPScalerConfigurationSpec struct { |
} | ||
|
||
// HTTPScalerSepc defines the desired state of Scaler component | ||
type HTTPScalerSepc struct { |
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 HTTPScalerSepc struct { | |
type HTTPScalerSpec struct { |
} | ||
|
||
// HTTPScalingSetStatus defines the observed state of HTTPScalingSet | ||
type HTTPScalingSetStatus struct{} |
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.
I am sure this is empty only because the PR is still WIP but for discussion sake mentioning controller may want to capture some conditions here, such as:
- unable to create interceptor/scaler
- kube-api rejects some resource creation
- failure to form the
externalScalerURI
- interceptor/scaler are not running with desired replica count and/or are unhealthy
- possibly getting some basic stats from interceptor admin endpoint?
|
||
|
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.
nit: I'd get rid of the empty lines
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.
First pass of review
} | ||
|
||
// HTTPScalingSetStatus defines the observed state of HTTPScalingSet | ||
type HTTPScalingSetStatus struct{} |
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.
We should provide some status about the resource, at least Ready
condition
ctx context.Context, | ||
logger logr.Logger, | ||
cl client.Client, | ||
httpss metav1.Object, |
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.
We should consider using duck types instead of metav1.Object here, to add some type safety.
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.
@wozniakjan has also an idea on this.
@@ -0,0 +1,33 @@ | |||
package util |
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.
I would try to avoid usage of util
package as much as possible. Would move it elsewhere.
I appreciate your feedback, I'll review it, but don't worry about reviewing the PR for the moment as it's still a WIP and there are a couple of pending stuff, like propagating the status info the the CRD, documentation, more test coverage , etc You can review it if you want, but there can be multiple changes until the final version :) |
"http.keda.sh/scaling-set-kind": string(httpKind), | ||
} | ||
|
||
scalerService := k8s.NewService(scalerName, httpss.GetNamespace(), grpc, httpSpec.Scaler.GetPort(), selector) |
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.
what would be namespace here if we are using ClusterSS?
err := createOrUpdateInterceptorResources( | ||
ctx, | ||
logger, | ||
r.Client, | ||
httpss, | ||
r.Scheme, | ||
) |
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.
err := createOrUpdateInterceptorResources( | |
ctx, | |
logger, | |
r.Client, | |
httpss, | |
r.Scheme, | |
) | |
err := createOrUpdateInterceptorResources(ctx, logger, r.Client, httpss, r.Scheme) |
Provide a description of what has been changed
Checklist
README.md
docs/
directoryFixes #241