Documentation
¶
Overview ¶
+k8s:deepcopy-gen=package,register +groupName=migration.kcp.io +k8s:openapi-gen=true +k8s:openapi-model-package=com.github.kcp-dev.sdk.apis.migration.v1alpha1
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type EtcdEntry
- type EtcdEntryDigest
- type LogicalClusterDigest
- type LogicalClusterDigestSpec
- type LogicalClusterDigestStatus
- type LogicalClusterDump
- type LogicalClusterDumpSpec
- type LogicalClusterDumpStatus
- type LogicalClusterMigration
- func (in *LogicalClusterMigration) DeepCopy() *LogicalClusterMigration
- func (in *LogicalClusterMigration) DeepCopyInto(out *LogicalClusterMigration)
- func (in *LogicalClusterMigration) DeepCopyObject() runtime.Object
- func (in *LogicalClusterMigration) GetConditions() conditionsv1alpha1.Conditions
- func (in LogicalClusterMigration) OpenAPIModelName() string
- func (in *LogicalClusterMigration) SetConditions(c conditionsv1alpha1.Conditions)
- type LogicalClusterMigrationList
- type LogicalClusterMigrationPhaseType
- type LogicalClusterMigrationSpec
- type LogicalClusterMigrationStatus
Constants ¶
const ( // LCMigrationOriginPreparing indicates the origin shard is preparing for migration. LCMigrationOriginPreparing conditionsv1alpha1.ConditionType = "OriginPreparing" // LCMigrationOriginReady indicates the origin shard has completed preparation // and the destination shard can start copying data. LCMigrationOriginReady conditionsv1alpha1.ConditionType = "OriginReady" // LCMigrationStarted indicates the destination shard has started copying data // from the origin. LCMigrationStarted conditionsv1alpha1.ConditionType = "MigrationStarted" // LCMigrationDataCopied indicates the destination shard has finished copying // all data from the origin shard. LCMigrationDataCopied conditionsv1alpha1.ConditionType = "DataCopied" // LCMigrationDataVerified indicates the destination shard has verified that // all copied data matches the origin shard. LCMigrationDataVerified conditionsv1alpha1.ConditionType = "DataVerified" // LCMigrationOriginCleaned indicates the origin shard has deleted all objects // belonging to the migration logical cluster. LCMigrationOriginCleaned conditionsv1alpha1.ConditionType = "OriginCleaned" // LCMigrationDestinationCleaned indicates the destination shard has cleaned up // all copied data during an abort. LCMigrationDestinationCleaned conditionsv1alpha1.ConditionType = "DestinationCleaned" // LCMigrationCompleted indicates the migration has fully completed and the // logical cluster is available on the destination shard. LCMigrationCompleted conditionsv1alpha1.ConditionType = "Completed" // LCMigrationAborted indicates the migration was aborted (e.g. due to // workspace deletion) and both shards have cleaned up their data. LCMigrationAborted conditionsv1alpha1.ConditionType = "Aborted" // LCMigrationCancelled indicates that cancellation restored the workspace on its origin. LCMigrationCancelled conditionsv1alpha1.ConditionType = "Cancelled" )
const DumpEncodingPlaintext = "Plaintext"
DumpEncodingPlaintext identifies serialized objects with storage encryption removed.
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: migration.GroupName, Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects.
Functions ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource.
Types ¶
type EtcdEntry ¶
type EtcdEntry struct {
// key is the etcd key with the origin shard's storage prefix stripped.
// The destination shard prepends its own storage prefix before writing.
Key string `json:"key"`
// value is the serialized object with storage encryption removed, encoded
// as base64 on the wire. It must be transformed before writing to etcd.
Value []byte `json:"value"`
// ttlSeconds is the remaining lease TTL on the origin shard, or zero for no lease.
// +optional
TTLSeconds int64 `json:"ttlSeconds,omitempty"`
}
EtcdEntry is a single etcd key/value pair from the origin shard.
func (*EtcdEntry) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdEntry.
func (*EtcdEntry) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (EtcdEntry) OpenAPIModelName ¶
OpenAPIModelName returns the OpenAPI model name for this type.
type EtcdEntryDigest ¶ added in v0.34.0
type EtcdEntryDigest struct {
// key is the etcd key with the shard's storage prefix stripped.
Key string `json:"key"`
// hash is the hex-encoded SHA-256 digest of the entry's plaintext value
// (with storage encryption removed).
Hash string `json:"hash"`
// ttlSeconds is the remaining lease TTL on the origin shard, or zero for no lease.
// +optional
TTLSeconds int64 `json:"ttlSeconds,omitempty"`
}
EtcdEntryDigest is a single etcd key and the SHA-256 digest of its plaintext value.
func (*EtcdEntryDigest) DeepCopy ¶ added in v0.34.0
func (in *EtcdEntryDigest) DeepCopy() *EtcdEntryDigest
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdEntryDigest.
func (*EtcdEntryDigest) DeepCopyInto ¶ added in v0.34.0
func (in *EtcdEntryDigest) DeepCopyInto(out *EtcdEntryDigest)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (EtcdEntryDigest) OpenAPIModelName ¶ added in v0.34.0
func (in EtcdEntryDigest) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.
type LogicalClusterDigest ¶ added in v0.34.0
type LogicalClusterDigest struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// +optional
Spec LogicalClusterDigestSpec `json:"spec,omitempty"`
// +optional
Status LogicalClusterDigestStatus `json:"status,omitempty"`
}
LogicalClusterDigest is an ephemeral request/response type used by the destination shard during a logical cluster migration to fetch key/hash digests of the migrating logical cluster from the origin shard after the data copy completes.
The server populates Status.Entries on Create. The object is not persisted.
+genclient +genclient:nonNamespaced +genclient:onlyVerbs=create +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*LogicalClusterDigest) DeepCopy ¶ added in v0.34.0
func (in *LogicalClusterDigest) DeepCopy() *LogicalClusterDigest
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalClusterDigest.
func (*LogicalClusterDigest) DeepCopyInto ¶ added in v0.34.0
func (in *LogicalClusterDigest) DeepCopyInto(out *LogicalClusterDigest)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*LogicalClusterDigest) DeepCopyObject ¶ added in v0.34.0
func (in *LogicalClusterDigest) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (LogicalClusterDigest) OpenAPIModelName ¶ added in v0.34.0
func (in LogicalClusterDigest) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.
type LogicalClusterDigestSpec ¶ added in v0.34.0
type LogicalClusterDigestSpec struct {
// continue is the token returned by a previous LogicalClusterDigest's
// status.continue. If set, the scan resumes at that key. If empty,
// the scan starts from the beginning of the logical cluster's etcd
// keyspace.
//
// +optional
Continue string `json:"continue,omitempty"`
// limit caps the number of digest entries returned in a single page.
// If zero, the server picks a default page size.
//
// +optional
Limit int64 `json:"limit,omitempty"`
}
LogicalClusterDigestSpec is the desired state for a digest request.
The logical cluster to inspect is taken from the request's cluster context (i.e. the URL the request arrived on).
func (*LogicalClusterDigestSpec) DeepCopy ¶ added in v0.34.0
func (in *LogicalClusterDigestSpec) DeepCopy() *LogicalClusterDigestSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalClusterDigestSpec.
func (*LogicalClusterDigestSpec) DeepCopyInto ¶ added in v0.34.0
func (in *LogicalClusterDigestSpec) DeepCopyInto(out *LogicalClusterDigestSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (LogicalClusterDigestSpec) OpenAPIModelName ¶ added in v0.34.0
func (in LogicalClusterDigestSpec) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.
type LogicalClusterDigestStatus ¶ added in v0.34.0
type LogicalClusterDigestStatus struct {
// entries is the page of etcd key digests belonging to the logical
// cluster, computed over the plaintext (unencrypted) values.
//
// +optional
Entries []EtcdEntryDigest `json:"entries,omitempty"`
// continue is set when there are more entries to fetch. Pass it as
// spec.continue on the next LogicalClusterDigest request to get the
// next page. Empty means this was the last page.
//
// +optional
Continue string `json:"continue,omitempty"`
}
LogicalClusterDigestStatus carries the digest payload populated by the server.
func (*LogicalClusterDigestStatus) DeepCopy ¶ added in v0.34.0
func (in *LogicalClusterDigestStatus) DeepCopy() *LogicalClusterDigestStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalClusterDigestStatus.
func (*LogicalClusterDigestStatus) DeepCopyInto ¶ added in v0.34.0
func (in *LogicalClusterDigestStatus) DeepCopyInto(out *LogicalClusterDigestStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (LogicalClusterDigestStatus) OpenAPIModelName ¶ added in v0.34.0
func (in LogicalClusterDigestStatus) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.
type LogicalClusterDump ¶
type LogicalClusterDump struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// +optional
Spec LogicalClusterDumpSpec `json:"spec,omitempty"`
// +optional
Status LogicalClusterDumpStatus `json:"status,omitempty"`
}
LogicalClusterDump is an ephemeral request/response type used by the destination shard during a logical cluster migration to fetch the serialized contents of the migrating logical cluster from the origin shard.
The server populates Status.Entries on Create. The object is not persisted.
+genclient +genclient:nonNamespaced +genclient:onlyVerbs=create +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*LogicalClusterDump) DeepCopy ¶
func (in *LogicalClusterDump) DeepCopy() *LogicalClusterDump
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalClusterDump.
func (*LogicalClusterDump) DeepCopyInto ¶
func (in *LogicalClusterDump) DeepCopyInto(out *LogicalClusterDump)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*LogicalClusterDump) DeepCopyObject ¶
func (in *LogicalClusterDump) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (LogicalClusterDump) OpenAPIModelName ¶
func (in LogicalClusterDump) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.
type LogicalClusterDumpSpec ¶
type LogicalClusterDumpSpec struct {
// encoding must be Plaintext. Explicit negotiation prevents older shards from
// interpreting decrypted data as raw encrypted storage values.
Encoding string `json:"encoding"`
// continue is the token returned by a previous LogicalClusterDump's
// status.continue. If set, the scan resumes right after the last key
// returned by that page. If empty, the scan starts from the
// beginning of the logical cluster's etcd keyspace.
//
// +optional
Continue string `json:"continue,omitempty"`
// limit caps the number of entries returned in a single page. If
// zero, the server picks a default page size.
//
// +optional
Limit int64 `json:"limit,omitempty"`
// maxBytes caps the total size, in bytes, of entry values returned in
// a single page. The scan stops and returns a continue token as soon
// as this budget is exceeded, even if limit hasn't been reached yet.
// If zero, the server picks a default byte budget.
//
// +optional
MaxBytes int64 `json:"maxBytes,omitempty"`
}
LogicalClusterDumpSpec is the desired state for a dump request.
The logical cluster to dump is taken from the request's cluster context (i.e. the URL the request arrived on).
func (*LogicalClusterDumpSpec) DeepCopy ¶
func (in *LogicalClusterDumpSpec) DeepCopy() *LogicalClusterDumpSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalClusterDumpSpec.
func (*LogicalClusterDumpSpec) DeepCopyInto ¶
func (in *LogicalClusterDumpSpec) DeepCopyInto(out *LogicalClusterDumpSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (LogicalClusterDumpSpec) OpenAPIModelName ¶
func (in LogicalClusterDumpSpec) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.
type LogicalClusterDumpStatus ¶
type LogicalClusterDumpStatus struct {
// encoding is Plaintext when storage encryption has been removed from values.
// Clients must verify this before writing entries using local transformers.
Encoding string `json:"encoding"`
// entries is the page of etcd key/value pairs belonging to the
// logical cluster, without storage encryption (proto for
// built-ins, JSON for CRs).
//
// +optional
Entries []EtcdEntry `json:"entries,omitempty"`
// continue is set when there are more entries to fetch. Pass it as
// spec.continue on the next LogicalClusterDump request to get the
// next page. Empty means this was the last page.
//
// +optional
Continue string `json:"continue,omitempty"`
}
LogicalClusterDumpStatus carries the dump payload populated by the server.
func (*LogicalClusterDumpStatus) DeepCopy ¶
func (in *LogicalClusterDumpStatus) DeepCopy() *LogicalClusterDumpStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalClusterDumpStatus.
func (*LogicalClusterDumpStatus) DeepCopyInto ¶
func (in *LogicalClusterDumpStatus) DeepCopyInto(out *LogicalClusterDumpStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (LogicalClusterDumpStatus) OpenAPIModelName ¶
func (in LogicalClusterDumpStatus) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.
type LogicalClusterMigration ¶
type LogicalClusterMigration struct {
v1.TypeMeta `json:",inline"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty"`
// +optional
Spec LogicalClusterMigrationSpec `json:"spec,omitempty"`
// +optional
Status LogicalClusterMigrationStatus `json:"status,omitempty"`
}
LogicalClusterMigration describes a migration of a logical cluster from one shard to another.
+crd +genclient +genclient:nonNamespaced +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,categories=kcp +kubebuilder:printcolumn:name="Logical Cluster",type=string,JSONPath=`.spec.logicalCluster`,description="The logical cluster being migrated" +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The current phase of the migration" +kubebuilder:printcolumn:name="Destination",type=string,JSONPath=`.spec.destinationShard`,description="The destination shard" +kubebuilder:printcolumn:name="Entries Copied",type=integer,JSONPath=`.status.entriesCopied`,description="Number of etcd entries copied so far"
func (*LogicalClusterMigration) DeepCopy ¶
func (in *LogicalClusterMigration) DeepCopy() *LogicalClusterMigration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalClusterMigration.
func (*LogicalClusterMigration) DeepCopyInto ¶
func (in *LogicalClusterMigration) DeepCopyInto(out *LogicalClusterMigration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*LogicalClusterMigration) DeepCopyObject ¶
func (in *LogicalClusterMigration) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*LogicalClusterMigration) GetConditions ¶
func (in *LogicalClusterMigration) GetConditions() conditionsv1alpha1.Conditions
func (LogicalClusterMigration) OpenAPIModelName ¶
func (in LogicalClusterMigration) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.
func (*LogicalClusterMigration) SetConditions ¶
func (in *LogicalClusterMigration) SetConditions(c conditionsv1alpha1.Conditions)
type LogicalClusterMigrationList ¶
type LogicalClusterMigrationList struct {
v1.TypeMeta `json:",inline"`
v1.ListMeta `json:"metadata"`
Items []LogicalClusterMigration `json:"items"`
}
LogicalClusterMigrationList is a list of LogicalClusterMigration resources.
+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
func (*LogicalClusterMigrationList) DeepCopy ¶
func (in *LogicalClusterMigrationList) DeepCopy() *LogicalClusterMigrationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalClusterMigrationList.
func (*LogicalClusterMigrationList) DeepCopyInto ¶
func (in *LogicalClusterMigrationList) DeepCopyInto(out *LogicalClusterMigrationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*LogicalClusterMigrationList) DeepCopyObject ¶
func (in *LogicalClusterMigrationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (LogicalClusterMigrationList) OpenAPIModelName ¶
func (in LogicalClusterMigrationList) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.
type LogicalClusterMigrationPhaseType ¶
type LogicalClusterMigrationPhaseType string
LogicalClusterMigrationPhaseType is the type of the current phase of the migration.
+kubebuilder:validation:Enum=Preparing;Migrating;Verifying;OriginCleanup;DestinationFinalize;Aborting;Completed;Failed;CancellationPreparing;Restoring;CancellationCleanup;CancellationFinalize;Cancelled
const ( LogicalClusterMigrationPhasePreparing LogicalClusterMigrationPhaseType = "Preparing" LogicalClusterMigrationPhaseMigrating LogicalClusterMigrationPhaseType = "Migrating" LogicalClusterMigrationPhaseVerifying LogicalClusterMigrationPhaseType = "Verifying" LogicalClusterMigrationPhaseOriginCleanup LogicalClusterMigrationPhaseType = "OriginCleanup" LogicalClusterMigrationPhaseDestinationFinalize LogicalClusterMigrationPhaseType = "DestinationFinalize" LogicalClusterMigrationPhaseAborting LogicalClusterMigrationPhaseType = "Aborting" LogicalClusterMigrationPhaseCompleted LogicalClusterMigrationPhaseType = "Completed" LogicalClusterMigrationPhaseFailed LogicalClusterMigrationPhaseType = "Failed" LogicalClusterMigrationPhaseCancellationPreparing LogicalClusterMigrationPhaseType = "CancellationPreparing" LogicalClusterMigrationPhaseRestoring LogicalClusterMigrationPhaseType = "Restoring" LogicalClusterMigrationPhaseCancellationCleanup LogicalClusterMigrationPhaseType = "CancellationCleanup" LogicalClusterMigrationPhaseCancellationFinalize LogicalClusterMigrationPhaseType = "CancellationFinalize" LogicalClusterMigrationPhaseCancelled LogicalClusterMigrationPhaseType = "Cancelled" )
type LogicalClusterMigrationSpec ¶
type LogicalClusterMigrationSpec struct {
// logicalCluster is the name of the logical cluster to migrate.
//
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
LogicalCluster string `json:"logicalCluster"`
// destinationShard is the name of the shard to migrate the logical cluster to.
//
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
DestinationShard string `json:"destinationShard"`
}
LogicalClusterMigrationSpec holds the desired state of the migration.
func (*LogicalClusterMigrationSpec) DeepCopy ¶
func (in *LogicalClusterMigrationSpec) DeepCopy() *LogicalClusterMigrationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalClusterMigrationSpec.
func (*LogicalClusterMigrationSpec) DeepCopyInto ¶
func (in *LogicalClusterMigrationSpec) DeepCopyInto(out *LogicalClusterMigrationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (LogicalClusterMigrationSpec) OpenAPIModelName ¶
func (in LogicalClusterMigrationSpec) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.
type LogicalClusterMigrationStatus ¶
type LogicalClusterMigrationStatus struct {
// phase is the current phase of the migration.
//
// +optional
// +kubebuilder:default=Preparing
Phase LogicalClusterMigrationPhaseType `json:"phase,omitempty"`
// originShard is the name of the shard to migrate the logical cluster from.
// Set by the origin shard controller during preparation.
//
// +optional
OriginShard string `json:"originShard,omitempty"`
// entriesCopied is the number of etcd entries copied from the origin
// shard to the destination shard so far during the Migrating phase.
//
// +optional
EntriesCopied int64 `json:"entriesCopied,omitempty"`
// dumpContinue is the continue token for the next LogicalClusterDump
// page to fetch from the origin shard. Set by the destination shard
// controller as it works through the data copy, and cleared once the
// copy is complete. Used to resume the copy from where it left off
// after a destination shard restart, instead of starting over.
//
// +optional
DumpContinue string `json:"dumpContinue,omitempty"`
// Current processing state of the migration.
// +optional
Conditions conditionsv1alpha1.Conditions `json:"conditions,omitempty"`
}
LogicalClusterMigrationStatus communicates the observed state of the migration.
func (*LogicalClusterMigrationStatus) DeepCopy ¶
func (in *LogicalClusterMigrationStatus) DeepCopy() *LogicalClusterMigrationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogicalClusterMigrationStatus.
func (*LogicalClusterMigrationStatus) DeepCopyInto ¶
func (in *LogicalClusterMigrationStatus) DeepCopyInto(out *LogicalClusterMigrationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (LogicalClusterMigrationStatus) OpenAPIModelName ¶
func (in LogicalClusterMigrationStatus) OpenAPIModelName() string
OpenAPIModelName returns the OpenAPI model name for this type.