Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1689416 - any machineset with scaling annotation will be scaled, even if it doesn't actually match
Summary: any machineset with scaling annotation will be scaled, even if it doesn't act...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Jan Chaloupka
QA Contact: Jianwei Hou
Depends On:
TreeView+ depends on / blocked
Reported: 2019-03-15 20:40 UTC by Erik M Jacobs
Modified: 2019-03-15 21:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-03-15 21:22:05 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Erik M Jacobs 2019-03-15 20:40:48 UTC
Description of problem:

When you create a machineautoscaler, it results in the specified machineset being annotated. However, if you copy those annotations to a completely different/arbitrary machineset, the autoscaler will scale BOTH sets even though the different/arbitrary machineset's name does not match.

Version-Release number of selected component (if applicable):

How reproducible:
100% I think

Steps to Reproduce:
1. Create a machine autoscaler for an existing machineset:

kind: MachineAutoscaler
  creationTimestamp: 2019-03-14T18:54:02Z
  generation: 1
  name: autoscale-cluster-a28e-tswkj-worker-ap-southeast-1c
  namespace: openshift-machine-api
  resourceVersion: "1802681"
  selfLink: /apis/
  uid: 88ce886b-468a-11e9-b600-06d91f1bfdb6
  maxReplicas: 4
  minReplicas: 1
    kind: MachineSet
    name: cluster-a28e-tswkj-worker-ap-southeast-1c
    kind: MachineSet
    name: cluster-a28e-tswkj-worker-ap-southeast-1c

2. Create a completely different machineset

kind: MachineSet
  creationTimestamp: 2019-03-14T19:24:45Z
  generation: 14
  labels: cluster-a28e-tswkj worker worker
  name: infra-ap-southeast-1a
  namespace: openshift-machine-api
  resourceVersion: "2830109"
  selfLink: /apis/
  uid: d3128d37-468e-11e9-99b0-06d91f1bfdb6

3. Add the autoscale annotation from the first machineset to the second machineset

  annotations: openshift-machine-api/autoscale-cluster-a28e-tswkj-worker-ap-southeast-1c "4" "1"

Actual results:
Autoscaler will scale infra-ap-southeast-1 even though its name does not match autoscale-cluster-a28e-tswkj-worker-ap-southeast-1c

Expected results:
The annotation should be ignored.

Additional info:

Comment 1 Derek Carr 2019-03-15 21:22:05 UTC
The annotation on the machine set is the source of truth.  The machine autoscaler is intended to be the single writer for those annotations across a set of scaleable targets (MachineSet / MachineDeployment).  A user could directly set the annotation absent the machine autoscaler but its not recommended as we wanted to enable the option for an RBAC separation between ability to create/update machineset and scale existing machinesets/deployments.  In addition. the annotation it writes right now is a bit of an implementation detail and could evolve as the API upstream and downstream evolves.

Note You need to log in before you can comment on or make changes to this bug.