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 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 // and verifying all data. LCMigrationDataCopied conditionsv1alpha1.ConditionType = "DataCopied" // 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" )
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 raw etcd value bytes. JSON-encoded as base64 on the wire.
Value []byte `json:"value"`
}
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 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 raw etcd contents of the migration 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 {
// 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 {
// entries is the page of etcd key/value pairs belonging to the
// logical cluster, in the origin shard's etcd encoding (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;OriginCleanup;DestinationFinalize;Aborting;Completed;Failed
const ( LogicalClusterMigrationPhasePreparing LogicalClusterMigrationPhaseType = "Preparing" LogicalClusterMigrationPhaseMigrating LogicalClusterMigrationPhaseType = "Migrating" LogicalClusterMigrationPhaseOriginCleanup LogicalClusterMigrationPhaseType = "OriginCleanup" LogicalClusterMigrationPhaseDestinationFinalize LogicalClusterMigrationPhaseType = "DestinationFinalize" LogicalClusterMigrationPhaseAborting LogicalClusterMigrationPhaseType = "Aborting" LogicalClusterMigrationPhaseCompleted LogicalClusterMigrationPhaseType = "Completed" LogicalClusterMigrationPhaseFailed LogicalClusterMigrationPhaseType = "Failed" )
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.