operator icon indicating copy to clipboard operation
operator copied to clipboard

`spec.deployments.replicas` does not take care about HorizontalPodAutoscaler

Open nak3 opened this issue 4 years ago • 9 comments

We can overrides spec.deployments.replicas as:

apiVersion: operator.knative.dev/v1alpha1
kind: KnativeServing
metadata:
  name: ks
  namespace: knative-serving
spec:
  deployments:
  - name: webhook
    replicas: 3

But it does not change the values in HorizontalPodAutoscaler:

https://github.com/knative/operator/blob/f4ce4ff51a7fe3f6941073c7733a2e83f8b7faf1/pkg/reconciler/common/deployments_override.go#L86-L90

Some deployments (e.g. webhook, activator) deploys HPA so we need to change the values.

https://github.com/knative/operator/blob/f4ce4ff51a7fe3f6941073c7733a2e83f8b7faf1/cmd/operator/kodata/knative-serving/0.25.1/2-serving-core.yaml#L5435

nak3 avatar Sep 09 '21 02:09 nak3

@nak3 we have some code updating the HPA minReplica here: https://github.com/knative/operator/blob/main/pkg/reconciler/common/ha.go#L76-L89

I think we should do something similar on the deployments_override.go file, to check/tweak for both: min and max...

matzew avatar Sep 13 '21 12:09 matzew

I think we need an explicit option like

spec:
  horizontalPodAutoscalers:
  - name: foo
    minReplicas: ...
    maxReplicas: ...

plus a warning if one attempts to set spec.deployments[].replicas for something the operator does deploy an HPA...

maschmid avatar Sep 13 '21 12:09 maschmid

or that as a vehicle to make more options directly configurable, w/o guessing.

Regardless, it would also would relate to the ha.go file

matzew avatar Sep 13 '21 12:09 matzew

Yeah, maxReplicas has a bug in not only spec.deployments.replicas but also spec.ha (ha.go). I think we can apply the same fix with https://github.com/knative/operator/pull/748 to spec.deployments.replicas.

nak3 avatar Sep 14 '21 06:09 nak3

@nak3 Can we close this issue for now?

houshengbo avatar Oct 21 '21 18:10 houshengbo

No, unfortunately https://github.com/knative/operator/pull/748 fixed the issue for spec.ha but spec.deployments.replicas still does not care about maxReplicas :cry:

nak3 avatar Oct 22 '21 00:10 nak3

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Jan 20 '22 01:01 github-actions[bot]

/reopen

nak3 avatar Sep 09 '22 10:09 nak3

@nak3: Reopened this issue.

In response to this:

/reopen

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.

knative-prow[bot] avatar Sep 09 '22 10:09 knative-prow[bot]

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Dec 10 '22 01:12 github-actions[bot]

/reopen

nak3 avatar Feb 16 '23 10:02 nak3

@nak3: Reopened this issue.

In response to this:

/reopen

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.

knative-prow[bot] avatar Feb 16 '23 10:02 knative-prow[bot]

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar May 19 '23 01:05 github-actions[bot]

/lifecycle frozen

dprotaso avatar Jun 02 '23 01:06 dprotaso

not sure what frozen means, its still not fixed :-(

richardvflux avatar Jun 19 '23 01:06 richardvflux

Frozen means the bot won't close this issue.

dprotaso avatar Jun 23 '23 12:06 dprotaso

/assign

ReToCode avatar Aug 29 '23 08:08 ReToCode