v1alpha1

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const CustomizerAnnotationKey string = "edge.kcp.io/customizer"

CustomizerAnnotationKey is the key of an annotation that identifies the Customizer that applies to the annotated object as it propagates from center to edge. When the annotated object is namespaced, the Customizer object to apply is in the same namespace and the value of this annotation is the name of the Customizer object; otherwise the value of this annotation uses the form "namespace/name" to reference the desired Customizer.

View Source
const ParameterExpansionAnnotationKey string = "edge.kcp.io/expand-parameters"
View Source
const SourcePlacementLabelKey string = "edge.kcp.io/source-placement"

SourcePlacementLabelKey is the key of the label used in a SinglePlacementSlice to reference the EdgePlacement that it is part of the response to. We use a label rather than a field because field selectors do not work on a resource defined by a CRD.

Variables

This section is empty.

Functions

This section is empty.

Types

type Customizer

type Customizer struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Replacements []Replacement `patchStrategy:"merge" patchMergeKey:"path" json:"replacements,omitempty"`
}

Customizer defines modifications to make to the relevant objects as they propagate from center to edge.

The relevant objects are those with an annotation whose key is "edge.kcp.io/customizer" and whose value refers to this object as explained above.

If this object is marked as being subject to parameter expansion then the parameter-expanded version of this object is what gets applied to a relevant object as it propagates to a destination.

type CustomizerList

type CustomizerList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Customizer `json:"items"`
}

CustomizerList is the API type for a list of Customizer

type EdgePlacement

type EdgePlacement struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// `spec` describes a desired binding between workload and Locations.
	// Unlike a TMC Placement, there is an inherent multiplicity and dynamicity
	// in the set of Locations that will be synced to and this field
	// never shifts into immutability.
	Spec EdgePlacementSpec `json:"spec,omitempty"`

	// `status` describes the status of the process of binding
	// workload to Locations.
	Status EdgePlacementStatus `json:"status,omitempty"`
}

EdgePlacement exists in the center and binds (a) a collection of Locations with (b) both (b1) objects in the center to downsync (propagate desired state from center to edge and return reported state from edge toward center), and (b2) a way of identifying objects (in edge clusters) to upsync (propagate from edge toward center). Both downsyncing and upsyncing are with all of the Locations. This is not entirely unrelated to a TMC Placement, which directs the selected Namespaces to propagate to _one_ of the selected Locations.

The objects to downsync are those in selected namespaces plus selected non-namespaced objects.

For upsync, the matching objects originate in the edge clusters and propagate to the corresponding mailbox workspaces while summaries of them go to the workload management workspace (as prescribed by the summarization API).

Overlap between EdgePlacements is allowed: two different EdgePlacement objects may select intersecting Location sets and/or intersecting Namespace sets. This is not problematic because:

  • propagation _into_ a destination is additive;
  • propagation _from_ a source is additive;
  • two directives to propagate the same object to the same destination are simply redundant (they, by design, can not conflict).

type EdgePlacementList

type EdgePlacementList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []EdgePlacement `json:"items"`
}

EdgePlacementList is the API type for a list of EdgePlacement

type EdgePlacementSpec

type EdgePlacementSpec struct {
	// `locationSelectors` identifies the relevant Location objects in terms of their labels.
	// A Location is relevant if and only if it passes any of the LabelSelectors in this field.
	LocationSelectors []metav1.LabelSelector `json:"locationSelectors,omitempty"`

	// `namespaceSelector` identifies the relevant Namespace objects in terms of their labels.
	NamespaceSelector metav1.LabelSelector `json:"namespaceSelector,omitempty"`

	// `nonNamespacedObjects` defines the non-namespaced objects to bind with the selected Locations.
	NonNamespacedObjects []NonNamespacedObjectReferenceSet `json:"nonNamespacedObjects,omitempty"`

	// `upsync` identifies objects to upsync.
	// An object matches `upsync` if and only if it matches at least one member of `upsync`.
	Upsync []UpsyncSet `json:"upsync,omitempty"`
}

EdgePlacementSpec holds a desired binding between (a) a set of Locations and (b) a set of objects to downsync and a way of identifying objects to upsync.

type EdgePlacementStatus

type EdgePlacementStatus struct {
	// `specGeneration` identifies the generation of the spec that this
	// is the status for.
	// Zero means that no status has yet been written here.
	SpecGeneration int32 `json:"specGeneration,omitempty"`

	// `matchingLocationCount` is the number of Locations that satisfy the spec's
	// `locationSelectors`.
	MatchingLocationCount int32 `json:"matchingLocationCount"`
}

type NonNamespacedObjectReferenceSet

type NonNamespacedObjectReferenceSet struct {
	// `apiGroup` is the API group of the referenced object, empty string for the core API group.
	APIGroup string `json:"apiGroup,omitempty"`

	// `resources` is a list of lowercase plural names for the sorts of objects to match.
	// An entry of `"*"` means that all match.
	// Empty list means nothing matches.
	Resources []string `json:"resources"`

	// `resourceNames` is a list of objects that match by name.
	// An entry of `"*"` means that all match.
	// Empty list means nothing matches.
	ResourceNames []string `json:"resourceNames,omitempty"`

	// `labelSelectors` allows matching objects by a rule rather than listing individuals.
	LabelSelectors []metav1.LabelSelector `json:"labelSelectors,omitempty"`
}

NonNamespacedObjectReferenceSet specifies a set of non-namespaced objects from one particular API group. An object is in this set if: - its API group is the one listed; - its resource (lowercase plural form of object type) is one of those listed; and - EITHER its name is listed OR its labels match one of the label selectors.

type Replacement

type Replacement struct {
	// `path` is a JSON Path identifying the part of the object to replace/inject.
	Path string `json:"path"`

	// `value` supplies the new value to put where the path points, in JSON.
	Value string `json:"value"`
}

Replacement represents one modification to an object. Such a replacement is conceptually done on the JSON representation of that object.

type SinglePlacement

type SinglePlacement struct {
	// Cluster is the logicacluster.Name of the logical cluster that contains
	// both the Location and the SyncTarget.
	Cluster string `json:"cluster"`

	LocationName string `json:"locationName"`

	// `syncTargetName` identifies the relevant SyncTarget at the Location
	SyncTargetName string `json:"syncTargetName"`

	SyncTargetUID apimachtypes.UID `json:"syncTargetUID"`
}

SinglePlacement describes one Location that matches the relevant EdgePlacement.

type SinglePlacementSlice

type SinglePlacementSlice struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// `destinations` holds some of the results of scheduling.
	Destinations []SinglePlacement `json:"destinations"`
}

SinglePlacementSlice is the interface between "scheduling" and syncing. For a given EdgePlacement object, the scheduler figures out which Locations match that EdgePlacement and selects the SyncTarget to use within that Location, then puts these results into some SinglePlacementSlice API objects. We use potentially multiple API objects so that no one of them has to get very big.

type SinglePlacementSliceList

type SinglePlacementSliceList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []SinglePlacementSlice `json:"items"`
}

SinglePlacementSliceList is the API type for a list of SinglePlacementSlice

type UpsyncSet

type UpsyncSet struct {
	// `apiGroup` is the API group of the referenced object, empty string for the core API group.
	APIGroup string `json:"apiGroup,omitempty"`

	// `resources` is a list of lowercase plural names for the sorts of objects to match.
	// An entry of `"*"` means that all match.
	// Empty list means nothing matches.
	Resources []string `json:"resources"`

	// `namespaces` is a list of acceptable namespaces.
	// An entry of `"*"` means that all match.
	// Empty list means nothing matches (you probably do not want this
	// for namespaced resources).
	Namespaces []string `json:"namespaces,omitempty"`

	// `Names` is a list of objects that match by name.
	// An entry of `"*"` means that all match.
	// Empty list means nothing matches (you probably never want an empty list).
	Names []string `json:"names,omitempty"`
}

UpsyncSet specifies a set of objects, which may be namespaced or cluster-scoped, from one particular API group. An object is in this set if: - its API group is the one listed; - its resource (lowercase plural form of object type) is one of those listed; - EITHER the resource is cluster-scoped OR the object's namespace matches `namespaces`; and - the object's name matches `names`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL