Interface ControllerFactory
public interface ControllerFactory
Controller factory interface.
-
Method Summary
Modifier and TypeMethodDescription<ApiType extends KubernetesObject>
@NonNull ControllercreateController(@NonNull Class<ApiType> apiTypeClass, @Nullable Set<String> namespaces, @NonNull ResourceReconciler<ApiType> resourceReconciler) Creates a controller that will process events published bySharedIndexInformers created for given namespaces.<ApiType extends KubernetesObject>
@NonNull ControllercreateController(@Nullable String name, @NonNull Class<ApiType> apiTypeClass, @Nullable Set<String> namespaces, @NonNull ResourceReconciler<ApiType> resourceReconciler) Creates a controller that will process events published bySharedIndexInformers created for given namespaces.<ApiType extends KubernetesObject>
@NonNull ControllercreateController(@Nullable String name, @NonNull Class<ApiType> apiTypeClass, @Nullable Set<String> namespaces, @NonNull ResourceReconciler<ApiType> resourceReconciler, @Nullable RateLimitingQueue<Request> workQueue) Creates a controller that will process events published bySharedIndexInformers created for given namespaces.<ApiType extends KubernetesObject>
@NonNull ControllercreateController(@Nullable String name, @NonNull Class<ApiType> apiTypeClass, @Nullable Set<String> namespaces, @NonNull ResourceReconciler<ApiType> resourceReconciler, @Nullable RateLimitingQueue<Request> workQueue, @Nullable Predicate<ApiType> onAddFilterPredicate, @Nullable BiPredicate<ApiType, ApiType> onUpdateFilterPredicate, @Nullable BiPredicate<ApiType, Boolean> onDeleteFilterPredicate) Creates a controller that will process events published bySharedIndexInformers created for given namespaces.voidStarts created controllers.voidStops created controllers.
-
Method Details
-
createController
@NonNull <ApiType extends KubernetesObject> @NonNull Controller createController(@NonNull @NonNull Class<ApiType> apiTypeClass, @Nullable @Nullable Set<String> namespaces, @NonNull @NonNull ResourceReconciler<ApiType> resourceReconciler) Creates a controller that will process events published bySharedIndexInformers created for given namespaces. The informers should be created before this method is called.- Type Parameters:
ApiType- the kubernetes api type- Parameters:
apiTypeClass- the api type classnamespaces- the set of namespaces should be empty or set tonullfor cluster-wide objects (e.g. V1Node) or for namespaced objects (e.g. V1Secret) when the controller needs to handle kubernetes objects from all namespacesresourceReconciler- the resource reconciler implementation- Returns:
- the created controller
-
createController
@NonNull <ApiType extends KubernetesObject> @NonNull Controller createController(@Nullable @Nullable String name, @NonNull @NonNull Class<ApiType> apiTypeClass, @Nullable @Nullable Set<String> namespaces, @NonNull @NonNull ResourceReconciler<ApiType> resourceReconciler) Creates a controller that will process events published bySharedIndexInformers created for given namespaces. The informers should be created before this method is called.- Type Parameters:
ApiType- the kubernetes api type- Parameters:
name- the name which is used to uniquely identify the created controller. If not provided, it will be generated.apiTypeClass- the api type classnamespaces- the set of namespaces should be empty or set tonullfor cluster-wide objects (e.g. V1Node) or for namespaced objects (e.g. V1Secret) when the controller needs to handle kubernetes objects from all namespacesresourceReconciler- the resource reconciler implementation- Returns:
- the created controller
-
createController
@NonNull <ApiType extends KubernetesObject> @NonNull Controller createController(@Nullable @Nullable String name, @NonNull @NonNull Class<ApiType> apiTypeClass, @Nullable @Nullable Set<String> namespaces, @NonNull @NonNull ResourceReconciler<ApiType> resourceReconciler, @Nullable @Nullable RateLimitingQueue<Request> workQueue) Creates a controller that will process events published bySharedIndexInformers created for given namespaces. The informers should be created before this method is called.- Type Parameters:
ApiType- the kubernetes api type- Parameters:
name- the name which is used to uniquely identify the created controller. If not provided, it will be generated.apiTypeClass- the api type classnamespaces- the set of namespaces should be empty or set tonullfor cluster-wide objects (e.g. V1Node) or for namespaced objects (e.g. V1Secret) when the controller needs to handle kubernetes objects from all namespacesresourceReconciler- the resource reconciler implementationworkQueue- the producer-consumer queue where a producer is an informer and a consumer is a created controller. If not provided,DefaultRateLimitingQueuewill be used.- Returns:
- the created controller
-
createController
@NonNull <ApiType extends KubernetesObject> @NonNull Controller createController(@Nullable @Nullable String name, @NonNull @NonNull Class<ApiType> apiTypeClass, @Nullable @Nullable Set<String> namespaces, @NonNull @NonNull ResourceReconciler<ApiType> resourceReconciler, @Nullable @Nullable RateLimitingQueue<Request> workQueue, @Nullable @Nullable Predicate<ApiType> onAddFilterPredicate, @Nullable @Nullable BiPredicate<ApiType, ApiType> onUpdateFilterPredicate, @Nullable @Nullable BiPredicate<ApiType, Boolean> onDeleteFilterPredicate) Creates a controller that will process events published bySharedIndexInformers created for given namespaces. The informers should be created before this method is called.- Type Parameters:
ApiType- the kubernetes api type- Parameters:
name- the name which is used to uniquely identify the created controller. If not provided, it will be generated.apiTypeClass- the api type classnamespaces- the set of namespaces should be empty or set tonullfor cluster-wide objects (e.g. V1Node) or for namespaced objects (e.g. V1Secret) when the controller needs to handle kubernetes objects from all namespacesresourceReconciler- the resource reconciler implementationworkQueue- the producer-consumer queue where a producer is an informer and a consumer is a created controller. If not provided,DefaultRateLimitingQueuewill be used.onAddFilterPredicate- The filter which is applied by informer's resource handler when a new resource is created.onUpdateFilterPredicate- The filter which is applied by informer's resource handler when an existing resource is updated.onDeleteFilterPredicate- The filter which is applied by informer's resource handler when an existing resource is deleted.- Returns:
- the created controller
-
startControllers
void startControllers()Starts created controllers. -
stopControllers
void stopControllers()Stops created controllers.
-