ComputeInstanceGroupManager


Property Value
Google Cloud Service Name Compute Engine
Google Cloud Service Documentation /compute/docs/
Google Cloud REST Resource Name beta.instanceGroupManagers
Google Cloud REST Resource Documentation /compute/docs/reference/rest/beta/instanceGroupManagers
Config Connector Resource Short Names gcpcomputeinstancegroupmanager
gcpcomputeinstancegroupmanagers
computeinstancegroupmanager
Config Connector Service Name compute.googleapis.com
Config Connector Resource Fully Qualified Name computeinstancegroupmanagers.compute.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMember No
Config Connector Default Average Reconcile Interval In Seconds 600

Custom Resource Definition Properties

Spec

Schema

autoHealingPolicies:
- healthCheckRef:
    external: string
    name: string
    namespace: string
  initialDelaySec: integer
baseInstanceName: string
description: string
distributionPolicy:
  targetShape: string
  zones:
  - zone: string
failoverAction: string
instanceTemplateRef:
  external: string
  name: string
  namespace: string
location: string
namedPorts:
- name: string
  port: integer
projectRef:
  external: string
  name: string
  namespace: string
resourceID: string
serviceAccountRef:
  external: string
  name: string
  namespace: string
statefulPolicy:
  preservedState:
    disks:
      string: object
    externalIps:
      string: object
    internalIps:
      string: object
targetPools:
- external: string
  name: string
  namespace: string
targetSize: integer
updatePolicy:
  instanceRedistributionType: string
  maxSurge:
    fixed: integer
    percent: integer
  maxUnavailable:
    fixed: integer
    percent: integer
  minReadySec: integer
  minimalAction: string
  mostDisruptiveAllowedAction: string
  replacementMethod: string
  type: string
versions:
- instanceTemplateRef:
    external: string
    name: string
    namespace: string
  name: string
  targetSize:
    calculated: integer
    fixed: integer
    percent: integer
Fields

autoHealingPolicies

Optional

list (object)

The autohealing policy for this managed instance group. You can specify only one value.

autoHealingPolicies[]

Optional

object

autoHealingPolicies[].healthCheckRef

Optional

object

autoHealingPolicies[].healthCheckRef.external

Optional

string

The URL for the health check that signals autohealing. Allowed value: The `selfLink` field of a `ComputeHealthCheck` resource.

autoHealingPolicies[].healthCheckRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

autoHealingPolicies[].healthCheckRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

autoHealingPolicies[].initialDelaySec

Optional

integer

The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600].

baseInstanceName

Optional

string

The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).

description

Optional

string

Immutable. An optional description of this resource.

distributionPolicy

Optional

object

Policy specifying the intended distribution of managed instances across zones in a regional managed instance group.

distributionPolicy.targetShape

Optional

string

The distribution shape to which the group converges either proactively or on resize events (depending on the value set in `updatePolicy.instanceRedistributionType`). Possible values: TARGET_SHAPE_UNSPECIFIED, ANY, BALANCED, ANY_SINGLE_ZONE

distributionPolicy.zones

Optional

list (object)

Immutable. Zones where the regional managed instance group will create and manage its instances.

distributionPolicy.zones[]

Optional

object

distributionPolicy.zones[].zone

Optional

string

Immutable. The URL of the [zone](/compute/docs/regions-zones/#available). The zone must exist in the region where the managed instance group is located.

failoverAction

Optional

string

The action to perform in case of zone failure. Only one value is supported, `NO_FAILOVER`. The default is `NO_FAILOVER`. Possible values: UNKNOWN, NO_FAILOVER

instanceTemplateRef

Optional

object

instanceTemplateRef.external

Optional

string

The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run `recreateInstances`, run `applyUpdatesToInstances`, or set the group's `updatePolicy.type` to `PROACTIVE`. Allowed value: The `selfLink` field of a `ComputeInstanceTemplate` resource.

instanceTemplateRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

instanceTemplateRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

location

Optional

string

Immutable. The location of this resource.

namedPorts

Optional

list (object)

Immutable. Named ports configured for the Instance Groups complementary to this Instance Group Manager.

namedPorts[]

Optional

object

namedPorts[].name

Optional

string

Immutable. The name for this named port. The name must be 1-63 characters long, and comply with [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).

namedPorts[].port

Optional

integer

Immutable. The port number, which can be a value between 1 and 65535.

projectRef

Required

object

Immutable. The Project that this resource belongs to.

projectRef.external

Optional

string

The project for the resource Allowed value: The Google Cloud resource name of a `Project` resource (format: `projects/{{name}}`).

projectRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

projectRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

resourceID

Optional

string

Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.

serviceAccountRef

Optional

object

serviceAccountRef.external

Optional

string

The service account to be used as credentials for all operations performed by the managed instance group on instances. The service accounts needs all permissions required to create and delete instances. By default, the service account: {projectNumber}@cloudservices.gserviceaccount.com is used. Allowed value: The `email` field of an `IAMServiceAccount` resource.

serviceAccountRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

serviceAccountRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

statefulPolicy

Optional

object

Stateful configuration for this Instanced Group Manager

statefulPolicy.preservedState

Optional

object

statefulPolicy.preservedState.disks

Optional

map (key: string, value: object)

Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks.

statefulPolicy.preservedState.externalIps

Optional

map (key: string, value: object)

External network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name.

statefulPolicy.preservedState.internalIps

Optional

map (key: string, value: object)

Internal network IPs assigned to the instances that will be preserved on instance delete, update, etc. This map is keyed with the network interface name.

targetPools

Optional

list (object)

targetPools[]

Optional

object

targetPools[].external

Optional

string

Allowed value: The `selfLink` field of a `ComputeTargetPool` resource.

targetPools[].name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

targetPools[].namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

targetSize

Required

integer

The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.

updatePolicy

Optional

object

The update policy for this managed instance group.

updatePolicy.instanceRedistributionType

Optional

string

The [instance redistribution policy](/compute/docs/instance-groups/regional-migs#proactive_instance_redistribution) for regional managed instance groups. Valid values are: - `PROACTIVE` (default): The group attempts to maintain an even distribution of VM instances across zones in the region. - `NONE`: For non-autoscaled groups, proactive redistribution is disabled.

updatePolicy.maxSurge

Optional

object

The maximum number of instances that can be created above the specified `targetSize` during the update process. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded if necessary. The default value for `maxSurge` is a fixed value equal to the number of zones in which the managed instance group operates. At least one of either `maxSurge` or `maxUnavailable` must be greater than 0. Learn more about [`maxSurge`](/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#max_surge).

updatePolicy.maxSurge.fixed

Optional

integer

Specifies a fixed number of VM instances. This must be a positive integer.

updatePolicy.maxSurge.percent

Optional

integer

Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify `80` for 80%.

updatePolicy.maxUnavailable

Optional

object

The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied: - The instance's [status](/compute/docs/instances/checking-instance-status) is `RUNNING`. - If there is a [health check](/compute/docs/instance-groups/autohealing-instances-in-migs) on the instance group, the instance's health check status must be `HEALTHY` at least once. If there is no health check on the group, then the instance only needs to have a status of `RUNNING` to be considered available. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded if necessary. The default value for `maxUnavailable` is a fixed value equal to the number of zones in which the managed instance group operates. At least one of either `maxSurge` or `maxUnavailable` must be greater than 0. Learn more about [`maxUnavailable`](/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#max_unavailable).

updatePolicy.maxUnavailable.fixed

Optional

integer

Specifies a fixed number of VM instances. This must be a positive integer.

updatePolicy.maxUnavailable.percent

Optional

integer

Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify `80` for 80%.

updatePolicy.minReadySec

Optional

integer

Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600].

updatePolicy.minimalAction

Optional

string

Minimal action to be taken on an instance. You can specify either `RESTART` to restart existing instances or `REPLACE` to delete and create new instances from the target template. If you specify a `RESTART`, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.

updatePolicy.mostDisruptiveAllowedAction

Optional

string

Most disruptive action that is allowed to be taken on an instance. You can specify either `NONE` to forbid any actions, `REFRESH` to allow actions that do not need instance restart, `RESTART` to allow actions that can be applied without instance replacing or `REPLACE` to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all.

updatePolicy.replacementMethod

Optional

string

What action should be used to replace instances. See minimal_action.REPLACE Possible values: SUBSTITUTE, RECREATE

updatePolicy.type

Optional

string

The type of update process. You can specify either `PROACTIVE` so that the instance group manager proactively executes actions in order to bring instances to their target versions or `OPPORTUNISTIC` so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or `recreateInstances` calls).

versions

Optional

list (object)

Specifies the instance templates used by this managed instance group to create instances. Each version is defined by an `instanceTemplate` and a `name`. Every version can appear at most once per instance group. This field overrides the top-level `instanceTemplate` field. Read more about the [relationships between these fields](/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#relationship_between_versions_and_instancetemplate_properties_for_a_managed_instance_group). Exactly one `version` must leave the `targetSize` field unset. That version will be applied to all remaining instances. For more information, read about [canary updates](/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#starting_a_canary_update).

versions[]

Optional

object

versions[].instanceTemplateRef

Optional

object

versions[].instanceTemplateRef.external

Optional

string

The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached. The templates for existing instances in the group do not change unless you run `recreateInstances`, run `applyUpdatesToInstances`, or set the group's `updatePolicy.type` to `PROACTIVE`; in those cases, existing instances are updated until the `targetSize` for this version is reached. Allowed value: The `selfLink` field of a `ComputeInstanceTemplate` resource.

versions[].instanceTemplateRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

versions[].instanceTemplateRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

versions[].name

Optional

string

Name of the version. Unique among all versions in the scope of this managed instance group.

versions[].targetSize

Optional

object

Specifies the intended number of instances to be created from the `instanceTemplate`. The final number of instances created from the template will be equal to: - If expressed as a fixed number, the minimum of either `targetSize.fixed` or `instanceGroupManager.targetSize` is used. - if expressed as a `percent`, the `targetSize` would be `(targetSize.percent/100 * InstanceGroupManager.targetSize)` If there is a remainder, the number is rounded. If unset, this version will update any remaining instances not updated by another `version`. Read [Starting a canary update](/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups#starting_a_canary_update) for more information.

versions[].targetSize.calculated

Optional

integer

[Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is `fixed`, then the `calculated` value is equal to the `fixed` value. - If the value is a `percent`, then the `calculated` value is `percent`/100 * `targetSize`. For example, the `calculated` value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.

versions[].targetSize.fixed

Optional

integer

Specifies a fixed number of VM instances. This must be a positive integer.

versions[].targetSize.percent

Optional

integer

Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify `80` for 80%.

Status

Schema

conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
creationTimestamp: string
currentActions:
  abandoning: integer
  creating: integer
  creatingWithoutRetries: integer
  deleting: integer
  none: integer
  recreating: integer
  refreshing: integer
  restarting: integer
  verifying: integer
fingerprint: string
id: integer
instanceGroup: string
observedGeneration: integer
region: string
selfLink: string
status:
  autoscaler: string
  isStable: boolean
  stateful:
    hasStatefulConfig: boolean
    isStateful: boolean
    perInstanceConfigs:
      allEffective: boolean
  versionTarget:
    isReached: boolean
updatePolicy:
  maxSurge:
    calculated: integer
  maxUnavailable:
    calculated: integer
zone: string
Fields
conditions

list (object)

Conditions represent the latest available observation of the resource's current state.

conditions[]

object

conditions[].lastTransitionTime

string

Last time the condition transitioned from one status to another.

conditions[].message

string

Human-readable message indicating details about last transition.

conditions[].reason

string

Unique, one-word, CamelCase reason for the condition's last transition.

conditions[].status

string

Status is the status of the condition. Can be True, False, Unknown.

conditions[].type

string

Type is the type of the condition.

creationTimestamp

string

The creation timestamp for this managed instance group in \[RFC3339\](https://www.ietf.org/rfc/rfc3339.txt) text format.

currentActions

object

[Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions.

currentActions.abandoning

integer

[Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.

currentActions.creating

integer

[Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully. If you have disabled creation retries, this field will not be populated; instead, the `creatingWithoutRetries` field will be populated.

currentActions.creatingWithoutRetries

integer

[Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's `targetSize` value accordingly.

currentActions.deleting

integer

[Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.

currentActions.none

integer

[Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.

currentActions.recreating

integer

[Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.

currentActions.refreshing

integer

[Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.

currentActions.restarting

integer

[Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.

currentActions.verifying

integer

[Output Only] The number of instances in the managed instance group that are being verified. See the `managedInstances[].currentAction` property in the `listManagedInstances` method documentation.

fingerprint

string

Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error `412 conditionNotMet`. To see the latest fingerprint, make a `get()` request to retrieve an InstanceGroupManager.

id

integer

[Output Only] A unique identifier for this resource type. The server generates this identifier.

instanceGroup

string

[Output Only] The URL of the Instance Group resource.

observedGeneration

integer

ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.

region

string

[Output Only] The URL of the [region](/compute/docs/regions-zones/#available) where the managed instance group resides (for regional resources).

selfLink

string

[Output Only] The URL for this managed instance group. The server defines this URL.

status

object

[Output Only] The status of this managed instance group.

status.autoscaler

string

[Output Only] The URL of the [Autoscaler](/compute/docs/autoscaler/) that targets this instance group manager.

status.isStable

boolean

[Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified.

status.stateful

object

[Output Only] Stateful status of the given Instance Group Manager.

status.stateful.hasStatefulConfig

boolean

[Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions.

status.stateful.isStateful

boolean

[Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. This field is deprecated in favor of has_stateful_config.

status.stateful.perInstanceConfigs

object

[Output Only] Status of per-instance configs on the instance.

status.stateful.perInstanceConfigs.allEffective

boolean

A bit indicating if all of the group's per-instance configs (listed in the output of a listPerInstanceConfigs API call) have status `EFFECTIVE` or there are no per-instance-configs.

status.versionTarget

object

[Output Only] A status of consistency of Instances' versions with their target version specified by `version` field on Instance Group Manager.

status.versionTarget.isReached

boolean

[Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by `version` field on Instance Group Manager.

updatePolicy

object

updatePolicy.maxSurge

object

updatePolicy.maxSurge.calculated

integer

[Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is `fixed`, then the `calculated` value is equal to the `fixed` value. - If the value is a `percent`, then the `calculated` value is `percent`/100 * `targetSize`. For example, the `calculated` value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.

updatePolicy.maxUnavailable

object

updatePolicy.maxUnavailable.calculated

integer

[Output Only] Absolute value of VM instances calculated based on the specific mode. - If the value is `fixed`, then the `calculated` value is equal to the `fixed` value. - If the value is a `percent`, then the `calculated` value is `percent`/100 * `targetSize`. For example, the `calculated` value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.

zone

string

[Output Only] The URL of a [zone](/compute/docs/regions-zones/#available) where the managed instance group is located (for zonal resources).

Sample YAML(s)

Regional Compute Instance Group Manager

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeInstanceGroupManager
metadata:
  name: computeinstancegroupmanager-sample-regional
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  location: us-central1
  baseInstanceName: app
  autoHealingPolicies:
    - healthCheckRef:
        name: computeinstancegroupmanager-dep-regional
      initialDelaySec: 300
  targetSize: 3
  instanceTemplateRef:
    name: computeinstancegroupmanager-dep-regional
  updatePolicy:
    instanceRedistributionType: PROACTIVE
    minimalAction: RESTART
    maxSurge:
      fixed: 3
    maxUnavailable:
      fixed: 3
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeHealthCheck
metadata:
  name: computeinstancegroupmanager-dep-regional
spec:
  httpHealthCheck:
    port: 80
  location: global
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeInstanceTemplate
metadata:
  name: computeinstancegroupmanager-dep-regional
spec:
  machineType: n1-standard-1
  disk:
  - sourceImageRef:
      external: debian-cloud/debian-11
    boot: true
  networkInterface:
  - networkRef:
      name: computeinstancegroupmanager-dep-regional
    subnetworkRef:
      name: computeinstancegroupmanager-dep-regional
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeNetwork
metadata:
  name: computeinstancegroupmanager-dep-regional
spec:
  routingMode: REGIONAL
  autoCreateSubnetworks: false
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeSubnetwork
metadata:
  name: computeinstancegroupmanager-dep-regional
spec:
  ipCidrRange: 10.2.0.0/16
  region: us-central1
  privateIpGoogleAccess: false
  networkRef:
    name: computeinstancegroupmanager-dep-regional

Zonal Compute Instance Group Manager

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeInstanceGroupManager
metadata:
  name: computeinstancegroupmanager-sample-zonal
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  location: us-central1-a
  baseInstanceName: app
  autoHealingPolicies:
    - healthCheckRef:
        name: computeinstancegroupmanager-dep-zonal
      initialDelaySec: 300
  targetSize: 3
  instanceTemplateRef:
    name: computeinstancegroupmanager-dep-zonal
  updatePolicy:
    minimalAction: RESTART
    maxSurge:
      fixed: 3
    maxUnavailable:
      fixed: 3
  statefulPolicy:
    preservedState:
      disks:
        disk-a:
          autoDelete: "ON_PERMANENT_INSTANCE_DELETION"
        disk-b:
          autoDelete: "NEVER"
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeHealthCheck
metadata:
  name: computeinstancegroupmanager-dep-zonal
spec:
  httpHealthCheck:
    port: 80
  location: global
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeInstanceTemplate
metadata:
  name: computeinstancegroupmanager-dep-zonal
spec:
  machineType: n1-standard-1
  disk:
  - sourceImageRef:
      external: debian-cloud/debian-11
    boot: true
  - deviceName: disk-a
    sourceImageRef:
      external: debian-cloud/debian-11
    autoDelete: true
    boot: false
  - deviceName: disk-b
    sourceImageRef:
      external: debian-cloud/debian-11
    boot: false
  networkInterface:
  - networkRef:
      name: computeinstancegroupmanager-dep-zonal
    subnetworkRef:
      name: computeinstancegroupmanager-dep-zonal
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeNetwork
metadata:
  name: computeinstancegroupmanager-dep-zonal
spec:
  routingMode: REGIONAL
  autoCreateSubnetworks: false
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeSubnetwork
metadata:
  name: computeinstancegroupmanager-dep-zonal
spec:
  ipCidrRange: 10.2.0.0/16
  region: us-central1
  privateIpGoogleAccess: false
  networkRef:
    name: computeinstancegroupmanager-dep-zonal