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
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 | |
---|---|
Optional |
Immutable. A nested object resource. |
Required* |
Immutable. Primary disk for asynchronous disk replication. |
Optional |
Allowed value: The `selfLink` field of a `ComputeDisk` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
Immutable. An optional description of this resource. Provide this property when you create the resource. |
Optional |
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. |
Optional |
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 |
Optional |
Allowed value: The `selfLink` field of a `KMSCryptoKey` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used. |
Optional |
Allowed value: The `email` field of an `IAMServiceAccount` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
Immutable. Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. |
Optional |
Value of the field. Cannot be used if 'valueFrom' is specified. |
Optional |
Source for the field's value. Cannot be used if 'value' is specified. |
Optional |
Reference to a value with the given key in the given Secret in the resource's namespace. |
Required* |
Key that identifies the value to be extracted. |
Required* |
Name of the Secret to extract a value from. |
Optional |
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. |
Optional |
Value of the field. Cannot be used if 'valueFrom' is specified. |
Optional |
Source for the field's value. Cannot be used if 'value' is specified. |
Optional |
Reference to a value with the given key in the given Secret in the resource's namespace. |
Required* |
Key that identifies the value to be extracted. |
Required* |
Name of the Secret to extract a value from. |
Optional |
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. |
Optional |
Immutable. Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true. |
Optional |
Immutable. A list of features to enable on the guest operating system. Applicable only for bootable disks. |
Optional |
|
Required* |
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"]. |
Optional |
The image from which to initialize this disk. |
Optional |
Allowed value: The `selfLink` field of a `ComputeImage` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
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. |
Optional |
Immutable. Any applicable license URI. |
Optional |
|
Required |
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/) |
Optional |
Immutable. Indicates whether or not the disk can be read/write attached to more than one instance. |
Optional |
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. |
Optional |
The project that this resource belongs to. |
Optional |
Allowed value: The `name` field of a `Project` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
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. |
Optional |
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. |
Optional |
Immutable. URLs of the zones where the disk should be replicated to. |
Optional |
|
Optional |
Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default. |
Optional |
|
Optional |
Resource policies applied to this disk for automatic snapshot creations. This field only applies for zonal compute disk resources. |
Optional |
Allowed value: The `selfLink` field of a `ComputeResourcePolicy` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
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. |
Optional |
The source snapshot used to create this disk. |
Optional |
Allowed value: The `selfLink` field of a `ComputeSnapshot` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
The source disk used to create this disk. |
Optional |
Allowed value: The `selfLink` field of a `ComputeDisk` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
Immutable. The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. |
Optional |
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 |
Optional |
Allowed value: The `selfLink` field of a `KMSCryptoKey` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used. |
Optional |
Allowed value: The `email` field of an `IAMServiceAccount` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
Immutable. Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. |
Optional |
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. |
Optional |
Immutable. The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. |
Optional |
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 |
Optional |
Allowed value: The `selfLink` field of a `KMSCryptoKey` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used. |
Optional |
Allowed value: The `email` field of an `IAMServiceAccount` resource. |
Optional |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names |
Optional |
Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ |
Optional |
Immutable. Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. |
Optional |
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. |
Optional |
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 |
Conditions represent the latest available observation of the resource's current state. |
conditions[] |
|
conditions[].lastTransitionTime |
Last time the condition transitioned from one status to another. |
conditions[].message |
Human-readable message indicating details about last transition. |
conditions[].reason |
Unique, one-word, CamelCase reason for the condition's last transition. |
conditions[].status |
Status is the status of the condition. Can be True, False, Unknown. |
conditions[].type |
Type is the type of the condition. |
creationTimestamp |
Creation timestamp in RFC3339 text format. |
labelFingerprint |
The fingerprint used for optimistic locking of this resource. Used internally during updates. |
lastAttachTimestamp |
Last attach timestamp in RFC3339 text format. |
lastDetachTimestamp |
Last detach timestamp in RFC3339 text format. |
observedGeneration |
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 |
|
sourceDiskId |
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 |
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 |
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 |
Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance. |
users[] |
|
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="