DEPLOYING  WORDPRESS  ON GOOGLE CLOUD PLATFORM and MANAGING IT USING GKE

DEPLOYING WORDPRESS ON GOOGLE CLOUD PLATFORM and MANAGING IT USING GKE

HELLO GUYS, THIS IS ME ONCE AGAIN I WANT TO SHARE ONE MORE GREAT INTEGRATED SETUP OF WORDPRESS (which is a web hosting site) THAT I HAVE RECENTLY CREATED ON GOOGLE CLOUD PLATEFORM .

BEFORE START LET GET SOME BRIEF INFO ABOUT SOME PREREQUSITES AND STEPS FOR CREATING THIS WEBHOSTING SETUP-->

SERVICES OF GCP THAT I WILL USE FOR THIS SETUP::::::::

1.) PROJECT IN GCP:

project organizes all your Google Cloud resources. A project consists of a set of users; a set of APIs; and billing, authentication, and monitoring settings for those APIs. So, for example, all of your Cloud Storage buckets and objects, along with user permissions for accessing them, reside in a project.

2.)GOOGLE KUBERNETES ENGINE:

you guys should have high level idea about Google Kuberenetes Engine(GKE) i mean what is its use case. let me give you some brief about it:

mainly this is a devops tool. gke is an enterprise grade container management service created by google, which also created kubernetes itself gke makes it easy to deploy k8s(kubernetres) cluster on a secure and trusted plateform. gke takes care of security, networking, the underlaying infrastructure and performance.

3.)VPC(VIRTUAL PRIVATE CLOUD):

A virtual private cloud is an on-demand configurable pool of shared computing resources allocated within a public cloud environment, providing a certain level of isolation between the different organizations using the resources. 

4.)GOOGLE COMPUTE ENGINE:

Google Compute Engine is the Infrastructure as a Service component of Google Cloud Platform which is built on the global infrastructure that runs Google's search engine, Gmail, YouTube and other services. Google Compute Engine enables users to launch virtual machines on demand.

5.)WORDPRESS IMAGE:

I don't need to tell you guys much about wordpress as you all know it is a website hosting plateform where you can write blogs and customize it according to the demand by adding some look and feel. But i will tell you guys from where i got this wordpress image actually i used wordpress official docker image and deployed its container on the top of kubernetes engine.

  • DOCKER:

Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.

YOU GUYS SHOULD HAVE HIGH LEVEL IDEA ABOUT ABOVE TECHNOLOGIES I AM ASSUMING YOU ALL HAVE DONE SOME HANDS ON PRACTICALS ON ABOVE TECHS OR HAVE HIGH LEVEL IDEA ABOUT THEM AND YOU HAVE GCP ACCOUNT AS WELL.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

==NOW LETS START TO BUILD THIS INFRASTRUCTURE ::

STEP1. first of all login to GCP console and click on navigation menu.

No alt text provided for this image

STEP2: Now we have two create TWO VPCs in TWO different PROJECTS

  • FIRST VPC:

1.)IN project <My First Project>

-name: dev-vpc

- add new subnet with name: devlab

No alt text provided for this image

-configuring firewall

No alt text provided for this image
No alt text provided for this image

-now lets create the VPC

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image


  • SECOND VPC:

1.)IN project <RTprojectONE>

-name: prod-vpc

- add new subnet with name: prod-lab

No alt text provided for this image

further configurations in this VPC

-Creating firewall

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image




No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

--------------------------------------------------------------------------------------------------------------- VPC CREATION COMPLETE -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

STEP2:VPC peering means connecting two VPCs in same network that enables you to route traffic between them using private IPv4 addresses or IPv6 addresses. Instances in either VPC can communicate with each other as if they are within the same network. I have launched my prod-vpc in US-east1(Carolina) region and dev-vpc in asia-southeast1(Singapore) region. So toom nake connectivity i have to do this peering. So, we have to do this peering from both the side

1.)My first Project: creating VPC peering

No alt text provided for this image

-after clicking on create we got this

No alt text provided for this image

2.) RTprojectONE:

-step one is same as that of previous VPC peering creation

hence we got,

No alt text provided for this image

--------------------------------------------------------------------------------------------------------------------------------------------------VPC PEERING COMPLETE-----------------------------------------------------------------------------------------------------------------------------------------------------

STEP3: NOW WE HAVE TO CREATE K8S is kubernetes cluster using GKE(Google Kubernetes_Engine)

1.) Select GKE in GCP navigation menu, and select cluster in it.

No alt text provided for this image

2.)Now enter required cluster basics specifications

No alt text provided for this image

-give specifications in default-pool

No alt text provided for this image

-now, providing Nodes specifications

No alt text provided for this image

-providing atlast networking settings, and then click on create flatbutton

No alt text provided for this image

-CLUSTER CREATED SUCCESSFULLY

No alt text provided for this image

-HERE IS ITS DETAILED INFO

No alt text provided for this image

-AS you can see three nodes launched in the Compute instances as VMinstances

No alt text provided for this image

-NOW LETS CONNECT TO THE K8S CLUSTER

IN below screenshot behind the thick red line you will get the link with credentials , you have to copy this and past in the command prompt after installing google SDK in your system. I have hide the command for security reasons.

No alt text provided for this image

-Here we have to past the command we get above,

No alt text provided for this image

-now we have to create deployment for the wordpress so that we can setup our webhosting

No alt text provided for this image

-now we have to create LoadBalancer for our webserver loadbalancer will distribute the load of client in all the pods when client hit to the server increase

No alt text provided for this image

our webserver launch lets check our website

No alt text provided for this image

-After selecting we have to add database server to provide data service to wordpress

No alt text provided for this image
No alt text provided for this image

--------------------------------------------------------------------------------------------------------------------------------------NOW WE HAVE TO CREATE DATABASE SERVER---------------------------------------------------------------------------------------------------------------------------------

STEP4: We will create database in our prod-vpc which is present in our project named RTprojectONE

-select SQL in navigation menue in GCP;

No alt text provided for this image
No alt text provided for this image
  • CLICK ON CREATE AS SHOWN ABOVE
  • Now select the type of sql database ,
No alt text provided for this image

-configure this database as shown in below,

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

-MSQL DATABASE CREATED IN OTHER VPC

No alt text provided for this image

-NOW LETS CREATE USER AND IT TO DATABASE

No alt text provided for this image
No alt text provided for this image

-----------------------------------------------------------------------------------------------------------------------------NOW LETS CONNECT DATABASE TO THE WORDPRESS--------------------------------------------------------------------------------------------------------------------------------

  • PROVIDING CREDENTIALS OF DATABASE TO THE WORDPRESS

AFTER PROVIDING CREDENTIALS you are ready for installion and login

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

-ADD LOGIN AND PASSWORD

No alt text provided for this image

-------------------------------SETUP COMPLETE-------------------------------------------------------------------------------------------------------------------------------------------------------------------

SERVER RUNNING SUCCESSFULLY NOW CUSTOMIZE YOUR WORDPRESS IN WHATEVER THE WAY YOU WANT AND HOST YOUR OWN SITE

-------------------------------------------------------------------

!!!!!! I HOPE YOU LIKED MY WORK THANK YOU !!!!!!








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

Raghav Tiwari的更多文章

社区洞察

其他会员也浏览了