Uploaded image for project: 'Red Hat 3scale API Management'
  1. Red Hat 3scale API Management
  2. THREESCALE-8754

Enhance replica reconciliation

XMLWordPrintable

    • API CCS Sprint 36 (3Scale), API CCS Sprint 36 (3Scale), API CCS Sprint 37 (3Scale), API CCS Sprint 38 (3Scale), API CCS Sprint 43 (3Scale), API CCS Sprint 44 (3Scale) 2

      Currently, when replicas are not set in the APIManager CR (or APIcast CR), the operator adds them to the CR (with value to 1). Then on reconcilliation loop, the operator makes sure the replica value at the deployment matches the one specified in the CR.

      The problem is that if the replica count is managed by some external controller (like the HPA controller), the operator does not allow it and tries to update deployment's replica count with the one in the CR.

      As a workaround, https://issues.redhat.com/browse/THREESCALE-8374 was implemented. This is based on an annotation to disable replica reconciliation.

      Enhancing the replica reconciliation by the operator allows external controllers to manage the replica count if that is desired by the user.

      The proposal is to reconcile the replicas only if they are explicitly set in the CR, otherwise replica will not be reconciled (allowing external controller to do that, like HPA controller).

      In order to do that, the first thing to be done is to remove the code that adds default replica values to the CR by the operator. Then, add replica reconciliation only when it is set explicitly in the CR. The replica fields are already optional, so the operator can know if it has been set or not.

      When the operator gets a reconciliation event, there are two scenarios:

      • The deploymentconfig does not exit

      If the replicas are found in the CR, the deployment config replica value will be the one of the CR. If the replicas are not found in the CR, the deployment config replica value will be set to 1

      • The deploymentconfig exists

      If the replicas are found in the CR, the deploymentconfig replica value will be set to the  value found in the CR. Even if it is 0. If the replicas are not found in the CR, the deployment config replica value will not be reconciled and will be left as it is.

       

      With this implementation, we remove the annotation to disable replica reconciliation implemented in https://issues.redhat.com/browse/THREESCALE-8374

       

      This applies both to the apicast operator and 3scale operator

       

       

              Unassigned Unassigned
              eguzki Eguzki Astiz Lezaun
              Lluis Cavalle Lluis Cavalle
              Matej Dujava Matej Dujava
              Eguzki Astiz Lezaun Eguzki Astiz Lezaun
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 3 days
                  3d
                  Remaining:
                  Remaining Estimate - 3 days
                  3d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified