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...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jan Chaloupka
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On:
Blocks:
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:
Environment:
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):
4.0.0-0.0.7

How reproducible:
100% I think

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

apiVersion: autoscaling.openshift.io/v1alpha1
kind: MachineAutoscaler
metadata:
  creationTimestamp: 2019-03-14T18:54:02Z
  finalizers:
  - machinetarget.autoscaling.openshift.io
  generation: 1
  name: autoscale-cluster-a28e-tswkj-worker-ap-southeast-1c
  namespace: openshift-machine-api
  resourceVersion: "1802681"
  selfLink: /apis/autoscaling.openshift.io/v1alpha1/namespaces/openshift-machine-api/machineautoscalers/autoscale-cluster-a28e-tswkj-worker-ap-southeast-1c
  uid: 88ce886b-468a-11e9-b600-06d91f1bfdb6
spec:
  maxReplicas: 4
  minReplicas: 1
  scaleTargetRef:
    apiVersion: machine.openshift.io/v1beta1
    kind: MachineSet
    name: cluster-a28e-tswkj-worker-ap-southeast-1c
status:
  lastTargetRef:
    apiVersion: machine.openshift.io/v1beta1
    kind: MachineSet
    name: cluster-a28e-tswkj-worker-ap-southeast-1c

2. Create a completely different machineset

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

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

  annotations:
    autoscaling.openshift.io/machineautoscaler: openshift-machine-api/autoscale-cluster-a28e-tswkj-worker-ap-southeast-1c
    machine.openshift.io/cluster-api-autoscaler-node-group-max-size: "4"
    machine.openshift.io/cluster-api-autoscaler-node-group-min-size: "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.