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 No

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/project-id

Spec

Schema

  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
    sha256: string
  imageRef:
    external: string
    name: string
    namespace: string
  location: string
  physicalBlockSizeBytes: integer
  replicaZones:
  - string
  resourcePolicies:
  - external: string
    name: string
    namespace: string
  size: integer
  snapshotRef:
    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

description

Optional

string

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

diskEncryptionKey

Optional

object

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

The selfLink of a KMSCryptoKey.

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

The email of an IAMServiceAccount.

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

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.sha256

Optional

string

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

imageRef

Optional

object

The image from which to initialize this disk.

imageRef.external

Optional

string

The selfLink of a ComputeImage.

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/

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/)

physicalBlockSizeBytes

Optional

integer

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.

replicaZones

Optional

list (string)

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

replicaZones.[]

Optional

string

resourcePolicies

Optional

list (object)

resourcePolicies.[]

Optional

object

Resource policies applied to this disk for automatic snapshot creations.

resourcePolicies.[].external

Optional

string

The selfLink of a ComputeResourcePolicy.

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.

snapshotRef

Optional

object

The source snapshot used to create this disk.

snapshotRef.external

Optional

string

The selfLink of a ComputeSnapshot.

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/

sourceImageEncryptionKey

Optional

object

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

The selfLink of a KMSCryptoKey.

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

The email of an IAMServiceAccount.

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

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

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

The selfLink of a KMSCryptoKey.

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

The email of an IAMServiceAccount.

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

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

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
  selfLink: string
  sourceImageId: string
  sourceSnapshotId: string
  users:
  - string
Fields
conditions

list (object)

Conditions represents 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.

selfLink

string

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)

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:
    name: computedisk-dep-regional
  spec:
    location: us-west1-c
  ---
  apiVersion: compute.cnrm.cloud.google.com/v1beta1
  kind: ComputeDisk
  metadata:
    name: computedisk-sample-regional
    labels:
      extra-gb: "100"
  spec:
    description: A 600GB regional disk from a 500GB snapshot.
    location: us-central1
    replicaZones:
      - "us-central1-a"
      - "us-central1-f"
    size: 600
    physicalBlockSizeBytes: 16384
    snapshotRef:
      name: computedisk-dep-regional
  ---
  apiVersion: compute.cnrm.cloud.google.com/v1beta1
  kind: ComputeSnapshot
  metadata:
    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="