This repo contains supporting files for OADP demo for this blog entry: Back up Kubernetes persistent volumes using OADP
We need to deploy a Kubernetes application that uses persistent volumes. We will use WordPress, which uses the MySQL database. The instructions were based on this link.
- Download the MySQL deployment configuration file:
curl -LO \ https://raw.githubusercontent.com/yortch/oadp/main/mysql-deployment.yaml
- Download the WordPress configuration file:
curl -LO \ https://raw.githubusercontent.com/yortch/oadp/main/wordpress-deployment.yaml
- Export PASSWORD as an environment variable:
PASSWORD=<YOUR_PASSWORD>
- Generate the following kustomization.yaml file:
cat <<EOF >./kustomization.yaml secretGenerator: - name: mysql-pass literals: - password=${PASSWORD} resources: - mysql-deployment.yaml - wordpress-deployment.yaml EOF
- Create a new application project:
oc new-project wordpress
- Apply the kustomization.yaml file:
oc apply -n wordpress -k ./
- Next, expose the WordPress service:
oc expose service wordpress -n wordpress
- Print the service URL and navigate to it from a browser.
echo http://$(oc get route -n wordpress -o jsonpath='{.items[0].spec.host}')
- Proceed with the initial WordPress setup so that it is included in the backup.