Uploaded image for project: 'Cloud Enablement'
  1. Cloud Enablement
  2. CLOUD-2453

[RH-SSO] Persistent templates -- Add init container to wait for MySQL / PostgreSQL to become ready prior RH-SSO pod startup

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • TEMPLATE 1.4.10.GA
    • RH-SSO
    • CLOUD Maintenance Sprint 28

      When using a persistent storage, RH-SSO pod often needs 2-3 restarts till the DB becomes reachable to utilize the services of the MySQL / PostgreSQL DB properly. See details.

      The proposal is to use OpenShift init containers to achieve proper pod starting sequence control (ensure RH-SSO pod is started only in moment related MySQL / PostgreSQL pod is able to receive JDBC connections already):

      The proposed fix (recognized as working properly for MySQL DB case, needs to be tested for PostgreSQL's DB case yet) is as follows:

      @@ -488,6 +488,23 @@
                           },
                           "spec": {
                               "terminationGracePeriodSeconds": 75,
      +                        "initContainers": [
      +                            {
      +                                "name": "wait-for-${APPLICATION_NAME}-mysql",
      +                                "image": "busybox",
      +                                "command": [
      +                                  "sh",
      +                                  "-c",
      +                                  "until nc -w 3 -z ${SVC} 3306; do echo waiting for ${SVC} to become available ; sleep 7 ; done"
      +                                ],
      +                                "env": [
      +                                    {
      +                                        "name": "SVC",
      +                                        "value": "${APPLICATION_NAME}-mysql"
      +                                    }
      +                                ]
      +                            }
      +                        ],
                               "containers": [
                                   {
                                       "name": "${APPLICATION_NAME}",
      

              rhn-jlieskov Ján Lieskovský (Inactive)
              rhn-jlieskov Ján Lieskovský (Inactive)
              Peter Zaoral Peter Zaoral (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: