Bug 1827307 - MachineSet replicas should default to 1
Summary: MachineSet replicas should default to 1
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.6.0
Assignee: Joel Speed
QA Contact: Milind Yadav
Depends On: 1819029 1820654 1852061
TreeView+ depends on / blocked
Reported: 2020-04-23 15:36 UTC by Joel Speed
Modified: 2020-10-27 15:58 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: No defaulting had been implemented for the replicas field. Consequence: A user could remove the replicas field which would break the MachineSet controller but not return any errors to the user. Fix: If the user does not provide a value for replicas, it will default to 1. This will not interfere with oc apply. Result: The MachineSet controller will no longer be blocked. Replicas will default to 1 as per documented behaviour.
Clone Of: 1820654
Last Closed: 2020-10-27 15:58:27 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift machine-api-operator pull 668 0 None closed BUG 1827307: Default MachineSet replicas to 1 2020-09-11 06:35:18 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 15:58:46 UTC

Comment 3 Alberto 2020-05-29 10:54:53 UTC
tagging with upcomingSprint to re-evaluate priority.

Comment 4 Joel Speed 2020-06-17 10:21:17 UTC
We have implemented defaulting for the ProviderSpec this sprint. Will take a look at this and the impact of the change next sprint

Comment 5 Joel Speed 2020-07-06 10:40:29 UTC
I want to make sure that everything is stable from the webhook side before we start digging into this. There's been a few teething issues to look into so dropping this to next sprint

Comment 6 Joel Speed 2020-07-30 15:41:05 UTC
Didn't manage to look into this during the last sprint, should have more time to get to this after feature freeze

Comment 7 Joel Speed 2020-08-20 16:45:32 UTC
Need consensus from the team that this is the right way to go, will try to push this through next sprint

Comment 10 Milind Yadav 2020-09-02 12:44:32 UTC
VERIFIED on - 4.6.0-0.nightly-2020-08-31-220837

Steps :
1.Created a machineset with replicas as below- 
      machine.openshift.io/cluster-api-cluster: wduan0902b-9kmnz
      machine.openshift.io/cluster-api-machineset: wduan0902b-9kmnz-worker-new
        machine.openshift.io/cluster-api-cluster: wduan0902b-9kmnz
        machine.openshift.io/cluster-api-machine-role: worker
        machine.openshift.io/cluster-api-machine-type: worker
        machine.openshift.io/cluster-api-machineset: wduan0902b-9kmnz-worker-new
2. Machineset created successfully 
[miyadav@miyadav vsphere]$ oc create -f vsp_ms.yaml --config vsp 
machineset.machine.openshift.io/wduan0902b-9kmnz-worker-new created

3.Machines in machineset scaled successfully
[miyadav@miyadav vsphere]$ oc get machineset --config vsp
NAME                          DESIRED   CURRENT   READY   AVAILABLE   AGE
wduan0902b-9kmnz-worker       2         2         2       2           5h26m
wduan0902b-9kmnz-worker-new   1         1         1       1           7m19s
[miyadav@miyadav vsphere]$ oc get machines -o wide --config vsp
NAME                                PHASE     TYPE   REGION   ZONE   AGE     NODE                                PROVIDERID                                       STATE
wduan0902b-9kmnz-master-0           Running                          5h26m   wduan0902b-9kmnz-master-0           vsphere://422b9e4d-ab7a-8d15-4ba9-617925baf5e8   poweredOn
wduan0902b-9kmnz-master-1           Running                          5h26m   wduan0902b-9kmnz-master-1           vsphere://422b65da-7976-acd3-21fa-b64e07a408f0   poweredOn
wduan0902b-9kmnz-master-2           Running                          5h26m   wduan0902b-9kmnz-master-2           vsphere://422b0cf9-f6fb-4aee-3da8-68a8d135f869   poweredOn
wduan0902b-9kmnz-worker-7fd7v       Running                          5h16m   wduan0902b-9kmnz-worker-7fd7v       vsphere://422b5f20-6e50-48f4-4ade-4e6d1529a336   poweredOn
wduan0902b-9kmnz-worker-new-8jhld   Running                          7m40s   wduan0902b-9kmnz-worker-new-8jhld   vsphere://422be203-fc3d-71c9-44ed-e7f921cfb85c   poweredOn
wduan0902b-9kmnz-worker-wwv98       Running                          5h16m   wduan0902b-9kmnz-worker-wwv98       vsphere://422ba102-80ee-2319-b00d-c34f0a9293f0   poweredOn
[miyadav@miyadav vsphere]$ 

All results as expected , moved to VERIFIED.

Additional info:
We cannot use "nil" or  nil in replica field  as it is invalid and will through error :
admission webhook "default.machineset.machine.openshift.io" denied the request: v1beta1.MachineSet.Spec: v1beta1.MachineSetSpec.Replicas: readUint32: unexpected character: �, error found in #10 byte of ...|eplicas":"nil","sele|..., bigger context ...|64f4-44e7-9b3f-b32825c9f54e"},"spec":{"replicas":"nil","selector":{"matchLabels":{"machine.openshift|...

Comment 12 errata-xmlrpc 2020-10-27 15:58:27 UTC
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 (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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