Documentation
¶
Overview ¶
Package watchlist provides a reader for the APIServer watchlist API.
The watchlist API provides all request objects on the APIServer and streams changes to those objects as they are made. This is signficantly more efficient that the informer API, which using a bad caching implementation to cache all the objects.
In addition, this provides a reslist option that can be used to time out the current reader and create a new on underneath to refresh the view of the APIServer in case any updates were missed.
Index ¶
Constants ¶
const ( // RTNode retrieves node data. RTNode = reader.RTNode // RTPod retrieves pod data. RTPod = reader.RTPod // RTNamespace retrieves namespace data. RTNamespace = reader.RTNamespace // RTPersistentVolume retrieves persistent volume data. RTPersistentVolume = reader.RTPersistentVolume // RTRBAC retrieves RBAC data. This includes all namespaced roles and cluster roles plus // all role bindings and cluster role bindings. RTRBAC = reader.RTRBAC // RTService retrieves service data. RTService = reader.RTService // RTDeployment retrieves deployment data. RTDeployment = reader.RTDeployment // RTIngressController retrieves ingress controller data. RTIngressController = reader.RTIngressController // RTEndpoints retrieves endpoints data. RTEndpoint = reader.RTEndpoint )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
Option is an option for New(). Unused for now.
func WithFilterSize ¶
WithFilterSize sets the initial size of the filter map.
func WithLogger ¶
WithLogger sets the logger for the Changes object.
func WithRelist ¶
WithRelist will set a duration in which we will relist all the objects in the APIServer. This is useful to prevent split brain scenarios where the APIServer and tattler have different views of the world. The default is never. The minimum is 1 hour and the maximum is 7 days.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reports changes made to data objects on the APIServer via the watchlist API.
func New ¶
func New(ctx context.Context, clientset *kubernetes.Clientset, retrieveTypes RetrieveType, opts ...Option) (*Reader, error)
New creates a new Reader object. retrieveTypes is a bitwise flag to determine what data to retrieve.
func (*Reader) Close ¶
Close closes the Reader. This will stop all watchers and close the output channel.
type RetrieveType ¶
type RetrieveType = reader.RetrieveType
RetrieveType is the type of data to retrieve. Uses as a bitwise flag. So, like: RTNode | RTPod, or RTNode, or RTPod.