Hide Forgot
Description of problem: Shouldn't be allowed to create different machineautoscalers pointing to the same machineset Version-Release number of selected component (if applicable): $ bin/openshift-install version bin/openshift-install v0.7.0-master-16-g81e2a8810350b18030d313bc17ddaecdb1ed32b7 $ oc version oc v4.0.0-alpha.0+1cdd4a1-781 kubernetes v1.11.0+1cdd4a1 features: Basic-Auth GSSAPI Kerberos SPNEGO How reproducible: Always Steps to Reproduce: 1. Create machineautoscaler set machineset "qe-zhsun-1-worker-us-east-2a" $ oc create -f machineautoscaler.yml apiVersion: autoscaling.openshift.io/v1alpha1 kind: MachineAutoscaler metadata: finalizers: - machinetarget.autoscaling.openshift.io name: autoscale-us-east-2a namespace: openshift-cluster-api spec: maxReplicas: 3 minReplicas: 1 scaleTargetRef: apiVersion: cluster.k8s.io/v1alpha1 kind: MachineSet name: qe-zhsun-1-worker-us-east-2a status: {} 2. Create another machineautoscaler set machineset "qe-zhsun-1-worker-us-east-2a" $ oc create -f machineautoscaler.yml apiVersion: autoscaling.openshift.io/v1alpha1 kind: MachineAutoscaler metadata: finalizers: - machinetarget.autoscaling.openshift.io name: autoscale-us-east-2b namespace: openshift-cluster-api spec: maxReplicas: 4 minReplicas: 2 scaleTargetRef: apiVersion: cluster.k8s.io/v1alpha1 kind: MachineSet name: qe-zhsun-1-worker-us-east-2a status: {} 3. Check machineset annotations $ oc get machineset qe-zhsun-1-worker-us-east-2a -o yaml annotations: sigs.k8s.io/cluster-api-autoscaler-node-group-max-size: "4" sigs.k8s.io/cluster-api-autoscaler-node-group-min-size: "2" 4. Delete the newly created machineautoscaler $ oc delete machineautoscaler autoscale-us-east-2b machineautoscaler.autoscaling.openshift.io "autoscale-us-east-2b" deleted 5. Check machineset annotations $ oc get machineset qe-zhsun-1-worker-us-east-2a -o yaml $ oc get machineautoscaler NAME AGE autoscale-us-east-2a 16m Actual results: Two machineautoscalers were created pointing the same machineset. Expected results: Creating different machineautoscalers pointing the same machineset is not allowed. Additional info:
https://github.com/openshift/cluster-autoscaler-operator/pull/25 The changes in the above PR prevent multiple MachineAutoscaler resources with the same target from actually making conflicting changes. However, the error reporting in the status subresource is not complete. Also, blocking the creation of these resources up-front will require an admission webhook, which unfortunately will definitely not be ready before 4.0 feature freeze.
Verified. clusterversion: 4.0.0-0.nightly-2019-02-17-024922 If multiple MachineAutoscaler resources reference the same target, the first wins and reconciliation will fail for the others. $ oc logs -f cluster-autoscaler-operator-bb878c4cd-bqvr7 I0218 03:38:54.579680 1 machineautoscaler_controller.go:137] Reconciling MachineAutoscaler openshift-machine-api/autoscale-us-east-2a I0218 03:39:26.775702 1 machineautoscaler_controller.go:137] Reconciling MachineAutoscaler openshift-machine-api/autoscale-us-east-2b E0218 03:39:26.779709 1 machineautoscaler_controller.go:173] Error setting target owner: already owned by another MachineAutoscaler
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0758