Class RestoreConfig (0.5.8)

RestoreConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Configuration of a restore.

This message has oneof_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes

NameDescription
volume_data_restore_policy google.cloud.gke_backup_v1.types.RestoreConfig.VolumeDataRestorePolicy
Optional. Specifies the mechanism to be used to restore volume data. Default: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (will be treated as NO_VOLUME_DATA_RESTORATION).
cluster_resource_conflict_policy google.cloud.gke_backup_v1.types.RestoreConfig.ClusterResourceConflictPolicy
Optional. Defines the behavior for handling the situation where cluster-scoped resources being restored already exist in the target cluster. This MUST be set to a value other than CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED if cluster_resource_restore_scope is not empty.
namespaced_resource_restore_mode google.cloud.gke_backup_v1.types.RestoreConfig.NamespacedResourceRestoreMode
Optional. Defines the behavior for handling the situation where sets of namespaced resources being restored already exist in the target cluster. This MUST be set to a value other than NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED.
cluster_resource_restore_scope google.cloud.gke_backup_v1.types.RestoreConfig.ClusterResourceRestoreScope
Optional. Identifies the cluster-scoped resources to restore from the Backup. Not specifying it means NO cluster resource will be restored.
all_namespaces bool
Restore all namespaced resources in the Backup if set to "True". Specifying this field to "False" is an error. This field is a member of oneof_ namespaced_resource_restore_scope.
selected_namespaces google.cloud.gke_backup_v1.types.Namespaces
A list of selected Namespaces to restore from the Backup. The listed Namespaces and all resources contained in them will be restored. This field is a member of oneof_ namespaced_resource_restore_scope.
selected_applications google.cloud.gke_backup_v1.types.NamespacedNames
A list of selected ProtectedApplications to restore. The listed ProtectedApplications and all the resources to which they refer will be restored. This field is a member of oneof_ namespaced_resource_restore_scope.
no_namespaces bool
Do not restore any namespaced resources if set to "True". Specifying this field to "False" is not allowed. This field is a member of oneof_ namespaced_resource_restore_scope.
excluded_namespaces google.cloud.gke_backup_v1.types.Namespaces
A list of selected namespaces excluded from restoration. All namespaces except those in this list will be restored. This field is a member of oneof_ namespaced_resource_restore_scope.
substitution_rules MutableSequence[google.cloud.gke_backup_v1.types.RestoreConfig.SubstitutionRule]
Optional. A list of transformation rules to be applied against Kubernetes resources as they are selected for restoration from a Backup. Rules are executed in order defined - this order matters, as changes made by a rule may impact the filtering logic of subsequent rules. An empty list means no substitution will occur.
transformation_rules MutableSequence[google.cloud.gke_backup_v1.types.RestoreConfig.TransformationRule]
Optional. A list of transformation rules to be applied against Kubernetes resources as they are selected for restoration from a Backup. Rules are executed in order defined - this order matters, as changes made by a rule may impact the filtering logic of subsequent rules. An empty list means no transformation will occur.

Classes

ClusterResourceConflictPolicy

ClusterResourceConflictPolicy(value)

Defines the behavior for handling the situation where cluster-scoped resources being restored already exist in the target cluster.

Values: CLUSTER_RESOURCE_CONFLICT_POLICY_UNSPECIFIED (0): Unspecified. Only allowed if no cluster-scoped resources will be restored. USE_EXISTING_VERSION (1): Do not attempt to restore the conflicting resource. USE_BACKUP_VERSION (2): Delete the existing version before re-creating it from the Backup. This is a dangerous option which could cause unintentional data loss if used inappropriately. For example, deleting a CRD will cause Kubernetes to delete all CRs of that type.

ClusterResourceRestoreScope

ClusterResourceRestoreScope(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Defines the scope of cluster-scoped resources to restore.

Some group kinds are not reasonable choices for a restore, and will cause an error if selected here. Any scope selection that would restore "all valid" resources automatically excludes these group kinds.

  • gkebackup.gke.io/BackupJob
  • gkebackup.gke.io/RestoreJob
  • metrics.k8s.io/NodeMetrics
  • migration.k8s.io/StorageState
  • migration.k8s.io/StorageVersionMigration
  • Node
  • snapshot.storage.k8s.io/VolumeSnapshotContent
  • storage.k8s.io/CSINode

Some group kinds are driven by restore configuration elsewhere, and will cause an error if selected here.

  • Namespace
  • PersistentVolume

GroupKind

GroupKind(mapping=None, *, ignore_unknown_fields=False, **kwargs)

This is a direct map to the Kubernetes GroupKind type GroupKind <https://godoc.org/k8s.io/apimachinery/pkg/runtime/schema#GroupKind>__ and is used for identifying specific "types" of resources to restore.

NamespacedResourceRestoreMode

NamespacedResourceRestoreMode(value)

Defines the behavior for handling the situation where sets of namespaced resources being restored already exist in the target cluster.

Values: NAMESPACED_RESOURCE_RESTORE_MODE_UNSPECIFIED (0): Unspecified (invalid). DELETE_AND_RESTORE (1): When conflicting top-level resources (either Namespaces or ProtectedApplications, depending upon the scope) are encountered, this will first trigger a delete of the conflicting resource AND ALL OF ITS REFERENCED RESOURCES (e.g., all resources in the Namespace or all resources referenced by the ProtectedApplication) before restoring the resources from the Backup. This mode should only be used when you are intending to revert some portion of a cluster to an earlier state. FAIL_ON_CONFLICT (2): If conflicting top-level resources (either Namespaces or ProtectedApplications, depending upon the scope) are encountered at the beginning of a restore process, the Restore will fail. If a conflict occurs during the restore process itself (e.g., because an out of band process creates conflicting resources), a conflict will be reported.

ResourceFilter

ResourceFilter(mapping=None, *, ignore_unknown_fields=False, **kwargs)

ResourceFilter specifies matching criteria to limit the scope of a change to a specific set of kubernetes resources that are selected for restoration from a backup.

SubstitutionRule

SubstitutionRule(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A transformation rule to be applied against Kubernetes resources as they are selected for restoration from a Backup. A rule contains both filtering logic (which resources are subject to substitution) and substitution logic.

TransformationRule

TransformationRule(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A transformation rule to be applied against Kubernetes resources as they are selected for restoration from a Backup. A rule contains both filtering logic (which resources are subject to transform) and transformation logic.

TransformationRuleAction

TransformationRuleAction(mapping=None, *, ignore_unknown_fields=False, **kwargs)

TransformationRuleAction defines a TransformationRule action based on the JSON Patch RFC (https://www.rfc-editor.org/rfc/rfc6902)

VolumeDataRestorePolicy

VolumeDataRestorePolicy(value)

Defines how volume data should be restored.

Values: VOLUME_DATA_RESTORE_POLICY_UNSPECIFIED (0): Unspecified (illegal). RESTORE_VOLUME_DATA_FROM_BACKUP (1): For each PVC to be restored, create a new underlying volume and PV from the corresponding VolumeBackup contained within the Backup. REUSE_VOLUME_HANDLE_FROM_BACKUP (2): For each PVC to be restored, attempt to reuse the original PV contained in the Backup (with its original underlying volume). This option is likely only usable when restoring a workload to its original cluster. NO_VOLUME_DATA_RESTORATION (3): For each PVC to be restored, create PVC without any particular action to restore data. In this case, the normal Kubernetes provisioning logic would kick in, and this would likely result in either dynamically provisioning blank PVs or binding to statically provisioned PVs.