setup and configure a cloud environment in google cloud: challenge lab

  1. Create production VPC using Deployment Manager
  2. Create bastion host
  3. Create and configure Cloud SQL Instance
  4. Create Kubernetes cluster
  5. Prepare the Kubernetes cluster
  6. Create a WordPress deployment
  7. Enable monitoring
  8. Provide access for an additional engineer
  • Use the project VPCs.
  • Naming is normally team-resource, e.g. an instance could be named kraken-webserver1.
  • Allocate cost-effective resource sizes. Projects are monitored and excessive resource use will result in the containing project’s termination (and possibly yours), so beware. This is the guidance the monitoring team is willing to share: unless directed, use n1-standard-1.

1. Create development VPC manually

The First step is to create a VPC called griffin-dev-vpc

  • Click on the Create VPC network.
  • In the Name, field write griffin-dev-vpc.
  • Select Custom for the Subnet creation mode.
  • Configure the following settings in Subnet creation:
  • Configure the following settings in Subnet creation:
  • check progress

2.Create production VPC using Deployment Manager

This step is to Create production VPC using Deployment Manager

cd dm
edit prod-network.yaml
  • Now you have to create the production VPC network with the configuration files:
gcloud deployment-manager deployments create griffin-prod --config prod-network.yaml

3.Create bastion host

This step is to create a bastion host.

  • Configure the following settings to create the bastion host.
  • Now Add bastion to the Network tags field.
  • Click Create.
  • Click Add network interface, make sure that you set up two network interfaces,

Task 4: Create and config

This step is to create and configure Cloud SQL Instance.

  • Click Create Instance>Choose MySQL.
  • Use the following parameters to create the instance:
  • click enter
  • Enter the Root password written in the previous step.
  • In the SQL console, run the following query to create the WordPress database:(copy this and paste in same cloud shell).
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO "wp_user"@"%" IDENTIFIED BY "stormwind_rules";
FLUSH PRIVILEGES;
  • check progress

5.Create Kubernetes cluster

This step is to create a Kubernetes cluster.

  • Click Create cluster.
  • In the Cluster basics tab, configure:
  • Click Nodes Under default-pool, and set Machine type: n1-standard-4
  • Go to the Networking tab under cluster, set

6.Prepare the Kubernetes cluster

This step is to Edit the YAML file.

cd ~/wp-k8s
edit wp-env.yaml
  • password_goes_here with stormwind_rules.
  • Save the changes.
  • Connect the Kubernetes cluster:
  • kubectl apply -f wp-env.yaml
  • Create the key, and then add the key to the Kubernetes environment:
gcloud iam service-accounts keys create key.json \
--iam-account=cloud-sql-proxy@$GOOGLE_CLOUD_PROJECT.iam.gserviceaccount.com
kubectl create secret generic cloudsql-instance-credentials \
--from-file key.json

7.Create a WordPress deployment

This step is to Create a WordPress deployment.

cd ~/wp-k8s
edit wp-deployment.yaml
  • Save the file.
  • Now run Deployment and service file in Cloud Shell.
kubectl create -f wp-deployment.yaml
kubectl create -f wp-service.yaml

8.Enable monitoring

This step is to Enable monitoring.

  • Click Uptime checks.
  • Configure using the following parameters:

9. Provide access for an additional engineer

This step is to Provide access for Second User.

  • Click +ADD.
  • Copy and paste the second user account for the lab to the New members field.
  • In the Role dropdown, select Project -> Editor.
  • Click Save.

--

--

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