You can pass GCP ACE exam by memorizing below commands.
> gcloud compute networks subnet list –filter=”region:(AAA BBB)”
And, node number setting is below.
Initial node number: 30
Least node number: 15
Max node number: 50
> gcloud container cluster create test-cluster –num-nodes 30 –enable-autoscaling –min-nodes 15 –max-nodes 50 –zone AAA.
Execute script(test_script.sh) at the time of instance starting.
> gcloud compute instances create test-instance –metadata-from-file startup-script=scripts/test_script.sh
> kubectl exec -it my-pod –container my-app — /bin/bash
Set SQL injection countermeasure by applying Cloud Armor.
> gcloud compute security-policies rules create
with below parameter.
— expression “evaluatePreconfiguredExpr(‘sqli-canary’)” — action deny-403
> gcloud compute instances list –filter=”zone:(AAA BBB)”
> Designate “GSUtil: encryption_key=[YOUR_ENCRYPTION_KEY]” in the gsutil command.
> Access below URL.
https://storage.googleapis.com/my-bucket/my-image.jpg
> gcloud config configurations list
> gcloud config configurations activate XXXX
> gcloud compute instances create my-custom-instance –custom-cpu 4 –custom-memory 4
> gsutil versioning set on gs://my-bucket
> gcloud compute images list –filter=name:ubuntu
> gcloud container clusters get-credentials my-cluster
-> kubeconfig entry will be generated.Change default zone to AAA zone
> gcloud config set compute/zone AAA
Publicize your service.
Receive traffic with port number 8080 and publicize to external user with port 80 by Loadbalancer.
> kubectl expose deployment my-deployment –type LoadBalancer –port80 –target-port 8080
Expand IP range
> gcloud compute networks subnets expand-ip-range my-subnet –region AAA –prefix-length=XX
Deploy Web application to Kubernetes
> Execute docker build command to create container image.
And upload it to Container Registry.
Check the change contents in advance before updating your configuration with yaml file.
> gcloud deployment-manager deployments update my-config –config new-config.yaml –preview
Conducting test before migrating your application from App Engine standard environment to Flexible environment.
> set env: flex to app.yaml.
Execute gcloud app deploy command with –-no-promote option.
> After testing, migrate it by executing below command.
gcloud app versions migrate command.
Access relay server by SSH protocol
> gcloud compute ssh username@bastion-host
Create Kubernetes cluster in zone AAA with node number 6.
> gcloud container clusters create my-cluster –zone:AAA –num-nodes 6
Install App Engine Extended function for python2
> gcloud components install app-engine-python
Set auto-scaling with Average CPU usage 70% and max instance size 3.
> gcloud compute instance-groups managed set-autoscaling my-instance-group –max-num-replicas 3 –target-cpu-utilization 0.70
Deploy your application to production environment
> Execute gcloud app deploy command.
Publicize your file uploaded in the bucket by executing gsutil command tool.
> gsutil defacl set public-read gs://xxxx..com
Create a function on the Cloud Functions
> gcloud functions deploy
Access my project by Cloud SDK. JSON key file has already been created.
> gcloud auth activate-service-account my-service-account@my-project.xxxxx.com –key-file mykey.json –project test-project
> gcloud config configurations activate (Configuration name)
> gsutil signurl -m PUT -d 2h my-json-key.json gs://my-buckt/xxxx.pdf
> bq extract my-table gs://my-bucket/xxxx.csv
> gcloud deployment-manager deployments list –project my-project
> gcloud app services set-traffic my-service –splits <previous version> = 1
> Execute bq query –dry-run command.
Use Pricing Calculator and exchange byte expectation to cost.
> gcloud services enable cloudfunctions.googleapis.com
> gcloud iam roles copy xxxx yyyy
> gcloud deployment-manager deployments update –config new_config.yaml
> Execute gcloud app deploy command by designating service component by app.yaml file.Display member and role list
> gcloud projects get-iam-policy my-project
コメント