Documentation ¶
Index ¶
- Constants
- Variables
- func CreateSerializer(respContentType string, info *apirequest.RequestInfo, ...) *serializer.Serializer
- func NewFilterReadCloser(req *http.Request, sm *serializer.SerializerManager, rc io.ReadCloser, ...) (int, io.ReadCloser, error)
- type Approver
- type Factory
- type FilterInitializer
- type FilterInitializers
- type Filters
- type NodeGetter
- type ObjectHandler
- type Runner
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" // InClusterConfigFilterName filter is used to comment kubeconfig in kube-system/kube-proxy configmap // in order to make kube-proxy to use InClusterConfig to access kube-apiserver. InClusterConfigFilterName = "inclusterconfig" // 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" )
Variables ¶
View Source
var ( // DisabledInCloudMode contains the filters that should be disabled when yurthub is working in cloud mode. DisabledInCloudMode = []string{DiscardCloudServiceFilterName} // SupportedComponentsForFilter is used for specifying which components are supported by filters as default setting. SupportedComponentsForFilter = map[string]string{ MasterServiceFilterName: "kubelet", DiscardCloudServiceFilterName: "kube-proxy", ServiceTopologyFilterName: "kube-proxy, coredns, nginx-ingress-controller", InClusterConfigFilterName: "kubelet", } )
Functions ¶
func CreateSerializer ¶ added in v1.2.0
func CreateSerializer(respContentType string, info *apirequest.RequestInfo, sm *serializer.SerializerManager) *serializer.Serializer
func NewFilterReadCloser ¶
func NewFilterReadCloser( req *http.Request, sm *serializer.SerializerManager, rc io.ReadCloser, handler ObjectHandler, 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.
func NewApprover ¶
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) ([]Runner, error)
type ObjectHandler ¶ added in v1.2.0
ObjectHandler is used for filtering runtime object. runtime object includes List object(like ServiceList) that has multiple items and Standalone object(like Service). the second return value(bool): is used to specify the returned object is nil or not.
type Runner ¶ added in v0.7.0
type Runner interface { Name() string // SupportedResourceAndVerbs is used to specify which resource and request verb is supported by the filter. // Because each filter can make sure what requests with resource and verb can be handled. SupportedResourceAndVerbs() map[string]sets.String // 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.