Documentation ¶
Overview ¶
Package reconciler defines implementations of the Reconciler interface defined at github.com/knative/pkg/controller.Reconciler. These implement the basic workhorse functionality of controllers, while leaving the shared controller implementation to manage things like the workqueue.
Despite defining a Reconciler, each of the packages here are expected to expose a controller constructor like:
func NewController(...) *controller.Impl { ... }
These constructors will:
- Construct the Reconciler,
- Construct a controller.Impl with that Reconciler,
- Wire the assorted informers this Reconciler watches to call appropriate enqueue methods on the controller.
Index ¶
- Constants
- func AnnotationFilterFunc(key string, value string, allowUnset bool) func(interface{}) bool
- func GetK8sServiceFullname(name string, namespace string) string
- func GetServingK8SServiceNameForObj(name string) string
- func GetServingRevisionNameForK8sService(name string) string
- func LabelExistsFilterFunc(label string) func(obj interface{}) bool
- func MustNewStatsReporter(reconciler string, logger *zap.SugaredLogger) controller.StatsReporter
- type Base
- type Measurement
- type Options
- type StatsReporter
Constants ¶
const ( // ServiceReadyCountN is the number of services that have become ready. ServiceReadyCountN = "service_ready_count" // ServiceReadyLatencyN is the time it takes for a service to become ready since the resource is created. ServiceReadyLatencyN = "service_ready_latency" )
Variables ¶
This section is empty.
Functions ¶
func AnnotationFilterFunc ¶ added in v0.3.0
AnnotationFilterFunc creates a FilterFunc only accepting objects with given annotation key and value
func GetK8sServiceFullname ¶
GetK8sServiceFullname returns service full name
func GetServingK8SServiceNameForObj ¶
GetServingK8SServiceNameForObj returns the service name for the object
func GetServingRevisionNameForK8sService ¶ added in v0.4.0
GetServingRevisionNameForK8sService returns the revision name from the service name
func LabelExistsFilterFunc ¶ added in v0.4.0
LabelExistsFilterFunc creates a FilterFunc only accepting objects which have a given label.
func MustNewStatsReporter ¶
func MustNewStatsReporter(reconciler string, logger *zap.SugaredLogger) controller.StatsReporter
MustNewStatsReporter creates a new instance of StatsReporter. Panics if creation fails.
Types ¶
type Base ¶
type Base struct { // KubeClientSet allows us to talk to the k8s for core APIs KubeClientSet kubernetes.Interface SharedClientSet sharedclientset.Interface // ServingClientSet allows us to configure Serving objects ServingClientSet clientset.Interface // DynamicClientSet allows us to configure pluggable Build objects DynamicClientSet dynamic.Interface // CachingClientSet allows us to instantiate Image objects CachingClientSet cachingclientset.Interface // ConfigMapWatcher allows us to watch for ConfigMap changes. ConfigMapWatcher configmap.Watcher // Recorder is an event recorder for recording Event resources to the // Kubernetes API. Recorder record.EventRecorder // StatsReporter reports reconciler's metrics. StatsReporter StatsReporter // Sugared logger is easier to use but is not as performant as the // raw logger. In performance critical paths, call logger.Desugar() // and use the returned raw logger instead. In addition to the // performance benefits, raw logger also preserves type-safety at // the expense of slightly greater verbosity. Logger *zap.SugaredLogger }
Base implements the core controller logic, given a Reconciler.
type Measurement ¶ added in v0.3.0
type Measurement int
type Options ¶
type Options struct { KubeClientSet kubernetes.Interface ServingClientSet clientset.Interface DynamicClientSet dynamic.Interface CachingClientSet cachingclientset.Interface Recorder record.EventRecorder StatsReporter StatsReporter ConfigMapWatcher configmap.Watcher Logger *zap.SugaredLogger ResyncPeriod time.Duration StopChannel <-chan struct{} }
Options defines the common reconciler options. We define this to reduce the boilerplate argument list when creating our controllers.
func (Options) GetTrackerLease ¶
GetTrackerLease returns a multiple of the resync period to use as the duration for tracker leases. This attempts to ensure that resyncs happen to refresh leases frequently enough that we don't miss updates to tracked objects.
type StatsReporter ¶ added in v0.3.0
type StatsReporter interface { // ReportServiceReady reports the time it took a service to become Ready. ReportServiceReady(namespace, service string, d time.Duration) error }
StatsReporter reports reconcilers' metrics.
func NewStatsReporter ¶ added in v0.3.0
func NewStatsReporter(reconciler string) (StatsReporter, error)
NewStatsReporter creates a reporter for reconcilers' metrics
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package testing includes utilities for testing controllers.
|
Package testing includes utilities for testing controllers. |
v1alpha1
|
|
autoscaling/kpa
Package kpa implements a kubernetes controller which tracks revisions and notifies a callback interface.
|
Package kpa implements a kubernetes controller which tracks revisions and notifies a callback interface. |
clusteringress
Package clusteringress implements a kubernetes controller which tracks ClusterIngress resource and reconcile VirtualService as its child resource.
|
Package clusteringress implements a kubernetes controller which tracks ClusterIngress resource and reconcile VirtualService as its child resource. |
clusteringress/config
Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the ClusterIngress controller depends.
|
Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the ClusterIngress controller depends. |
clusteringress/resources
Package resources holds simple functions for synthesizing child resources from a ClusterIngress resource and any relevant ClusterIngress controller configuration.
|
Package resources holds simple functions for synthesizing child resources from a ClusterIngress resource and any relevant ClusterIngress controller configuration. |
clusteringress/resources/names
Package names holds simple functions for synthesizing resource names.
|
Package names holds simple functions for synthesizing resource names. |
configuration/config
+k8s:deepcopy-gen=package Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Configuration controller depends.
|
+k8s:deepcopy-gen=package Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Configuration controller depends. |
configuration/resources
Package resources holds simple functions for synthesizing child resources from a Configuration resource and any relevant Configuration controller configuration.
|
Package resources holds simple functions for synthesizing child resources from a Configuration resource and any relevant Configuration controller configuration. |
labeler
Package labeler holds the logic that applies Route labels to Configurations to implement knative/serving#226.
|
Package labeler holds the logic that applies Route labels to Configurations to implement knative/serving#226. |
revision/config
Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Revision controller depends.
|
Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Revision controller depends. |
revision/resources
Package resources holds simple functions for synthesizing child resources from a Revision resource and any relevant Revision controller configuration.
|
Package resources holds simple functions for synthesizing child resources from a Revision resource and any relevant Revision controller configuration. |
revision/resources/names
Package names holds simple functions for synthesizing resource names.
|
Package names holds simple functions for synthesizing resource names. |
route
Package route implements a kubernetes controller which tracks Route resource and reconcile ClusterIngress as its child resource.
|
Package route implements a kubernetes controller which tracks Route resource and reconcile ClusterIngress as its child resource. |
route/config
+k8s:deepcopy-gen=package Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Route controller depends.
|
+k8s:deepcopy-gen=package Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Route controller depends. |
route/resources
Package resources holds simple functions for synthesizing child resources from a Route resource and any relevant Route controller configuration.
|
Package resources holds simple functions for synthesizing child resources from a Route resource and any relevant Route controller configuration. |
route/resources/names
Package names holds simple functions for synthesizing resource names.
|
Package names holds simple functions for synthesizing resource names. |
service/resources
Package resources holds simple functions for synthesizing child resources from a Service resource and any relevant Service controller configuration.
|
Package resources holds simple functions for synthesizing child resources from a Service resource and any relevant Service controller configuration. |
service/resources/names
Package names holds simple functions for synthesizing resource names.
|
Package names holds simple functions for synthesizing resource names. |