Microservices oriented architecture has significantly influenced the manner by which applications are developed and deployed. Methodologies like the Twelve-Factor-App have become popular for building Software-as-a-Service(SaaS) enterprise applications. Red Hat’s OpenShift Container Platform provides a comprehensive and robust platform for developing and deploying applications that run as microservices.
How important is underlying infrastructure for stateless applications?
One of the qualities usually associated with containers is being ephemeral. They are stateless and can be easily spawned and destroyed. While Kubernetes’ replication controller provides load balancing and high availability for services, the requirement for data accessibility and protection still exists. As the services in the pod are started, stopped or migrated among different nodes in the cluster, it has to be ensured that the data is available, protected and persistent.
Enterprise deployments impose additional requirements on the underlying infrastructure design. Characteristics like performance guarantees, independently scalable infrastructure components, and high availability are expected to be inherent to the infrastructure design.
NetApp has been actively engaged in enabling enterprise class storage in the container ecosystem. With open source NetApp Docker Volume Plugin(nDVP) you can not only connect Docker containers with NetApp platforms but also specify options(like snapshotting policy, thin provisioning) for the volumes created. NetApp enables you to easily provision persistent storage for your pods from shared NFS storage, iSCSI with guaranteed performance or extremely fast storage depending on your application needs.
Talk is good, doing is better
We deployed Red Hat OpenShift Container Platform 3.2 on a FlexPod configuration in NetApp engineering laboratories at our Research Triangle Park lab. FlexPod is converged infrastructure platform co-engineered by NetApp and Cisco, which integrates compute, storage and network aspects of your datacenter in a pre-validated form, thereby eliminating risks and ensuring all the enterprise class features, like high availability and performance guarantees through QoS. We used Cisco UCS C-220 M2 blade servers for compute resources, NetApp FAS 2552 nodes for storage resources and Cisco Nexus 3048 Nexus switches for network resources.
At the lowest layer, Red Hat Enterprise Linux Atomic Host (RHEL Atomic Host) was used as the underlying operating system to run OpenShift master and node components. RHEL Atomic host is a variant of RHEL 7, optimized to run Linux containers. NetApp FAS devices are based on ONTAP unified storage operating system, which enables you to provide HDD or SSD storage through NFS, iSCSI, FCoE, or FC protocol. RHEL Atomic hosts were PXE booted through iSCSI LUNs provisioned through a NetApp FAS device. This not only ensures resilient infrastructure but also enabled us to expand the local storage pools for the Atomic hosts at any time. For this lab setup, we used NFS shares to provision persistent storage for OpenShift cluster.
More information on provisioning persistent storage using ONTAP and NFS can be found here. To enable a completely stateless infrastructure, the storage backend for Docker Registry was enabled through a Kubernetes Persistent Volume Claim (PVC). We deployed Red Hat OpenShift Container Platform 3.2 using Ansible based installation. It was a smooth and simple experience to get the infrastructure ready and running for applications to be deployed on.
Persistent storage in action
To validate the above deployment, we built a Node.js application with MySQL as the database backend. The storage for database is provisioned using the Persistent Volume. We demonstrate that the application state is maintained despite intentionally killing the database pod and redeploying it.
Resilient infrastructure for data-intensive distributed applications
Next, we demonstrate the resiliency of the system by deploying a distributed application which consists of multiple services with a continuous data influx. The application also needs to be routable and store data persistently. Further, each service can be customized by passing appropriate parameters. We deployed a data analytics app, which visualizes live data collected from a data source.
NetApp Harvest tool polls performance data from ONTAP systems and posts it to a time series data store (Graphite). The data is rendered as informative graphs using Grafana. MySQL is used as a database backend for storing Grafana dashboard data. We create templates containing information about entities to be created like pods, services, persistent volume requirements etc. for each of the components. These templates are written in easy to comprehend JSON format. Below is a video demonstration of the above deployment.