-
Notifications
You must be signed in to change notification settings - Fork 206
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
Convert result watcher deployment to statefulset ordinals #2616
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @mbpavan. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
The following is the coverage report on the affected files.
|
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.
It is important to validate these scenarios
- updating the config from deployment to sts, will delete IS, creataes new one, and creates the sts
- updating the config from sts to deployment(disabling statefulset-ordinals), switche the is deletes the sts and creates a deployment
- Upgrade scenario works fine (check that upgrade is not broken, by the feature, means upgrade in case of sts, upgraades in case we have a deployment)
disabled: false | ||
is_external_db: false | ||
options: {} | ||
performance: |
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 wanted to see the PipelinePerformanceProperties type being reused. We could move this type to the common package and use it wherever needed, instead of creating new types. This would ensure a more coherent configuration across the project
@PuneetPunamiya @khrm wdyt ?
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.
Now the options struct can set many attributes. This includes Deployment
, StatefulSet
, and even horizontalPodAutoscalers
.
operator/pkg/apis/operator/v1alpha1/additional_options.go
Lines 25 to 34 in 687d810
// additional options will be updated on the manifests | |
// these values will be final | |
type AdditionalOptions struct { | |
Disabled *bool `json:"disabled,omitempty"` | |
ConfigMaps map[string]corev1.ConfigMap `json:"configMaps,omitempty"` | |
Deployments map[string]appsv1.Deployment `json:"deployments,omitempty"` | |
HorizontalPodAutoscalers map[string]autoscalingv2.HorizontalPodAutoscaler `json:"horizontalPodAutoscalers,omitempty"` | |
StatefulSets map[string]appsv1.StatefulSet `json:"statefulSets,omitempty"` | |
WebhookConfigurationOptions map[string]WebhookConfigurationOptions `json:"webhookConfigurationOptions,omitempty"` | |
} |
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonConfig
metadata:
name: config
spec:
pipeline:
options:
disabled: false
deployments:
tekton-events-controller:
spec:
replicas: 1
horizontalPodAutoscalers:
tekton-pipelines-remote-resolvers:
spec:
maxReplicas: 5
metrics:
- resource:
name: cpu
target:
averageUtilization: 50
type: Utilization
type: Resource
- resource:
name: memory
target:
averageUtilization: 50
type: Utilization
type: Resource
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: tekton-pipelines-remote-resolvers
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 learned for the first time that there is a dedicated structure called PipelinePerformanceProperties
. 😆
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.
@l-qing PipelinePerformanceProperties holds performance configuration for controllers(pipelines and resolvers) like bucket, replicas, statefulset-ordinals etc, I think it is not named well, it should be called, scalingconfiguration ous omething simular, it is may be somehow related to what you mention under options, may be it needs a big refactor
@@ -54,6 +54,7 @@ type TektonResultSpec struct { | |||
CommonSpec `json:",inline"` | |||
ResultsAPIProperties `json:",inline"` | |||
LokiStackProperties `json:",inline"` | |||
Performance ResultPerformanceProperties `json:"performance,omitempty"` |
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 check my comment regarding reusing PipelinePerformanceProperties
if len(list.Items) != 1 { | ||
logger.Errorf("found more than 1 installerSet for %s something fishy, cleaning up all", isType) | ||
if len(list.Items) > 1 { | ||
logger.Errorf("Found more than 1 installerSet for %s; cleaning up all", isType) |
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/Found/found
@@ -34,6 +34,7 @@ const ( | |||
InstallerTypePre = "pre" | |||
InstallerTypePost = "post" | |||
InstallerTypeCustom = "custom" | |||
InstallerTypeResult = "result" |
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 dont need this
} | ||
|
||
// If the TektonResult's Spec for statefulset Replicas is non-nil and greater than 0, it updates the StatefulSet's replicas. | ||
func UpdateStatefulSetReplicasForResultWatcher(tr *v1alpha1.TektonResult) mf.Transformer { |
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.
use common method
ec956c0
to
7657020
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
Changes
Transforms the results watcher from a deployment to a statefulset, offering a horizontal scaling option, instead of using leader election.
Limitation: This PR is specific to results watcher. However for results api, making the deployment to a statefulset ordinal does not increase performance due to sticky grpc sessions from the client, we would need to figure out another way to load balance incoming requests.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lint
before submitting a PRSee the contribution guide for more details.
Release Notes