Skip to content

Commit 6ae744e

Browse files
committed
Remove polling period from evaluator
Evaluator will receive events when poller changes, so naturally this option was not even used. Although it could become a problem for external pollers, but we will cross that bridge when (if) we get there.
1 parent 345140f commit 6ae744e

8 files changed

+19
-31
lines changed

api/autoscaler/v1alpha1/mostwantedtwophasehysteresisevaluation_types.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ import (
2525
type MostWantedTwoPhaseHysteresisEvaluationSpec struct {
2626
common.EvaluatorSpec `json:",inline"`
2727

28-
// PollingPeriod is the period for polling the partitioning.
29-
// +kubebuilder:validation:Required
30-
PollingPeriod metav1.Duration `json:"pollingPeriod,omitempty"`
31-
3228
// StabilizationPeriod is the amount of time to wait before evaluating historical records.
3329
// Older historical records are always pruned.
3430
// +kubebuilder:validation:Required

api/autoscaler/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/autoscaler.argoproj.io_mostwantedtwophasehysteresisevaluations.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,13 @@ spec:
7575
- name
7676
type: object
7777
x-kubernetes-map-type: atomic
78-
pollingPeriod:
79-
description: PollingPeriod is the period for polling the partitioning.
80-
type: string
8178
stabilizationPeriod:
8279
description: |-
8380
StabilizationPeriod is the amount of time to wait before evaluating historical records.
8481
Older historical records are always pruned.
8582
type: string
8683
required:
8784
- partitionProviderRef
88-
- pollingPeriod
8985
- stabilizationPeriod
9086
type: object
9187
status:

config/default-scaling-strategy/autoscaler_v1alpha1_mostwantedtwophasehysteresisevaluation.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ spec:
99
apiGroup: autoscaler.argoproj.io
1010
kind: LongestProcessingTimePartition
1111
name: default
12-
pollingPeriod: 1h
1312
stabilizationPeriod: 24h

config/default-scaling-strategy/autoscaler_v1alpha1_prometheuspoll.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,48 @@ spec:
99
apiGroup: autoscaler.argoproj.io
1010
kind: SecretTypeClusterShardManager
1111
name: default
12-
period: 1h
12+
period: 1m
1313
address: http://prometheus.prometheus.svc.cluster.local:9090
1414
metrics:
1515
- id: argocd_app_info
1616
query: |-
1717
quantile_over_time(
18-
0.50,
18+
0.95,
1919
(
2020
sum(argocd_app_info{job="argocd-metrics",namespace="{{ .namespace }}",dest_server="{{ .server }}"})
21-
)[24h:1m]
21+
)[1h:1m]
2222
)
2323
- id: argocd_cluster_api_resource_objects
2424
query: |-
2525
quantile_over_time(
26-
0.50,
26+
0.95,
2727
(
2828
sum(argocd_cluster_api_resource_objects{job="argocd-metrics",namespace="{{ .namespace }}",server="{{ .server }}"})
29-
)[24h:1m]
29+
)[1h:1m]
3030
)
3131
- id: argocd_cluster_api_resources
3232
query: |-
3333
quantile_over_time(
34-
0.50,
34+
0.95,
3535
(
3636
sum(argocd_cluster_api_resources{job="argocd-metrics",namespace="{{ .namespace }}",server="{{ .server }}"})
37-
)[24h:1m]
37+
)[1h:1m]
3838
)
3939
- id: argocd_app_reconcile_count
4040
query: |-
4141
quantile_over_time(
42-
0.50,
42+
0.95,
4343
(
4444
sum(increase(argocd_app_reconcile_count{job="argocd-metrics",namespace="{{ .namespace }}",dest_server="{{ .server }}"}[1m]))
45-
)[24h:1m]
45+
)[1h:1m]
4646
)
4747
- id: argocd_cluster_events_total
4848
query: |-
4949
quantile_over_time(
50-
0.50,
50+
0.95,
5151
(
5252
sum(increase(argocd_cluster_events_total{job="argocd-metrics",namespace="{{ .namespace }}",server="{{ .server }}"}[1m]))
53-
)[24h:1m]
53+
)[1h:1m]
5454
)
5555
- id: argocd_app_k8s_request_total
5656
noData: "0"
@@ -61,10 +61,10 @@ spec:
6161
{{- $server = "https://100.64.0.1:443" -}}
6262
{{- end -}}
6363
quantile_over_time(
64-
0.50,
64+
0.95,
6565
(
6666
sum(increase(argocd_app_k8s_request_total{job="argocd-metrics",namespace="{{ .namespace }}",server="{{ $server }}"}[1m]))
67-
)[24h:1m]
67+
)[1h:1m]
6868
)
6969
- id: rest_client_requests_total
7070
query: |-
@@ -75,8 +75,8 @@ spec:
7575
{{- $host = "100.64.0.1:443" -}}
7676
{{- end -}}
7777
quantile_over_time(
78-
0.50,
78+
0.95,
7979
(
8080
sum(increase(rest_client_requests_total{job="argocd-metrics",namespace="{{ .namespace }}",host="{{ $host }}"}[1m]))
81-
)[24h:1m]
81+
)[1h:1m]
8282
)

config/e2e/samples/autoscaler_v1alpha1_mostwantedtwophasehysteresisevaluation.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ spec:
99
apiGroup: autoscaler.argoproj.io
1010
kind: LongestProcessingTimePartition
1111
name: sample
12-
pollingPeriod: 5s
1312
stabilizationPeriod: 1m

internal/controller/autoscaler/mostwantedtwophasehysteresisevaluation_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ func (r *MostWantedTwoPhaseHysteresisEvaluationReconciler) Reconcile(ctx context
336336
}
337337
log.Info("Resource status updated", "projection", len(evaluation.Status.Projection))
338338

339-
// Re-queue for the next poll
340-
return ctrl.Result{RequeueAfter: evaluation.Spec.PollingPeriod.Duration}, nil
339+
// We should get a reconciliation request when poller is changed
340+
return ctrl.Result{}, nil
341341
}
342342

343343
// SetupWithManager sets up the controller with the Manager.

internal/controller/autoscaler/mostwantedtwophasehysteresisevaluation_controller_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ var _ = Describe("MostWantedTwoPhaseHysteresisEvaluation Controller", func() {
8282
Name: "N/A",
8383
},
8484
},
85-
PollingPeriod: metav1.Duration{Duration: time.Second},
8685
StabilizationPeriod: metav1.Duration{Duration: 5 * time.Minute},
8786
},
8887
},
@@ -209,7 +208,7 @@ var _ = Describe("MostWantedTwoPhaseHysteresisEvaluation Controller", func() {
209208
func(run *ScenarioRun[*autoscalerv1alpha1.MostWantedTwoPhaseHysteresisEvaluation]) {
210209
Expect(run.ReconcileError()).ToNot(HaveOccurred())
211210
Expect(run.ReconcileResult().RequeueAfter).
212-
To(Equal(run.Container().Object().Spec.PollingPeriod.Duration))
211+
To(Equal(time.Duration(0)))
213212
Expect(run.ReconcileResult().Requeue).To(BeFalse())
214213

215214
By("Checking conditions")
@@ -248,7 +247,7 @@ var _ = Describe("MostWantedTwoPhaseHysteresisEvaluation Controller", func() {
248247

249248
Expect(run.ReconcileError()).ToNot(HaveOccurred())
250249
Expect(run.ReconcileResult().RequeueAfter).
251-
To(Equal(run.Container().Object().Spec.PollingPeriod.Duration))
250+
To(Equal(time.Duration(0)))
252251
Expect(run.ReconcileResult().Requeue).To(BeFalse())
253252

254253
By("Checking conditions")

0 commit comments

Comments
 (0)