Your challenge
As soon as you sit down at your desk and open your new laptop, you receive several requests from the Nucleus team. Read through each description, and then create the resources.
Task 1: Create a project jumphost instance
You will use this instance to perform maintenance for the project.
Requirements:
- Name the instance
nucleus-jumphost-598
. - Use an f1-micro machine type.
- Use the default image type (Debian Linux).
Click Check my progress to verify the objective.
gcloud compute instances create nucleus-jumphost-598 --machine-type=f1-micro
ask 2: Create a Kubernetes service cluster
The team is building an application that will use a service running on Kubernetes. You need to:
- Create a cluster (in the us-east1-b zone) to host the service.
- Use the Docker container hello-app (
gcr.io/google-samples/hello-app:2.0
) as a place holder; the team will replace the container with their own work later. - Expose the app on port
.8080
Click Check my progress to verify the objective.
gcloud container clusters create my-cluster1
student_01_45ca4c80250a@cloudshell:~ (qwiklabs-gcp-04-30f2c219d6ce)$ gcloud container clusters get-credentials my-cluster1Fetching cluster endpoint and auth data.
kubeconfig entry generated for my-cluster1.
student_01_45ca4c80250a@cloudshell:~ (qwiklabs-gcp-04-30f2c219d6ce)$ kubectl create deployment hello-app --image=gcr.io/google-samples/hello-app:2.0
deployment.apps/hello-app created
student_01_45ca4c80250a@cloudshell:~ (qwiklabs-gcp-04-30f2c219d6ce)$ kubectl expose deployment hell0app --type=LoadBalancer --port 8080
Error from server (NotFound): deployments.apps "hell0app" not found
student_01_45ca4c80250a@cloudshell:~ (qwiklabs-gcp-04-30f2c219d6ce)$ kubectl expose deployment hello-app --type=LoadBalancer --port 8080
service/hello-app exposed
student_01_45ca4c80250a@cloudshell:~ (qwiklabs-gcp-04-30f2c219d6ce)$
Task 3: Set up an HTTP load balancer
You will serve the site via nginx web servers, but you want to ensure that the environment is fault-tolerant. Create an HTTP load balancer with a managed instance group of 2 nginx web servers. Use the following code to configure the web servers; the team will replace this with their own configuration later.
cat << EOF > startup.sh #! /bin/bash apt-get update apt-get install -y nginx service nginx start sed -i -- 's/nginx/Google Cloud Platform - '"\$HOSTNAME"'/' /var/www/html/index.nginx-debian.html EOF
You need to:
- Create an instance template.
- Create a target pool.
- Create a managed instance group.
- Create a firewall rule named as
to allow traffic (80/tcp).allow-tcp-rule-554
- Create a health check.
- Create a backend service, and attach the managed instance group.
- Create a URL map, and target the HTTP proxy to route requests to your URL map.
- Create a forwarding rule.
No comments:
Post a Comment