# DEPLOYING WORDPRESS AND MYSQL WITH PERSISTENT VOLUMES USING HPE ALLETRA STORAGE

A WordPress and MySQL application is deployed on the existing RHOCP cluster to utilize the volume from HPE Alletra array through HPE CSI Driver. A two-tier application such as WordPress and MySQL are deployed and scheduled on the worker nodes. This chapter describes how to deploy a sample two-tier application on RHOCP 4.10 using HPE Alletra storage.

Deploying WordPress and MySQL application using HPE Alletra storage** **

To deploy WordPress and MySQL application using HPE Alletra storage:

  1. Download the MySQL deployment configuration file.
$ curl -LO [https://k8s.io/examples/application/wordpress/mysql-deployment.yaml](https://k8s.io/examples/application/wordpress/mysql-deployment.yaml)
  1. Download the WordPress configuration file.
$ curl -LO [https://k8s.io/examples/application/wordpress/wordpress-deployment.yaml](https://k8s.io/examples/application/wordpress/wordpress-deployment.yaml)
  1. Edit kustomization.yaml file to add secret and both the deployment configuration.
[root@rhel7\_installer wordpress]$ cat kustomization.yaml

secretGenerator:

- name: mysql-pass

  literals:

  - password=mysql

resources:

  - mysql.yaml

  - wordpress.yaml
  1. Run the following command to apply the changes to the kustomization.yaml file.
$ oc apply -k./

The following output is displayed:

FIGURE 9 Output of WordPress and MySQL two-tier sample application deployment

  1. Check the status of PVC, PV, and mariadb pod.

FIGURE 10 PV and PVC status for WordPress and MySQL

Figure 21 shows the list of pods that should now be available in the environment.

FIGURE 11 Wordpress and MySQL pods for two-tier sample app deployed

Verifying PVC on HPE Alletra array

The Persistent Volume Claim (PVC) created for the two-tier sample application deployed for WordPress and MySQL can be verified on the HPE Alletra array by searching for the PVC ID displayed on the console or on the CLI.

To verify the PVC on HPE Alletra array:

  1. Log in to the HPE Alletra Console at https://alletramgmtip

  2. Verify WordPress and MySQL PVC ID in the data storage. The details of PVC ID are displayed on the dashboard.

FIGURE 12 Volume created for the PVC created in HPE Alletra