How To Create Wordpress Blog On RedHat OpenShift
Muhammad Amjad
DevOps Engineer || Kubernetes || Docker || AWS || Terraform || Shell Scripting || Python || Git & GitHub || CICD || CIS Top 20 Controls ||
here's a step-by-step guide to creating a WordPress blog on RedHat OpenShift using the Command Line Interface (CLI). Additionally, I'll show you how to add Autoscaling to the deployment.
1 Set Up MariaDB Database:
oc new-app mariadb-ephemeral
This command will create a new ephemeral MariaDB instance for your WordPress blog.
2 Check Status:
oc status
Verify the status of your OpenShift project and the resources you've created.
3 Deploy WordPress:
oc new-app php~https://github.com/wordpress/wordpress
This command pulls the latest WordPress source code from GitHub and deploys it using the PHP builder image.
4 Check Pods:
oc get pods
Ensure that both the MariaDB and WordPress pods are running successfully.
5 Check Services:
oc get svc
Retrieve the list of services to ensure that the WordPress service is created.
6 Expose WordPress Service:
oc expose svc/wordpress
Expose the WordPress service to make it accessible externally.
7 Get Route:
oc get route
Obtain the route URL for accessing your WordPress blog.
Here is the graphical representation of my RedHat OpenShift Blog
How to add Autoscaling to the deployment, follow these steps:
1 Apply Autoscaling:
oc autoscale deployment <deployment-name> --cpu-percent=70 --min=1 --max=10
Replace <deployment-name> with the name of your WordPress deployment. This command sets up Autoscaling based on CPU usage, with a target of 70%. It ensures that the number of pods scales between a minimum of 1 and a maximum of 10.
2 Check Pods:
oc get pods
Verify that Autoscaling is enabled and observe any changes in the number of pods based on CPU usage.
By following these steps, you'll have successfully deployed a WordPress blog on RedHat OpenShift and configured Autoscaling to handle varying workloads efficiently.
Co-Founder and CTO at Fusion AI & CloudDev Technologies | Board Member KPITB | OpenRiyadh | Founder OSFP | Digital Transformation | ex Systems Limited | ex Oxfam | ex BoD ISOC Pakistan | AI Cloud Architect
1 年Good work ??