Create an instance template for the instances so VMs have same specs. Set the "''Automatic Restart' to on to VM automatically restarts upon crash. Set the "'On-host maintenance' to Migrate VM instance. This will take care of VM during maintenance window. It will migrate VM instance making it highly available Add the instance template to an instance group so instances can be managed. * onHostMaintenance: Determines the behavior when a maintenance event occurs that might cause your instance to reboot. * [Default] MIGRATE, which causes Compute Engine to live migrate an instance when there is a maintenance event. * TERMINATE, which stops an instance instead of migrating it. * automaticRestart: Determines the behavior when an instance crashes or is stopped by the system. * [Default] true, so Compute Engine restarts an instance if the instance crashes or is stopped. * false, so Compute Engine does not restart an instance if the instance crashes or is stopped. Enabling automatic restart ensures that compute engine instances are automatically restarted when they crash. And Enabling Migrate VM Instance enables live migrates i.e. compute instances are migrated during system maintenance and remain running during the migration. Automatic Restart If your instance is set to terminate when there is a maintenance event, or if your instance crashes because of an underlying hardware issue, you can set up Compute Engine to automatically restart the instance by setting the automaticRestart field to true. This setting does not apply if the instance is taken offline through a user action, such as calling sudo shutdown, or during a zone outage. Ref: https://cloud.google.com/compute/docs/instances/setting-instance-scheduling-options#autorestart Enabling the Migrate VM Instance option migrates your instance away from an infrastructure maintenance event, and your instance remains running during the migration. Your instance might experience a short period of decreased performance, although generally, most instances should not notice any difference. This is ideal for instances that require constant uptime and can tolerate a short period of decreased performance. Ref: https://cloud.google.com/compute/docs/instances/setting-instance-scheduling-options#live_migrate
https://cloud.google.com/compute/docs/autoscaler#specifications Autoscaling works independently from autohealing. If you configure autohealing for your group and an instance fails the health check, the autohealer attempts to recreate the instance. Recreating an instance can cause the number of instances in the group to fall below the autoscaling threshold (minNumReplicas) that you specify. Since we need the application running at all times, we need a minimum 1 instance. Only a single instance of the VM should run, we need a maximum 1 instance. We want the application running at all times. If the VM crashes due to any underlying hardware failure, we want another instance to be added to MIG so that application can continue to serve requests. We can achieve this by enabling autoscaling. The only option that satisfies these three is Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1. Ref: https://cloud.google.com/compute/docs/autoscaler
Associate-Cloud-Engineer-JPN 試験問題 23
Kubernetes マニフェストを使用して、コンテナ化された新しいアプリケーションを Google Cloud にデプロイしたいと考えています。Kubernetes のデプロイを完全に制御すると同時に、インフラストラクチャの構成を最小限に抑えたいと考えています。どうすればよいでしょうか。
正解: A
Associate-Cloud-Engineer-JPN 試験問題 24
IP 10.0.3.21でライセンスサーバーを検索するアプリケーションがあります。ライセンスサーバーをCompute Engineにデプロイする必要があります。アプリケーションの構成を変更せず、アプリケーションがライセンスサーバーにアクセスできるようにしたい。あなたは何をするべきか?
正解: A
IP 10.0.3.21 is internal by default, and to ensure that it will be static non-changing it should be selected as static internal ip address.
Cloud Functions is Google Cloud's event-driven serverless compute platform that lets you run your code locally or in the cloud without having to provision servers. Cloud Functions scales up or down, so you pay only for compute resources you use. Cloud Functions have excellent integration with Cloud Pub/Sub, lets you scale down to zero and is recommended by Google as the ideal serverless platform to use when dependent on Cloud Pub/Sub. "If you're building a simple API (a small set of functions to be accessed via HTTP or Cloud Pub/Sub), we recommend using Cloud Functions." Ref: https://cloud.google.com/serverless-options