Skip to content

Latest commit

 

History

History
90 lines (64 loc) · 2.34 KB

File metadata and controls

90 lines (64 loc) · 2.34 KB

Create and Manage Cloud Resources: Challenge Lab

Task 1. Create a project jumphost instance

  • Buat VM instance dengan spesifikasi berikut:

    nama instance : nucleus-jumphost-715.
    Use an f1-micro machine type. (Series N1)
    default image type (Debian Linux).
    

Task 2. Create a Kubernetes service cluster

  1. Buat Cluster

    gcloud container clusters create --machine-type=e2-medium --zone=us-west4-b nucleus-cluster1
  2. Authentikasi kubectl

    gcloud container clusters get-credentials --zone=us-west4-b  nucleus-cluster1
  3. Deploy aplikasi

    kubectl create deployment my-app --image=gcr.io/google-samples/hello-app:2.0
  4. Expose aplikasi

    kubectl expose deployment my-app --type=LoadBalancer --port 8083

Task 3. Set up an HTTP load balancer

  • this

    gcloud compute instance-templates create web-server-template \
        --metadata-from-file startup-script=startup.sh \
        --network nucleus-vpc \
        --machine-type g1-small \
        --region us-east1
    
    gcloud compute target-pools create nginx-pool
    
    gcloud compute instance-groups managed create web-server-group \
        --base-instance-name web-server \
        --size 2 \
        --template web-server-template \
        --region us-east1
    
    gcloud compute firewall-rules create <Copy FIREWALL_NAME given in the lab> \
        --allow tcp:80 \
        --network nucleus-vpc
    
    gcloud compute http-health-checks create http-basic-check
    
    gcloud compute instance-groups managed \
        set-named-ports web-server-group \
        --named-ports http:80 \
        --region us-east1
    
    gcloud compute backend-services create web-server-backend \
        --protocol HTTP \
        --http-health-checks http-basic-check \
        --global
    
    gcloud compute backend-services add-backend web-server-backend \
        --instance-group web-server-group \
        --instance-group-region us-east1 \
        --global
    
    gcloud compute url-maps create web-server-map \
        --default-service web-server-backend
    
    gcloud compute target-http-proxies create http-lb-proxy \
        --url-map web-server-map
    
    gcloud compute forwarding-rules create permit-tcp-rule-261 \
        --global \
        --target-http-proxy http-lb-proxy \
        --ports 80