ComputeDisk


Property Value
Google Cloud Service Name Compute Engine
Google Cloud Service Documentation /compute/docs/
Google Cloud REST Resource Name
v1.disks
v1.regionDisks
Google Cloud REST Resource Documentation
/compute/docs/reference/rest/v1/disks
/compute/docs/reference/rest/v1/regionDisks
Config Connector Resource Short Names gcpcomputedisk
gcpcomputedisks
computedisk
Config Connector Service Name compute.googleapis.com
Config Connector Resource Fully Qualified Name computedisks.compute.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMember Yes
Supports IAM Conditions No
Supports IAM Audit Configs No
IAM External Reference Format

projects/{{project}}/regions/{{region}}/disks/{{name}}

projects/{{project}}/zones/{{zone}}/disks/{{name}}

Config Connector Default Average Reconcile Interval In Seconds 600

ComputeDisk can manage both zonal and regional disks. To manage a zonal or regional disk, in the spec.location field use the name of a zone or region respectively.

Custom Resource Definition Properties

Annotations

Fields
cnrm.cloud.google.com/state-into-spec

Spec

Schema

asyncPrimaryDisk:
  diskRef:
    external: string
    name: string
    namespace: string
description: string
diskEncryptionKey:
  kmsKeyRef:
    external: string
    name: string
    namespace: string
  kmsKeyServiceAccountRef:
    external: string
    name: string
    namespace: string
  rawKey:
    value: string
    valueFrom:
      secretKeyRef:
        key: string
        name: string
  rsaEncryptedKey:
    value: string
    valueFrom:
      secretKeyRef:
        key: string
        name: string
  sha256: string
enableConfidentialCompute: boolean
guestOsFeatures:
- type: string
imageRef:
  external: string
  name: string
  namespace: string
interface: string
licenses:
- string
location: string
multiWriter: boolean
physicalBlockSizeBytes: integer
projectRef:
  external: string
  name: string
  namespace: string
provisionedIops: integer
provisionedThroughput: integer
replicaZones:
- string
resourceID: string
resourcePolicies:
- external: string
  name: string
  namespace: string
size: integer
snapshotRef:
  external: string
  name: string
  namespace: string
sourceDiskRef:
  external: string
  name: string
  namespace: string
sourceImageEncryptionKey:
  kmsKeyRef:
    external: string
    name: string
    namespace: string
  kmsKeyServiceAccountRef:
    external: string
    name: string
    namespace: string
  rawKey: string
  sha256: string
sourceSnapshotEncryptionKey:
  kmsKeyRef:
    external: string
    name: string
    namespace: string
  kmsKeyServiceAccountRef:
    external: string
    name: string
    namespace: string
  rawKey: string
  sha256: string
type: string
Fields

asyncPrimaryDisk

Optional

object

Immutable. A nested object resource.

asyncPrimaryDisk.diskRef

Required*

object

Immutable. Primary disk for asynchronous disk replication.

asyncPrimaryDisk.diskRef.external

Optional

string

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

asyncPrimaryDisk.diskRef.name

Optional

string

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

asyncPrimaryDisk.diskRef.namespace

Optional

string

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

description

Optional

string

Immutable. An optional description of this resource. Provide this property when you create the resource.

diskEncryptionKey

Optional

object

Immutable. Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later.

diskEncryptionKey.kmsKeyRef

Optional

object

The encryption key used to encrypt the disk. Your project's Compute Engine System service account ('service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com') must have 'roles/cloudkms.cryptoKeyEncrypterDecrypter' to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

diskEncryptionKey.kmsKeyRef.external

Optional

string

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

diskEncryptionKey.kmsKeyRef.name

Optional

string

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

diskEncryptionKey.kmsKeyRef.namespace

Optional

string

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

diskEncryptionKey.kmsKeyServiceAccountRef

Optional

object

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

diskEncryptionKey.kmsKeyServiceAccountRef.external

Optional

string

Allowed value: The `email` field of an `IAMServiceAccount` resource.

diskEncryptionKey.kmsKeyServiceAccountRef.name

Optional

string

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

diskEncryptionKey.kmsKeyServiceAccountRef.namespace

Optional

string

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

diskEncryptionKey.rawKey

Optional

object

Immutable. Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

diskEncryptionKey.rawKey.value

Optional

string

Value of the field. Cannot be used if 'valueFrom' is specified.

diskEncryptionKey.rawKey.valueFrom

Optional

object

Source for the field's value. Cannot be used if 'value' is specified.

diskEncryptionKey.rawKey.valueFrom.secretKeyRef

Optional

object

Reference to a value with the given key in the given Secret in the resource's namespace.

diskEncryptionKey.rawKey.valueFrom.secretKeyRef.key

Required*

string

Key that identifies the value to be extracted.

diskEncryptionKey.rawKey.valueFrom.secretKeyRef.name

Required*

string

Name of the Secret to extract a value from.

diskEncryptionKey.rsaEncryptedKey

Optional

object

Immutable. Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey.

diskEncryptionKey.rsaEncryptedKey.value

Optional

string

Value of the field. Cannot be used if 'valueFrom' is specified.

diskEncryptionKey.rsaEncryptedKey.valueFrom

Optional

object

Source for the field's value. Cannot be used if 'value' is specified.

diskEncryptionKey.rsaEncryptedKey.valueFrom.secretKeyRef

Optional

object

Reference to a value with the given key in the given Secret in the resource's namespace.

diskEncryptionKey.rsaEncryptedKey.valueFrom.secretKeyRef.key

Required*

string

Key that identifies the value to be extracted.

diskEncryptionKey.rsaEncryptedKey.valueFrom.secretKeyRef.name

Required*

string

Name of the Secret to extract a value from.

diskEncryptionKey.sha256

Optional

string

The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

enableConfidentialCompute

Optional

boolean

Immutable. Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true.

guestOsFeatures

Optional

list (object)

Immutable. A list of features to enable on the guest operating system. Applicable only for bootable disks.

guestOsFeatures[]

Optional

object

guestOsFeatures[].type

Required*

string

Immutable. The type of supported feature. Read [Enabling guest operating system features](https://cloud.google.com/compute/docs/images/create-delete-deprecate-private-images#guest-os-features) to see a list of available options. Possible values: ["MULTI_IP_SUBNET", "SECURE_BOOT", "SEV_CAPABLE", "UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS", "GVNIC", "SEV_LIVE_MIGRATABLE", "SEV_SNP_CAPABLE", "SUSPEND_RESUME_COMPATIBLE", "TDX_CAPABLE"].

imageRef

Optional

object

The image from which to initialize this disk.

imageRef.external

Optional

string

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

imageRef.name

Optional

string

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

imageRef.namespace

Optional

string

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

interface

Optional

string

DEPRECATED. `interface` is deprecated. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment. Immutable. Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

licenses

Optional

list (string)

Immutable. Any applicable license URI.

licenses[]

Optional

string

location

Required

string

Location represents the geographical location of the ComputeDisk. Specify a region name or a zone name. Reference: GCP definition of regions/zones (https://cloud.google.com/compute/docs/regions-zones/)

multiWriter

Optional

boolean

Immutable. Indicates whether or not the disk can be read/write attached to more than one instance.

physicalBlockSizeBytes

Optional

integer

Immutable. Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.

projectRef

Optional

object

The project that this resource belongs to.

projectRef.external

Optional

string

Allowed value: The `name` field of a `Project` resource.

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/

provisionedIops

Optional

integer

Indicates how many IOPS must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it.

provisionedThroughput

Optional

integer

Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it.

replicaZones

Optional

list (string)

Immutable. URLs of the zones where the disk should be replicated to.

replicaZones[]

Optional

string

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.

resourcePolicies

Optional

list (object)

resourcePolicies[]

Optional

object

Resource policies applied to this disk for automatic snapshot creations. This field only applies for zonal compute disk resources.

resourcePolicies[].external

Optional

string

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

resourcePolicies[].name

Optional

string

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

resourcePolicies[].namespace

Optional

string

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

size

Optional

integer

Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the 'image' or 'snapshot' parameter, or specify it alone to create an empty persistent disk. If you specify this field along with 'image' or 'snapshot', the value must not be less than the size of the image or the size of the snapshot. Upsizing the disk is mutable, but downsizing the disk requires re-creating the resource.

snapshotRef

Optional

object

The source snapshot used to create this disk.

snapshotRef.external

Optional

string

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

snapshotRef.name

Optional

string

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

snapshotRef.namespace

Optional

string

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

sourceDiskRef

Optional

object

The source disk used to create this disk.

sourceDiskRef.external

Optional

string

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

sourceDiskRef.name

Optional

string

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

sourceDiskRef.namespace

Optional

string

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

sourceImageEncryptionKey

Optional

object

Immutable. The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.

sourceImageEncryptionKey.kmsKeyRef

Optional

object

The encryption key used to encrypt the disk. Your project's Compute Engine System service account ('service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com') must have 'roles/cloudkms.cryptoKeyEncrypterDecrypter' to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

sourceImageEncryptionKey.kmsKeyRef.external

Optional

string

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

sourceImageEncryptionKey.kmsKeyRef.name

Optional

string

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

sourceImageEncryptionKey.kmsKeyRef.namespace

Optional

string

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

sourceImageEncryptionKey.kmsKeyServiceAccountRef

Optional

object

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

sourceImageEncryptionKey.kmsKeyServiceAccountRef.external

Optional

string

Allowed value: The `email` field of an `IAMServiceAccount` resource.

sourceImageEncryptionKey.kmsKeyServiceAccountRef.name

Optional

string

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

sourceImageEncryptionKey.kmsKeyServiceAccountRef.namespace

Optional

string

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

sourceImageEncryptionKey.rawKey

Optional

string

Immutable. Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

sourceImageEncryptionKey.sha256

Optional

string

The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

sourceSnapshotEncryptionKey

Optional

object

Immutable. The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.

sourceSnapshotEncryptionKey.kmsKeyRef

Optional

object

The encryption key used to encrypt the disk. Your project's Compute Engine System service account ('service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com') must have 'roles/cloudkms.cryptoKeyEncrypterDecrypter' to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

sourceSnapshotEncryptionKey.kmsKeyRef.external

Optional

string

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

sourceSnapshotEncryptionKey.kmsKeyRef.name

Optional

string

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

sourceSnapshotEncryptionKey.kmsKeyRef.namespace

Optional

string

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

sourceSnapshotEncryptionKey.kmsKeyServiceAccountRef

Optional

object

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

sourceSnapshotEncryptionKey.kmsKeyServiceAccountRef.external

Optional

string

Allowed value: The `email` field of an `IAMServiceAccount` resource.

sourceSnapshotEncryptionKey.kmsKeyServiceAccountRef.name

Optional

string

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

sourceSnapshotEncryptionKey.kmsKeyServiceAccountRef.namespace

Optional

string

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

sourceSnapshotEncryptionKey.rawKey

Optional

string

Immutable. Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

sourceSnapshotEncryptionKey.sha256

Optional

string

The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

type

Optional

string

Immutable. URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

* Field is required when parent field is specified

Status

Schema

conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
creationTimestamp: string
labelFingerprint: string
lastAttachTimestamp: string
lastDetachTimestamp: string
observedGeneration: integer
selfLink: string
sourceDiskId: string
sourceImageId: string
sourceSnapshotId: string
users:
- 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

Creation timestamp in RFC3339 text format.

labelFingerprint

string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

lastAttachTimestamp

string

Last attach timestamp in RFC3339 text format.

lastDetachTimestamp

string

Last detach timestamp in RFC3339 text format.

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.

selfLink

string

sourceDiskId

string

The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name.

sourceImageId

string

The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.

sourceSnapshotId

string

The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.

users

list (string)

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance.

users[]

string

Sample YAML(s)

Compute Disk From Source Disk

# 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: ComputeDisk
metadata:
  annotations:
    cnrm.cloud.google.com/project-id: ${PROJECT_ID?}
  name: computedisk-dep-fromsourcedisk
spec:
  location: us-west1-c
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeDisk
metadata:
  annotations:
    cnrm.cloud.google.com/project-id: ${PROJECT_ID?}
  name: computedisk-sample-fromsourcedisk
spec:
  description: A regional disk created from the source disk.
  location: us-west1-c
  sourceDiskRef:
    name: computedisk-dep-fromsourcedisk

Regional Compute Disk

# 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: ComputeDisk
metadata:
  annotations:
    cnrm.cloud.google.com/project-id: ${PROJECT_ID?}
  name: computedisk-dep-regional
spec:
  location: us-west1-c
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeDisk
metadata:
  annotations:
    cnrm.cloud.google.com/project-id: ${PROJECT_ID?}
  name: computedisk-sample-regional
  labels:
    extra-gb: "100"
spec:
  description: A 600GB regional disk from a 500GB snapshot.
  location: us-central1
  replicaZones:
    - https://www.googleapis.com/compute/v1/projects/${PROJECT_ID?}/zones/us-central1-a
    - https://www.googleapis.com/compute/v1/projects/${PROJECT_ID?}/zones/us-central1-f
  size: 600
  physicalBlockSizeBytes: 16384
  snapshotRef:
    name: computedisk-dep-regional
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeSnapshot
metadata:
  annotations:
    cnrm.cloud.google.com/project-id: ${PROJECT_ID?}
  name: computedisk-dep-regional
spec:
  sourceDiskRef:
    name: computedisk-dep-regional
  zone: us-west1-c

Zonal Compute Disk

# 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: ComputeDisk
metadata:
  name: computedisk-sample-zonal
  labels:
    label-one: "value-one"
spec:
  description: a sample encrypted, blank disk
  diskEncryptionKey:
    rawKey:
      valueFrom:
        secretKeyRef:
          name: computedisk-dep-zonal
          key: sharedSecret
  physicalBlockSizeBytes: 4096
  size: 1
  type: pd-ssd
  location: us-west1-c
---
apiVersion: v1
kind: Secret
metadata:
  name: computedisk-dep-zonal
stringData:
  sharedSecret: "SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0="