Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-8847

DO280-456: Ch7 GE Autoscaling finish script assumes two MachineSets, kills all but a single worker node

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • DO280 - OCP4.5 1 20200825
    • DO280 - OCP 4.2 1 20200123
    • DO280
    • None
    • ILT, ROLE, VT
    • en-US (English)

      URL:
      Reporter RHNID:
      Section: -
      Language: en-US (English)
      Workaround: Patch the lab script with the provided fix below.

      Description: The scale-automatic script assumes there are two availability zones in AWS, which is not true for some regions (and/or deployment scenarios).

      Consequently, it scales the first MachineSet it finds to 1 instance, shrinking the number of available worker nodes to just one.

      Here's a patch for lab-scale-automatic:

      --- lab-scale-automatic-orig	2020-03-12 14:31:43.180000000 +0000
      +++ lab-scale-automatic	2020-03-12 14:27:13.354000000 +0000
      @@ -62,15 +62,19 @@
         ocp4_cleanup_lab_files
         ocp4_delete_project "${this}"
       
      -  # Scale worker nodes down to 1 for each machine set where the replica count is greater than 1
      +  # Scale worker nodes down for each machine set where the replica count is increased
      +  TARGET_COUNT=1
      +  if [ $(oc get machinesets -n openshift-machine-api -o name | wc -l) -lt 2 ]; then
      +    TARGET_COUNT=2
      +  fi
         for MACHINE in $(oc get machinesets -n openshift-machine-api -o name)
         do
           # Check if replica count is greater than 1
           replica_count="$(oc get ${MACHINE} -n openshift-machine-api -o jsonpath='{.spec.replicas}')"
      -    if [ ${replica_count} -gt 1 ]
      +    if [ ${replica_count} -gt ${TARGET_COUNT} ]
           then
      -      pad2 "Scaling '${MACHINE}' to 1 replica"
      -      if oc scale --replicas 1 ${MACHINE} -n openshift-machine-api
      +      pad2 "Scaling '${MACHINE}' to ${TARGET_COUNT} replica(s)"
      +      if oc scale --replicas ${TARGET_COUNT} ${MACHINE} -n openshift-machine-api
             then
               print_SUCCESS
             else
      

      That should fix it.

            rht-miphilli Michael Phillips
            gregab@p0f.net Grega Bremec
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: