Pod snapshot CRDs

GKE Pod snapshots are configured with two custom resource definitions (CRDs):

When snapshots are taken, the Pod state is represented by a PodSnapshot resource.

To learn more about Pod snapshots, see About Pod snapshots.

PodSnapshotStorageConfig specification

PodSnapshotStorageConfig defines where Pod snapshots are stored.

spec:
  snapshotStorageConfig:
    gcs:
      bucket: string
      path: string
Fields

spec.snapshotStorageConfig

required

object

Defines the configuration for the snapshot's underlying storage.

spec.snapshotStorageConfig.gcs

required

object

Contains the configuration for Cloud Storage setups.

spec.snapshotStorageConfig.gcs.bucket

required

string

Defines the bucket name to be used for storing Pod snapshots.

spec.snapshotStorageConfig.gcs.path

optional

string

Defines the path within the bucket to be used as a child directory for storing Pod snapshots.

PodSnapshotPolicy specification

PodSnapshotPolicy configures the Pod snapshot feature, such as the matching conditions to trigger checkpoints for selected workloads.

spec:
  selector:
    matchExpressions:
    - key: string
      operator: string
      values: []string
    matchLabels:
      additionalProperties: string
  storageConfigName: string
  triggerConfig:
    postCheckpoint: string
    type: string
Fields

spec.selector

required

object

Defines the set of Pods managed by this policy. The policy's checkpoint and restore settings will apply to all Pods that match the policy's label selector.

spec.selector.matchExpressions

optional

[]object

A list of label selector requirements. The requirements are combined by using an AND statement.

spec.selector.matchExpressions[].key

required

string

The label key that the selector applies to.

spec.selector.matchExpressions[].operator

required

string

Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, and DoesNotExist.

spec.selector.matchExpressions[].values

optional

[]string

An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.

spec.selector.matchLabels

optional

object

A map of key-value pairs. A single key-value pair in the map is equivalent to an element of matchExpressions, whose key field is "key", the operator is In, and the values array contains only "value". The requirements are combined by using an AND statement.

spec.storageConfigName

required

string

Name of the PodSnapshotStorageConfig this policy depends on.

spec.triggerConfig

required

object

Configuration for checkpoint triggers.

spec.triggerConfig.postCheckpoint

optional

string

Defines Pod behavior after a checkpoint is taken. stop: the Pod turns to completed status. resume: the workload resumes after being checkpointed. Default is resume.

spec.triggerConfig.type

required

string

Type of checkpoint trigger. workload: triggered by the workload container itself.

PodSnapshot specification

PodSnapshot represents a point-in-time snapshot of a Pod's state. It is governed by the PodSnapshotPolicy.

spec:
  policyName: string
  source: object
Fields

spec.policyName

required

string

The name of the PodSnapshotPolicy in the same namespace that governs the behavior of this snapshot. This field is immutable.

Status fields

status:
  conditions:
  - lastTransitionTime: string
    message: string
    observedGeneration: integer
    reason: string
    status: string
    type: string
  lastAccessTime: string
  observedCheckpointRetryCount: integer
  observedGeneration: integer
  storageStatus:
    gcs:
      observedGCSPath: string
Fields

status.conditions

[]object

Provide detailed observations of the resource's current state. The conditions are updated by the controller to reflect the progress and health of the snapshot process.

status.conditions[].lastTransitionTime

string

The last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then you can use the time when the API field changed.

status.conditions[].message

string

A human-readable message indicating details about the transition. This can be an empty string.

status.conditions[].observedGeneration

integer

Represents the .metadata.generation that the condition was set based upon. For example, if the value of the .metadata.generation field is 12, but the value of the .status.conditions[x].observedGeneration field is 9, the condition is out of date with respect to the current state of the instance.

status.conditions[].reason

string

Contains a programmatic identifier indicating the reason for the condition's last transition. The value should be a CamelCase string. This field cannot be empty.

status.conditions[].status

string

Status of the condition, one of True, False, or Unknown.

status.conditions[].type

string

Type of condition in CamelCase or in example.com/CamelCase.

status.lastAccessTime

optional

string

The last time the snapshot was used to restore a Pod. This field is updated by the system when a restore operation occurs and determines expiration for retention policies.

status.observedGeneration

optional

integer

Represents the .metadata.generation that the status was last updated for. This is used to reconcile changes made to the spec.

status.storageStatus

optional

object

Contains details about the underlying storage resources that have been provisioned for this snapshot.

status.storageStatus.gcs

optional

object

Provides status information about the Cloud Storage resources.

status.storageStatus.gcs.observedGCSPath

optional

string

The Cloud Storage bucket path where the snapshot is stored.