Documentation ¶
Overview ¶
The Input Reconciler calls a simple func() error whenever a storage event is received for any of: * Meshes * ConfigMaps * Services * Pods * Nodes * Deployments * ReplicaSets * DaemonSets * StatefulSets for a given cluster or set of clusters.
Input Reconcilers can be be constructed from either a single Manager (watch events in a single cluster) or a ClusterWatcher (watch events in multiple clusters).
Utility for manually building input snapshots. Used primarily in tests.
Index ¶
- func RegisterMultiClusterReconciler(ctx context.Context, clusters multicluster.ClusterWatcher, ...) input.MultiClusterReconciler
- func RegisterSingleClusterReconciler(ctx context.Context, mgr manager.Manager, ...) (input.SingleClusterReconciler, error)
- type BuildOptions
- type Builder
- type InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddConfigMaps(configMaps []*v1.ConfigMap) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddDaemonSets(daemonSets []*apps_v1.DaemonSet) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddDeployments(deployments []*apps_v1.Deployment) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddMeshes(meshes []*appmesh_k8s_aws_v1beta2.Mesh) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddNodes(nodes []*v1.Node) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddPods(pods []*v1.Pod) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddReplicaSets(replicaSets []*apps_v1.ReplicaSet) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddServices(services []*v1.Service) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) AddStatefulSets(statefulSets []*apps_v1.StatefulSet) *InputSnapshotManualBuilder
- func (i *InputSnapshotManualBuilder) Build() Snapshot
- type ReconcileOptions
- type ResourceBuildOptions
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMultiClusterReconciler ¶
func RegisterMultiClusterReconciler( ctx context.Context, clusters multicluster.ClusterWatcher, reconcileFunc input.MultiClusterReconcileFunc, reconcileInterval time.Duration, options ReconcileOptions, predicates ...predicate.Predicate, ) input.MultiClusterReconciler
register the reconcile func with the cluster watcher the reconcileInterval, if greater than 0, will limit the number of reconciles to one per interval.
func RegisterSingleClusterReconciler ¶
func RegisterSingleClusterReconciler( ctx context.Context, mgr manager.Manager, reconcileFunc input.SingleClusterReconcileFunc, reconcileInterval time.Duration, options reconcile.Options, predicates ...predicate.Predicate, ) (input.SingleClusterReconciler, error)
register the reconcile func with the manager the reconcileInterval, if greater than 0, will limit the number of reconciles to one per interval.
Types ¶
type BuildOptions ¶
type BuildOptions struct { // List options for composing a snapshot from Meshes Meshes ResourceBuildOptions // List options for composing a snapshot from ConfigMaps ConfigMaps ResourceBuildOptions // List options for composing a snapshot from Services Services ResourceBuildOptions // List options for composing a snapshot from Pods Pods ResourceBuildOptions // List options for composing a snapshot from Nodes Nodes ResourceBuildOptions // List options for composing a snapshot from Deployments Deployments ResourceBuildOptions // List options for composing a snapshot from ReplicaSets ReplicaSets ResourceBuildOptions // List options for composing a snapshot from DaemonSets DaemonSets ResourceBuildOptions // List options for composing a snapshot from StatefulSets StatefulSets ResourceBuildOptions }
Options for building a snapshot
type Builder ¶
type Builder interface {
BuildSnapshot(ctx context.Context, name string, opts BuildOptions) (Snapshot, error)
}
builds the input snapshot from API Clients. Two types of builders are available: a builder for snapshots of resources across multiple clusters a builder for snapshots of resources within a single cluster
func NewMultiClusterBuilder ¶
func NewMultiClusterBuilder( clusters multicluster.Interface, client multicluster.Client, ) Builder
Produces snapshots of resources across all clusters defined in the ClusterSet
func NewSingleClusterBuilder ¶
Produces snapshots of resources across all clusters defined in the ClusterSet
type InputSnapshotManualBuilder ¶
type InputSnapshotManualBuilder struct {
// contains filtered or unexported fields
}
func NewInputSnapshotManualBuilder ¶
func NewInputSnapshotManualBuilder(name string) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddConfigMaps ¶
func (i *InputSnapshotManualBuilder) AddConfigMaps(configMaps []*v1.ConfigMap) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddDaemonSets ¶
func (i *InputSnapshotManualBuilder) AddDaemonSets(daemonSets []*apps_v1.DaemonSet) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddDeployments ¶
func (i *InputSnapshotManualBuilder) AddDeployments(deployments []*apps_v1.Deployment) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddMeshes ¶
func (i *InputSnapshotManualBuilder) AddMeshes(meshes []*appmesh_k8s_aws_v1beta2.Mesh) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddNodes ¶
func (i *InputSnapshotManualBuilder) AddNodes(nodes []*v1.Node) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddPods ¶
func (i *InputSnapshotManualBuilder) AddPods(pods []*v1.Pod) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddReplicaSets ¶
func (i *InputSnapshotManualBuilder) AddReplicaSets(replicaSets []*apps_v1.ReplicaSet) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddServices ¶
func (i *InputSnapshotManualBuilder) AddServices(services []*v1.Service) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) AddStatefulSets ¶
func (i *InputSnapshotManualBuilder) AddStatefulSets(statefulSets []*apps_v1.StatefulSet) *InputSnapshotManualBuilder
func (*InputSnapshotManualBuilder) Build ¶
func (i *InputSnapshotManualBuilder) Build() Snapshot
type ReconcileOptions ¶
type ReconcileOptions struct { // Options for reconciling Meshes Meshes reconcile.Options // Options for reconciling ConfigMaps ConfigMaps reconcile.Options // Options for reconciling Services Services reconcile.Options // Options for reconciling Pods Pods reconcile.Options // Options for reconciling Nodes Nodes reconcile.Options // Options for reconciling Deployments Deployments reconcile.Options // Options for reconciling ReplicaSets ReplicaSets reconcile.Options // Options for reconciling DaemonSets DaemonSets reconcile.Options // Options for reconciling StatefulSets StatefulSets reconcile.Options }
Options for reconcileing a snapshot
type ResourceBuildOptions ¶
type ResourceBuildOptions struct { // List options for composing a snapshot from a resource type ListOptions []client.ListOption // If provided, ensure the resource has been verified before adding it to snapshots Verifier verifier.ServerResourceVerifier }
Options for reading resources of a given type
type Snapshot ¶
type Snapshot interface { // return the set of input Meshes Meshes() appmesh_k8s_aws_v1beta2_sets.MeshSet // return the set of input ConfigMaps ConfigMaps() v1_sets.ConfigMapSet // return the set of input Services Services() v1_sets.ServiceSet // return the set of input Pods Pods() v1_sets.PodSet // return the set of input Nodes Nodes() v1_sets.NodeSet // return the set of input Deployments Deployments() apps_v1_sets.DeploymentSet // return the set of input ReplicaSets ReplicaSets() apps_v1_sets.ReplicaSetSet // return the set of input DaemonSets DaemonSets() apps_v1_sets.DaemonSetSet // return the set of input StatefulSets StatefulSets() apps_v1_sets.StatefulSetSet // serialize the entire snapshot as JSON MarshalJSON() ([]byte, error) }
the snapshot of input resources consumed by translation
func NewSnapshot ¶
func NewSnapshot( name string, meshes appmesh_k8s_aws_v1beta2_sets.MeshSet, configMaps v1_sets.ConfigMapSet, services v1_sets.ServiceSet, pods v1_sets.PodSet, nodes v1_sets.NodeSet, deployments apps_v1_sets.DeploymentSet, replicaSets apps_v1_sets.ReplicaSetSet, daemonSets apps_v1_sets.DaemonSetSet, statefulSets apps_v1_sets.StatefulSetSet, ) Snapshot