Installing zone-aware sample application

About this task

Deploy a zone-aware sample application to validate whether the Fusion Data Foundation, stretch cluster setup is configured correctly.

Important: With latency between the data zones, one can expect to see performance degradation compared to an OpenShift® Container Platform cluster with low latency between nodes and zones (for example, all nodes in the same location). How much the performance gets degraded, depends on the latency between the zones and on the application behavior that uses the storage (such as heavy write traffic). Ensure that you test the critical applications with stretch cluster configuration to ensure sufficient application performance for the required service levels.

A ReadWriteMany (rwx) Persistent Volume Claim (PVC) is created by using the ocs-storagecluster-cephfs storage class. Multiple pods use the newly created rwx PVC at the same time. The application that is used in the example here is called File Uploader.

This topic demonstrates how an application is spread across topology zones so that it is still available when there is a site outage.
Note: This demonstration is possible since this application shares the same rwx volume for storing files. It works for persistent data access as well because Fusion Data Foundation is configured as a stretched cluster with zone awareness and high availability.

Procedure

  1. Create a new project.
    oc new-project my-shared-storage
    Note: Enure that there is an image registry available before creating the PHP application `file-uploader`.
  2. Deploy the example PHP application called file-uploader.
    oc new-app openshift/php:7.4-ubi8~https://github.com/red-hat-storage/ocm-ramen-samples --name=file-uploader
    Example Output:
    Found image 4f2dcc0 (9 days old) in image stream "openshift/php" under tag "7.4-ubi8" for "openshift/php:7.4-
    ubi8"
    
    Apache 2.4 with PHP 7.4
    -----------------------
    PHP 7.4 available as container is a base platform for building and running various PHP 7.4 applications and frameworks. PHP is an HTML-embedded scripting language. PHP attempts to make it easy for developers to write dynamically generated web pages. PHP also offers built-in database integration for several commercial and non-commercial database management systems, so writing a database-enabled webpage with PHP is fairly simple. The most common
    use of PHP coding is probably as a replacement for CGI scripts.
    
    Tags: builder, php, php74, php-74
    
    * A source build using source code from https://github.com/christianh814/openshift-php-upload-demo will be cr
    eated
    * The resulting image will be pushed to image stream tag "file-uploader:latest"
    * Use 'oc start-build' to trigger a new build
    
    --> Creating resources ...
        imagestream.image.openshift.io "file-uploader" created
        buildconfig.build.openshift.io "file-uploader" created
        deployment.apps "file-uploader" created
        service "file-uploader" created
    --> Success
        Build scheduled, use 'oc logs -f buildconfig/file-uploader' to track its progress.
    
        Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
         'oc expose service/file-uploader'
    
        Run 'oc status' to view your app.
  3. View the build log and wait until the application is deployed.
    oc logs -f bc/file-uploader -n my-shared-storage
    Example Output:
    Cloning "https://github.com/christianh814/openshift-php-upload-demo" ...
    
        [...]
        Generating dockerfile with builder image image-registry.openshift-image-regis
    try.svc:5000/openshift/php@sha256:d97466f33999951739a76bce922ab17088885db610c
    0e05b593844b41d5494ea
    STEP 1: FROM image-registry.openshift-image-registry.svc:5000/openshift/php@s
    ha256:d97466f33999951739a76bce922ab17088885db610c0e05b593844b41d5494ea
    STEP 2: LABEL "io.openshift.build.commit.author"="Christian Hernandez <christ
    ian.hernandez@yahoo.com>"       "io.openshift.build.commit.date"="Sun Oct 1 1
    7:15:09 2017 -0700"       "io.openshift.build.commit.id"="288eda3dff43b02f7f7
    b6b6b6f93396ffdf34cb2"       "io.openshift.build.commit.ref"="master"       "
    io.openshift.build.commit.message"="trying to modularize"       "io.openshift
    .build.source-location"="https://github.com/christianh814/openshift-php-uploa
    d-demo"       "io.openshift.build.image"="image-registry.openshift-image-regi
    stry.svc:5000/openshift/php@sha256:d97466f33999951739a76bce922ab17088885db610
    c0e05b593844b41d5494ea"
    STEP 3: ENV OPENSHIFT_BUILD_NAME="file-uploader-1"     OPENSHIFT_BUILD_NAMESP
    ACE="my-shared-storage"     OPENSHIFT_BUILD_SOURCE="https://github.com/christ
    ianh814/openshift-php-upload-demo"     OPENSHIFT_BUILD_COMMIT="288eda3dff43b0
    2f7f7b6b6b6f93396ffdf34cb2"
    STEP 4: USER root
    STEP 5: COPY upload/src /tmp/src
    STEP 6: RUN chown -R 1001:0 /tmp/src
    STEP 7: USER 1001
    STEP 8: RUN /usr/libexec/s2i/assemble
    ---> Installing application source...
    => sourcing 20-copy-config.sh ...
    ---> 17:24:39     Processing additional arbitrary httpd configuration provide
    d by s2i ...
    => sourcing 00-documentroot.conf ...
    => sourcing 50-mpm-tuning.conf ...
    => sourcing 40-ssl-certs.sh ...
    STEP 9: CMD /usr/libexec/s2i/run
    STEP 10: COMMIT temp.builder.openshift.io/my-shared-storage/file-uploader-1:3
    b83e447
    Getting image source signatures
    
    [...]
    The command prompt returns out of the tail mode once you see Push successful.
    Note: The new-app command deploys the application directly from the Git repository and does not use the Red Hat OpenShift template, hence Red Hat OpenShift route resource is not created by default. You need to create the route manually.

What to do next