WorkstationConfig
Property | Value |
---|---|
Google Cloud Service Name | Cloud Workstations |
Google Cloud Service Documentation | /workstations/docs/ |
Google Cloud REST Resource Name | v1.projects.locations.workstationClusters.workstationConfigs |
Google Cloud REST Resource Documentation | /workstations/docs/reference/rest/v1/projects.locations.workstationClusters.workstationConfigs |
Config Connector Resource Short Names | gcpworkstationconfig gcpworkstationconfigs workstationconfig |
Config Connector Service Name | workstations.googleapis.com |
Config Connector Resource Fully Qualified Name | workstationconfigs.workstations.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
annotations:
- key: string
value: string
container:
args:
- string
command:
- string
env:
- name: string
value: string
image: string
runAsUser: integer
workingDir: string
displayName: string
encryptionKey:
kmsCryptoKeyRef:
external: string
name: string
namespace: string
serviceAccountRef:
external: string
name: string
namespace: string
host:
gceInstance:
bootDiskSizeGB: integer
confidentialInstanceConfig:
enableConfidentialCompute: boolean
disablePublicIPAddresses: boolean
enableNestedVirtualization: boolean
machineType: string
poolSize: integer
serviceAccountRef:
external: string
name: string
namespace: string
serviceAccountScopes:
- string
shieldedInstanceConfig:
enableIntegrityMonitoring: boolean
enableSecureBoot: boolean
enableVTPM: boolean
tags:
- string
idleTimeout: string
labels:
- key: string
value: string
parentRef:
external: string
name: string
namespace: string
persistentDirectories:
- gcePD:
diskType: string
fsType: string
reclaimPolicy: string
sizeGB: integer
sourceSnapshot: string
mountPath: string
readinessChecks:
- path: string
port: integer
replicaZones:
- string
resourceID: string
runningTimeout: string
Fields | |
---|---|
Optional |
Optional. Client-specified annotations. |
Optional |
|
Optional |
Key for the annotation. |
Optional |
Value for the annotation. |
Optional |
Optional. Container that runs upon startup for each workstation using this workstation configuration. |
Optional |
Optional. Arguments passed to the entrypoint. |
Optional |
|
Optional |
Optional. If set, overrides the default ENTRYPOINT specified by the image. |
Optional |
|
Optional |
Optional. Environment variables passed to the container's entrypoint. |
Optional |
|
Optional |
Name is the name of the environment variable. |
Optional |
Value is the value of the environment variable. |
Optional |
Optional. A Docker container image that defines a custom environment. Cloud Workstations provides a number of [preconfigured images](https://cloud.google.com/workstations/docs/preconfigured-base-images), but you can create your own [custom container images](https://cloud.google.com/workstations/docs/custom-container-images). If using a private image, the `host.gceInstance.serviceAccount` field must be specified in the workstation configuration and must have permission to pull the specified image. Otherwise, the image must be publicly accessible. |
Optional |
Optional. If set, overrides the USER specified in the image with the given uid. |
Optional |
Optional. If set, overrides the default DIR specified by the image. |
Optional |
Optional. Human-readable name for this workstation configuration. |
Optional |
Immutable. Encrypts resources of this workstation configuration using a customer-managed encryption key (CMEK). If specified, the boot disk of the Compute Engine instance and the persistent disk are encrypted using this encryption key. If this field is not set, the disks are encrypted using a generated key. Customer-managed encryption keys do not protect disk metadata. If the customer-managed encryption key is rotated, when the workstation instance is stopped, the system attempts to recreate the persistent disk with the new version of the key. Be sure to keep older versions of the key until the persistent disk is recreated. Otherwise, data on the persistent disk might be lost. If the encryption key is revoked, the workstation session automatically stops within 7 hours. Immutable after the workstation configuration is created. |
Optional |
Immutable. A reference to the Google Cloud KMS encryption key. For example, `"projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"`. The key must be in the same region as the workstation configuration. |
Optional |
A reference to an externally managed KMSCryptoKey. Should be in the format `projects/[kms_project_id]/locations/[region]/keyRings/[key_ring_id]/cryptoKeys/[key]`. |
Optional |
The `name` of a `KMSCryptoKey` resource. |
Optional |
The `namespace` of a `KMSCryptoKey` resource. |
Optional |
Immutable. A reference to a service account to use with the specified KMS key. We recommend that you use a separate service account and follow KMS best practices. For more information, see [Separation of duties](https://cloud.google.com/kms/docs/separation-of-duties) and `gcloud kms keys add-iam-policy-binding` [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member). |
Optional |
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 |
Optional. Runtime host for the workstation. |
Optional |
Specifies a Compute Engine instance as the host. |
Optional |
Optional. The size of the boot disk for the VM in gigabytes (GB). The minimum boot disk size is `30` GB. Defaults to `50` GB. |
Optional |
Optional. A set of Compute Engine Confidential VM instance options. |
Optional |
Optional. Whether the instance has confidential compute enabled. |
Optional |
Optional. When set to true, disables public IP addresses for VMs. If you disable public IP addresses, you must set up Private Google Access or Cloud NAT on your network. If you use Private Google Access and you use `private.googleapis.com` or `restricted.googleapis.com` for Container Registry and Artifact Registry, make sure that you set up DNS records for domains `*.gcr.io` and `*.pkg.dev`. Defaults to false (VMs have public IP addresses). |
Optional |
Optional. Whether to enable nested virtualization on Cloud Workstations VMs created under this workstation configuration. Nested virtualization lets you run virtual machine (VM) instances inside your workstation. Before enabling nested virtualization, consider the following important considerations. Cloud Workstations instances are subject to the [same restrictions as Compute Engine instances](https://cloud.google.com/compute/docs/instances/nested-virtualization/overview#restrictions): * **Organization policy**: projects, folders, or organizations may be restricted from creating nested VMs if the **Disable VM nested virtualization** constraint is enforced in the organization policy. For more information, see the Compute Engine section, [Checking whether nested virtualization is allowed](https://cloud.google.com/compute/docs/instances/nested-virtualization/managing-constraint#checking_whether_nested_virtualization_is_allowed). * **Performance**: nested VMs might experience a 10% or greater decrease in performance for workloads that are CPU-bound and possibly greater than a 10% decrease for workloads that are input/output bound. * **Machine Type**: nested virtualization can only be enabled on workstation configurations that specify a [machine_type][google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.machine_type] in the N1 or N2 machine series. * **GPUs**: nested virtualization may not be enabled on workstation configurations with accelerators. * **Operating System**: Because [Container-Optimized OS](https://cloud.google.com/compute/docs/images/os-details#container-optimized_os_cos) does not support nested virtualization, when nested virtualization is enabled, the underlying Compute Engine VM instances boot from an [Ubuntu LTS](https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts) image. |
Optional |
Optional. The type of machine to use for VM instances—for example, `"e2-standard-4"`. For more information about machine types that Cloud Workstations supports, see the list of [available machine types](https://cloud.google.com/workstations/docs/available-machine-types). |
Optional |
Optional. The number of VMs that the system should keep idle so that new workstations can be started quickly for new users. Defaults to `0` in the API. |
Optional |
Optional. A reference to the service account for Cloud Workstations VMs created with this configuration. When specified, be sure that the service account has `logginglogEntries.create` permission on the project so it can write logs out to Cloud Logging. If using a custom container image, the service account must have permissions to pull the specified image. If you as the administrator want to be able to `ssh` into the underlying VM, you need to set this value to a service account for which you have the `iam.serviceAccounts.actAs` permission. Conversely, if you don't want anyone to be able to `ssh` into the underlying VM, use a service account where no one has that permission. If not set, VMs run with a service account provided by the Cloud Workstations service, and the image must be publicly accessible. |
Optional |
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 |
Optional. Scopes to grant to the [service_account][google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.service_account]. Various scopes are automatically added based on feature usage. When specified, users of workstations under this configuration must have `iam.serviceAccounts.actAs` on the service account. |
Optional |
|
Optional |
Optional. A set of Compute Engine Shielded instance options. |
Optional |
Optional. Whether the instance has integrity monitoring enabled. |
Optional |
Optional. Whether the instance has Secure Boot enabled. |
Optional |
Optional. Whether the instance has the vTPM enabled. |
Optional |
Optional. Network tags to add to the Compute Engine VMs backing the workstations. This option applies [network tags](https://cloud.google.com/vpc/docs/add-remove-network-tags) to VMs created with this configuration. These network tags enable the creation of [firewall rules](https://cloud.google.com/workstations/docs/configure-firewall-rules). |
Optional |
|
Optional |
Optional. Number of seconds to wait before automatically stopping a workstation after it last received user traffic. A value of `"0s"` indicates that Cloud Workstations VMs created with this configuration should never time out due to idleness. Provide [duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration) terminated by `s` for seconds—for example, `"7200s"` (2 hours). The default is `"1200s"` (20 minutes). |
Optional |
Optional. [Labels](https://cloud.google.com/workstations/docs/label-resources) that are applied to the workstation configuration and that are also propagated to the underlying Compute Engine resources. |
Optional |
|
Optional |
Key for the label. |
Optional |
Value for the label. |
Required* |
Parent is a reference to the parent WorkstationCluster for this WorkstationConfig. |
Optional |
A reference to an externally managed WorkstationCluster resource. Should be in the format "projects/{{projectID}}/locations/{{location}}/workstationClusters/{{workstationclusterID}}". |
Optional |
The name of a WorkstationCluster resource. |
Optional |
The namespace of a WorkstationCluster resource. |
Optional |
Optional. Directories to persist across workstation sessions. |
Optional |
|
Optional |
A PersistentDirectory backed by a Compute Engine persistent disk. |
Optional |
Optional. The [type of the persistent disk](https://cloud.google.com/compute/docs/disks#disk-types) for the home directory. Defaults to `"pd-standard"`. |
Optional |
Optional. Type of file system that the disk should be formatted with. The workstation image must support this file system type. Must be empty if [source_snapshot][google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.source_snapshot] is set. Defaults to `"ext4"`. |
Optional |
Optional. Whether the persistent disk should be deleted when the workstation is deleted. Valid values are `DELETE` and `RETAIN`. Defaults to `DELETE`. |
Optional |
Optional. The GB capacity of a persistent home directory for each workstation created with this configuration. Must be empty if [source_snapshot][google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.source_snapshot] is set. Valid values are `10`, `50`, `100`, `200`, `500`, or `1000`. Defaults to `200`. If less than `200` GB, the [disk_type][google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.disk_type] must be `"pd-balanced"` or `"pd-ssd"`. |
Optional |
Optional. Name of the snapshot to use as the source for the disk. If set, [size_gb][google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.size_gb] and [fs_type][google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.fs_type] must be empty. |
Optional |
Optional. Location of this directory in the running workstation. |
Optional |
Optional. Readiness checks to perform when starting a workstation using this workstation configuration. Mark a workstation as running only after all specified readiness checks return 200 status codes. |
Optional |
|
Optional |
Optional. Path to which the request should be sent. |
Optional |
Optional. Port to which the request should be sent. |
Optional |
Optional. Immutable. Specifies the zones used to replicate the VM and disk resources within the region. If set, exactly two zones within the workstation cluster's region must be specified—for example, `['us-central1-a', 'us-central1-f']`. If this field is empty, two default zones within the region are used. Immutable after the workstation configuration is created. |
Optional |
|
Optional |
Immutable. The WorkstationConfig name. If not given, the metadata.name will be used. |
Optional |
Optional. Number of seconds that a workstation can run until it is automatically shut down. We recommend that workstations be shut down daily to reduce costs and so that security updates can be applied upon restart. The [idle_timeout][google.cloud.workstations.v1.WorkstationConfig.idle_timeout] and [running_timeout][google.cloud.workstations.v1.WorkstationConfig.running_timeout] fields are independent of each other. Note that the [running_timeout][google.cloud.workstations.v1.WorkstationConfig.running_timeout] field shuts down VMs after the specified time, regardless of whether or not the VMs are idle. Provide duration terminated by `s` for seconds—for example, `"54000s"` (15 hours). Defaults to `"43200s"` (12 hours). A value of `"0s"` indicates that workstations using this configuration should never time out. If [encryption_key][google.cloud.workstations.v1.WorkstationConfig.encryption_key] is set, it must be greater than `"0s"` and less than `"86400s"` (24 hours). Warning: A value of `"0s"` indicates that Cloud Workstations VMs created with this configuration have no maximum running time. This is strongly discouraged because you incur costs and will not pick up security updates. |
* Field is required when parent field is specified
Status
Schema
conditions:
- lastTransitionTime: string
message: string
reason: string
status: string
type: string
externalRef: string
observedGeneration: integer
observedState:
createTime: string
degraded: boolean
deleteTime: string
etag: string
gcpConditions:
- code: integer
message: string
host:
gceInstance:
pooledInstances: integer
uid: string
updateTime: string
Fields | |
---|---|
conditions |
Conditions represent the latest available observations of the object'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. |
externalRef |
A unique specifier for the WorkstationConfig resource in GCP. |
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. |
observedState |
ObservedState is the state of the resource as most recently observed in GCP. |
observedState.createTime |
Output only. Time when this workstation configuration was created. |
observedState.degraded |
Output only. Whether this resource is degraded, in which case it may require user action to restore full functionality. See also the [conditions][google.cloud.workstations.v1.WorkstationConfig.conditions] field. |
observedState.deleteTime |
Output only. Time when this workstation configuration was soft-deleted. |
observedState.etag |
Output only. Checksum computed by the server. May be sent on update and delete requests to make sure that the client has an up-to-date value before proceeding. |
observedState.gcpConditions |
Output only. Status conditions describing the current resource state. |
observedState.gcpConditions[] |
|
observedState.gcpConditions[].code |
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. |
observedState.gcpConditions[].message |
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. |
observedState.host |
Output only. Observed state of the runtime host for the workstation configuration. |
observedState.host.gceInstance |
Output only. Observed state of the Compute Engine runtime host for the workstation configuration. |
observedState.host.gceInstance.pooledInstances |
Output only. Number of instances currently available in the pool for faster workstation startup. |
observedState.uid |
Output only. A system-assigned unique identifier for this workstation configuration. |
observedState.updateTime |
Output only. Time when this workstation configuration was most recently updated. |
Sample YAML(s)
Basic WorkstationConfig
# Copyright 2024 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: workstations.cnrm.cloud.google.com/v1beta1
kind: WorkstationConfig
metadata:
name: workstationconfig-sample
spec:
parentRef:
name: workstationcluster-dep
idleTimeout: "1200s"
runningTimeout: "43200s"
host:
gceInstance:
machineType: "e2-standard-4"
serviceAccountRef:
external: "service-${PROJECT_NUMBER1}@gcp-sa-workstationsvm.iam.gserviceaccount.com"
bootDiskSizeGB: 50
container:
image: "us-west1-docker.pkg.dev/cloud-workstations-images/predefined/code-oss:latest"
replicaZones:
- us-west1-a
- us-west1-b
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeNetwork
metadata:
name: computenetwork-dep
spec:
routingMode: GLOBAL
autoCreateSubnetworks: false
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeSubnetwork
metadata:
name: computesubnetwork-dep
spec:
ipCidrRange: 10.0.0.0/24
region: us-west1
networkRef:
name: computenetwork-dep
---
apiVersion: workstations.cnrm.cloud.google.com/v1beta1
kind: WorkstationCluster
metadata:
name: workstationcluster-dep
spec:
projectRef:
external: "projects/${PROJECT_NUMBER1}"
location: us-west1
networkRef:
name: computenetwork-dep
subnetworkRef:
name: computesubnetwork-dep