How To Create Wordpress Blog On RedHat OpenShift

How To Create Wordpress Blog On RedHat OpenShift

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.

1 Set Up MariaDB Database:


2 Check Status:

oc status        

Verify the status of your OpenShift project and the resources you've created.

2 Check Status:


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.

3 Deploy WordPress:


4 Check Pods:

oc get pods        

Ensure that both the MariaDB and WordPress pods are running successfully.

4 Check Pods:


5 Check Services:

oc get svc        

Retrieve the list of services to ensure that the WordPress service is created.

5 Check Services:


6 Expose WordPress Service:

oc expose svc/wordpress        

Expose the WordPress service to make it accessible externally.

6 Expose WordPress Service:


7 Get Route:

oc get route        

Obtain the route URL for accessing your WordPress blog.

7 Get Route:


Here is the graphical representation of my RedHat OpenShift Blog

1
2
3
4
5
6
7


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.

1


2 Check Pods:

oc get pods        

Verify that Autoscaling is enabled and observe any changes in the number of pods based on CPU usage.

2


By following these steps, you'll have successfully deployed a WordPress blog on RedHat OpenShift and configured Autoscaling to handle varying workloads efficiently.


Babar Zahoor

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 ??

要查看或添加评论,请登录

Muhammad Amjad的更多文章

社区洞察

其他会员也浏览了