Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MasterServiceFilterName filter is used to mutate the ClusterIP and https port of default/kubernetes service // in order to pods on edge nodes can access kube-apiserver directly by inClusterConfig. MasterServiceFilterName = "masterservice" // ServiceTopologyFilterName filter is used to reassemble endpointslice in order to make the service traffic // under the topology that defined by service.Annotation["openyurt.io/topologyKeys"] ServiceTopologyFilterName = "servicetopology" // DiscardCloudServiceFilterName filter is used to discard cloud service(like loadBalancer service) // on kube-proxy list/watch service request from edge nodes. DiscardCloudServiceFilterName = "discardcloudservice" // SkipDiscardServiceAnnotation is annotation used by LB service. // If end users want to use specified LB service at the edge side, // End users should add annotation["openyurt.io/skip-discard"]="true" for LB service. SkipDiscardServiceAnnotation = "openyurt.io/skip-discard" // EndpointsFilterName is used to reassemble endpoints in order to make the data traffic be // load balanced only to the nodepool valid endpoints. EndpointsFilterName = "endpoints" )
Variables ¶
View Source
var DisabledInCloudMode = []string{DiscardCloudServiceFilterName}
DisabledInCloudMode contains the filters that should be disabled when yurthub is working in cloud mode.
Functions ¶
func NewFilterReadCloser ¶
func NewFilterReadCloser( req *http.Request, rc io.ReadCloser, handler Handler, serializer *serializer.Serializer, ownerName string, stopCh <-chan struct{}) (int, io.ReadCloser, error)
NewFilterReadCloser create an filterReadCloser object
Types ¶
type Approver ¶
Approver check the response of specified request need to go through filter or not. and get the filter name for the specified request.
type FilterInitializer ¶
type FilterInitializers ¶
type FilterInitializers []FilterInitializer
func (FilterInitializers) Initialize ¶
func (fis FilterInitializers) Initialize(ins Runner) error
type Filters ¶
func NewFilters ¶
func (*Filters) NewFromFilters ¶
func (fs *Filters) NewFromFilters(initializer FilterInitializer) (map[string]Runner, error)
type Handler ¶
type Handler interface { // StreamResponseFilter is used to filter processing of streaming data. StreamResponseFilter(rc io.ReadCloser, ch chan watch.Event) error // ObjectResponseFilter is used to filter processing of object data. ObjectResponseFilter(b []byte) ([]byte, error) }
Handler customizes data filtering processing interface for each handler. In the data filtering framework, data is mainly divided into two types:
Object data: data returned by list/get request. Streaming data: The data returned by the watch request will be continuously pushed to the edge by the cloud.
type Manager ¶ added in v0.7.0
func NewFilterManager ¶ added in v0.7.0
func NewFilterManager(sharedFactory informers.SharedInformerFactory, filters map[string]Runner) *Manager
type Runner ¶ added in v0.7.0
type Runner interface { // Filter is used to filter data returned from the cloud. Filter(req *http.Request, rc io.ReadCloser, stopCh <-chan struct{}) (int, io.ReadCloser, error) }
Runner is the actor for response filter
Click to show internal directories.
Click to hide internal directories.