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

WIP - feat: New ScalingSet CRD to deploy isolated interceptors+scalers #1014

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

JorTurFer
Copy link
Member

Provide a description of what has been changed

Checklist

Fixes #241

@JorTurFer JorTurFer requested a review from a team as a code owner May 5, 2024 00:27
JorTurFer and others added 4 commits May 12, 2024 22:26
Signed-off-by: Jorge Turrado <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
Copy link
Member

@wozniakjan wozniakjan left a 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 {
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
type HTTPInterceptorConfigurationSepc struct {
type HTTPInterceptorConfigurationSpec struct {

// Port to be used for admin operations
AdminPort *int32 `json:"adminPort,omitempty"`
// +optional
// Timeout for stablishing the connection
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
// Timeout for stablishing the connection
// Timeout for establishing the connection

}

// HTTPInterceptorSepc defines the desired state of Interceptor component
type HTTPInterceptorSepc struct {
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
type HTTPInterceptorSepc struct {
type HTTPInterceptorSpec struct {

}

// HTTPScalerConfigurationSepc defines the desired state of scaler configuration
type HTTPScalerConfigurationSepc struct {
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
type HTTPScalerConfigurationSepc struct {
type HTTPScalerConfigurationSpec struct {

}

// HTTPScalerSepc defines the desired state of Scaler component
type HTTPScalerSepc struct {
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
type HTTPScalerSepc struct {
type HTTPScalerSpec struct {

}

// HTTPScalingSetStatus defines the observed state of HTTPScalingSet
type HTTPScalingSetStatus struct{}
Copy link
Member

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?

Comment on lines +2 to +3


Copy link
Member

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

Suggested change

Copy link
Member

@zroubalik zroubalik left a 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{}
Copy link
Member

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,
Copy link
Member

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.

Copy link
Member

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
Copy link
Member

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.

@JorTurFer
Copy link
Member Author

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 :)

@JorTurFer JorTurFer marked this pull request as draft May 16, 2024 09:05
"http.keda.sh/scaling-set-kind": string(httpKind),
}

scalerService := k8s.NewService(scalerName, httpss.GetNamespace(), grpc, httpSpec.Scaler.GetPort(), selector)
Copy link
Member

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?

Comment on lines +88 to +94
err := createOrUpdateInterceptorResources(
ctx,
logger,
r.Client,
httpss,
r.Scheme,
)
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
err := createOrUpdateInterceptorResources(
ctx,
logger,
r.Client,
httpss,
r.Scheme,
)
err := createOrUpdateInterceptorResources(ctx, logger, r.Client, httpss, r.Scheme)

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.

Enable dedicated interceptor/scalers with the same operator
3 participants