Set up Multi-Nodes Kubernetes Cluster along with WordPress & MySQL on GCP Cloud

  1. Create 2 VPC’s in 2 different regions, one in Singapore region & other one in US region.
  2. Establish VPC peering between the 2 VPC’s created above
  3. Create multi-node Kubernetes cluster in Singapore VPC.
  4. Launch WordPress instance using docker image in above cluster’
  5. Create a LoadBalancer & expose it to port 80 so as to access WordPress.
  6. Launch MySQL DB instance in Prod VPC (US region)
  7. Ensure that the LoadBalancer able to access WordPress.
  8. WordPress in turn able to connect to MySQL instance created above.
  9. Create IAM users & assign roles & test the privileges.
Devproject
mydevproject created
prodproject
myprodproject created
all project lists
Enable Billing for the project
Billing enabled for myprodproject
vpc in mydevproject
vpc set up in Singapore region
VPC set up in Singapore region
firewall rule for vpcdev-sg
allow all traffic
firewall rule created
VPC set up in myproproject
IP range selection
VPC created in US region under myproproject
firewall rule set up for vpcprod-us
allow all incoming traffic
firewall rule created
instance launch in mydevproject
selecting CentOS 7 image
allow all http traffic
selecting VPC vpcdev-sg
instance launched in vpcdev-sg
gcloud command to verify instance launch & confirm IP address
select compute engine service
selecting the region
selecting CentOS 7 image
selecting VPC from networking section
instance launched in vpcprod-us
gcloud command to verify instance launch & IP address
ssh to devinstance
ssh to prodinstance
ssh to prodinstance.
ping from dev to prod instance
VPC peering from devvpc to prodvpc
creating peering connection from vpcdev-sg to vpcprod-us
vpc peering inactive
vpc peering from vpcprod-us to vpcdev-sg
ping successful from devinstance to prodinstance
Kubernetes Engine API enabling
configure default pool
select vpcdev-sg in Netwroking
kubernetes cluster created
coonnet to kubernetes cluster
services list
Launch a POD with WordPress image
identify the node in which POD is running
kubectl launches another POD in case existing POD gets deleted/goes down
expose to port 80
running services
select MySQL database engine
specify db instance name & password
sqldb instance created
Allow all Traffic
edit network settings to allow all traffic
MySQL Instance launched in myprodproject
connected to MySQL DB Instance
creating student database
Public IP of WordPress
WordPress Launched using PublicIP
configure MySQL DB
Public IP of MySQL DB instance
Specify MySQL DB instance details
Ready for WordPress installation
WordPress Dashboard
Blog Creation
blog published
WP tables in Students database
verification of blog data inserted in table
Using IAM service to create user & roles
Viewer role created for user
gmail received by new user
role created for new user
role created for user
user receives mail as above
Unable to create DataBase
project list

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store