Documentation ¶
Index ¶
- Variables
- func NewSharedInformer(ctx context.Context, resyncPeriod time.Duration, objType runtime.Object, ...) cache.SharedIndexInformer
- func NotEmptyValue(ns string) string
- type KubeWriteOpts
- type ResourceClient
- func (rc *ResourceClient) ApplyStatus(statusClient resources.StatusClient, inputResource resources.InputResource, ...) (resources.Resource, error)
- func (rc *ResourceClient) Delete(namespace, name string, opts clients.DeleteOpts) error
- func (rc *ResourceClient) Kind() string
- func (rc *ResourceClient) List(namespace string, opts clients.ListOpts) (resources.ResourceList, error)
- func (rc *ResourceClient) NewResource() resources.Resource
- func (rc *ResourceClient) Read(namespace, name string, opts clients.ReadOpts) (resources.Resource, error)
- func (rc *ResourceClient) Register() error
- func (rc *ResourceClient) Watch(namespace string, opts clients.WatchOpts) (<-chan resources.ResourceList, <-chan error, error)
- func (rc *ResourceClient) Write(resource resources.Resource, opts clients.WriteOpts) (resources.Resource, error)
- type ResourceClientSharedInformerFactory
- func (f *ResourceClientSharedInformerFactory) AddWatch(bufferSize uint) <-chan v1.Resource
- func (f *ResourceClientSharedInformerFactory) GetLister(namespace string, obj runtime.Object) (ResourceLister, error)
- func (f *ResourceClientSharedInformerFactory) Informers() []cache.SharedIndexInformer
- func (f *ResourceClientSharedInformerFactory) IsClusterCache()
- func (f *ResourceClientSharedInformerFactory) IsRunning() bool
- func (f *ResourceClientSharedInformerFactory) Register(rc *ResourceClient) error
- func (f *ResourceClientSharedInformerFactory) RemoveWatch(c <-chan v1.Resource)
- func (f *ResourceClientSharedInformerFactory) Start()
- type ResourceLister
- type SharedCache
Constants ¶
This section is empty.
Variables ¶
var ( MCreates = stats.Int64("kube/creates", "The number of creates", "1") CreateCountView = &view.View{ Name: "kube/creates-count", Measure: MCreates, Description: "The number of create calls", Aggregation: view.Count(), TagKeys: []tag.Key{ KeyKind, }, } MUpdates = stats.Int64("kube/updates", "The number of updates", "1") UpdateCountView = &view.View{ Name: "kube/updates-count", Measure: MUpdates, Description: "The number of update calls", Aggregation: view.Count(), TagKeys: []tag.Key{ KeyKind, }, } MDeletes = stats.Int64("kube/deletes", "The number of deletes", "1") DeleteCountView = &view.View{ Name: "kube/deletes-count", Measure: MDeletes, Description: "The number of delete calls", Aggregation: view.Count(), TagKeys: []tag.Key{ KeyKind, }, } KeyOpKind, _ = tag.NewKey("op") MInFlight = stats.Int64("kube/req_in_flight", "The number of requests in flight", "1") InFlightSumView = &view.View{ Name: "kube/req-in-flight", Measure: MInFlight, Description: "The number of requests in flight", Aggregation: view.Sum(), TagKeys: []tag.Key{ KeyOpKind, KeyKind, }, } MEvents = stats.Int64("kube/events", "The number of events", "1") EventsCountView = &view.View{ Name: "kube/events-count", Measure: MEvents, Description: "The number of events sent from kuberenets to us", Aggregation: view.Count(), } )
var ( MLists = stats.Int64("kube/lists", "The number of lists", "1") MWatches = stats.Int64("kube/watches", "The number of watches", "1") KeyKind, _ = tag.NewKey("kind") KeyNamespaceKind, _ = tag.NewKey("ns") ListCountView = &view.View{ Name: "kube/lists-count", Measure: MLists, Description: "The number of list calls", Aggregation: view.Count(), TagKeys: []tag.Key{ KeyKind, KeyNamespaceKind, }, } WatchCountView = &view.View{ Name: "kube/watches-count", Measure: MWatches, Description: "The number of watch calls", Aggregation: view.Count(), TagKeys: []tag.Key{ KeyKind, KeyNamespaceKind, }, } )
Functions ¶
func NewSharedInformer ¶ added in v0.10.8
func NotEmptyValue ¶ added in v0.10.8
Types ¶
type KubeWriteOpts ¶
Kuberenetes specific write options. Allows modifing a resource just before it is written. This allows to make kubernetes specific changes, like adding an owner reference.
func (*KubeWriteOpts) StorageWriteOptsTag ¶
func (*KubeWriteOpts) StorageWriteOptsTag()
type ResourceClient ¶
type ResourceClient struct {
// contains filtered or unexported fields
}
lazy start in list & watch register informers in register
func NewResourceClient ¶
func NewResourceClient( crd crd.Crd, clientset versioned.Interface, sharedCache SharedCache, resourceType resources.InputResource, namespaceWhitelist []string, resyncPeriod time.Duration, resourceStatusUnmarshaler resources.StatusUnmarshaler, ) *ResourceClient
func (*ResourceClient) ApplyStatus ¶ added in v0.30.3
func (rc *ResourceClient) ApplyStatus(statusClient resources.StatusClient, inputResource resources.InputResource, opts clients.ApplyStatusOpts) (resources.Resource, error)
func (*ResourceClient) Delete ¶
func (rc *ResourceClient) Delete(namespace, name string, opts clients.DeleteOpts) error
func (*ResourceClient) Kind ¶
func (rc *ResourceClient) Kind() string
func (*ResourceClient) List ¶
func (rc *ResourceClient) List(namespace string, opts clients.ListOpts) (resources.ResourceList, error)
func (*ResourceClient) NewResource ¶
func (rc *ResourceClient) NewResource() resources.Resource
func (*ResourceClient) Register ¶
func (rc *ResourceClient) Register() error
Registers the client with the shared cache. The cache will create a dedicated informer to list and watch resources of kind rc.Kind() in the namespaces given in rc.namespaceWhitelist.
func (*ResourceClient) Watch ¶
func (rc *ResourceClient) Watch(namespace string, opts clients.WatchOpts) (<-chan resources.ResourceList, <-chan error, error)
type ResourceClientSharedInformerFactory ¶
type ResourceClientSharedInformerFactory struct {
// contains filtered or unexported fields
}
The ResourceClientSharedInformerFactory creates a SharedIndexInformer for each of the clients that register with it and, when started, creates a kubernetes controller that distributes notifications for changes to the watches that have been added to the factory. All direct operations on the ResourceClientSharedInformerFactory are synchronized.
func (*ResourceClientSharedInformerFactory) AddWatch ¶
func (f *ResourceClientSharedInformerFactory) AddWatch(bufferSize uint) <-chan v1.Resource
Adds a watch with the given buffer size to the factory.
func (*ResourceClientSharedInformerFactory) GetLister ¶
func (f *ResourceClientSharedInformerFactory) GetLister(namespace string, obj runtime.Object) (ResourceLister, error)
func (*ResourceClientSharedInformerFactory) Informers ¶
func (f *ResourceClientSharedInformerFactory) Informers() []cache.SharedIndexInformer
Not part of the interface (used for testing)
func (*ResourceClientSharedInformerFactory) IsClusterCache ¶ added in v0.11.1
func (f *ResourceClientSharedInformerFactory) IsClusterCache()
func (*ResourceClientSharedInformerFactory) IsRunning ¶
func (f *ResourceClientSharedInformerFactory) IsRunning() bool
Not part of the interface (used for testing)
func (*ResourceClientSharedInformerFactory) Register ¶
func (f *ResourceClientSharedInformerFactory) Register(rc *ResourceClient) error
Creates a new SharedIndexInformer and adds it to the factory's informer registry. NOTE: Currently we cannot share informers between resource clients, because the listWatch functions are configured with the client's specific token. Hence, we must enforce a one-to-one relationship between informers and clients.
func (*ResourceClientSharedInformerFactory) RemoveWatch ¶
func (f *ResourceClientSharedInformerFactory) RemoveWatch(c <-chan v1.Resource)
Removes the given watch to the factory. A call to this method should be deferred passing the channel returned by AddWatch wherever a watch is added.
func (*ResourceClientSharedInformerFactory) Start ¶
func (f *ResourceClientSharedInformerFactory) Start()
Starts all informers in the factory's registry (if they have not yet been started) and configures the factory to call the updateCallback function whenever any of the resources associated with the informers changes.
type ResourceLister ¶
type SharedCache ¶
type SharedCache interface { ResourceClient) error Start() GetLister(namespace string, obj runtime.Object) (ResourceLister, error) // managed by clients that have registered with the factory. // Clients must specify a size for the buffer of the channel they will // receive notifications on. AddWatch(bufferSize uint) <-chan v1.Resource RemoveWatch(c <-chan v1.Resource) }Register(rc *
func NewKubeCache ¶
func NewKubeCache(ctx context.Context) SharedCache
start uses this context, runs until context gets cancelled
Directories ¶
Path | Synopsis |
---|---|
client/clientset/versioned
This package has the automatically generated clientset.
|
This package has the automatically generated clientset. |
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
|
This package has the automatically generated fake clientset. |
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
|
This package contains the scheme of the automatically generated clientset. |
client/clientset/versioned/typed/solo.io/v1
This package has the automatically generated typed clients.
|
This package has the automatically generated typed clients. |
client/clientset/versioned/typed/solo.io/v1/fake
Package fake has the automatically generated clients.
|
Package fake has the automatically generated clients. |
solo.io/v1
Package v1 is the v1 version of the API.
|
Package v1 is the v1 version of the API. |