Documentation
¶
Index ¶
- type CommonResourceEventHandler
- type ConfigMapManager
- type EventFilter
- type LocationCache
- func (lc *LocationCache) AddOrUpdatePod(pod v1.Pod)
- func (lc *LocationCache) ConfigMapNodes(namespace, name string) (nodes []string)
- func (lc *LocationCache) DeleteConfigMap(namespace, name string)
- func (lc *LocationCache) DeleteNode(nodeName string)
- func (lc *LocationCache) DeleteSecret(namespace, name string)
- func (lc *LocationCache) IsEdgeNode(nodeName string) bool
- func (lc *LocationCache) PodConfigMapsAndSecrets(pod v1.Pod) (configMaps, secrets []string)
- func (lc *LocationCache) SecretNodes(namespace, name string) (nodes []string)
- func (lc *LocationCache) UpdateEdgeNode(nodeName string)
- type Manager
- type NodesManager
- type PodManager
- type RuleEndpointManager
- type RuleManager
- type SecretManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonResourceEventHandler ¶
type CommonResourceEventHandler struct {
// contains filtered or unexported fields
}
CommonResourceEventHandler can be used by configmapManager and podManager
func NewCommonResourceEventHandler ¶
func NewCommonResourceEventHandler(events chan watch.Event, filter EventFilter) *CommonResourceEventHandler
NewCommonResourceEventHandler create CommonResourceEventHandler used by configmapManager and podManager
func (*CommonResourceEventHandler) OnAdd ¶
func (c *CommonResourceEventHandler) OnAdd(obj interface{}, _ bool)
OnAdd handle Add event
func (*CommonResourceEventHandler) OnDelete ¶
func (c *CommonResourceEventHandler) OnDelete(obj interface{})
OnDelete handle Delete event
func (*CommonResourceEventHandler) OnUpdate ¶
func (c *CommonResourceEventHandler) OnUpdate(oldObj, newObj interface{})
OnUpdate handle Update event
type ConfigMapManager ¶
type ConfigMapManager struct {
// contains filtered or unexported fields
}
ConfigMapManager manage all events of configmap by SharedInformer
func NewConfigMapManager ¶
func NewConfigMapManager(config *v1alpha1.EdgeController, si cache.SharedIndexInformer) (*ConfigMapManager, error)
NewConfigMapManager create ConfigMapManager by kube clientset and namespace
func (*ConfigMapManager) Events ¶
func (cmm *ConfigMapManager) Events() chan watch.Event
Events return the channel save events from watch configmap change
type EventFilter ¶ added in v1.13.0
type EventFilter interface { // Create returns true if the Create event should be processed Create(obj interface{}) bool // Delete returns true if the Delete event should be processed Delete(obj interface{}) bool // Update returns true if the Update event should be processed Update(oldObj, newObj interface{}) bool }
EventFilter filter the event before enqueuing the key
type LocationCache ¶
type LocationCache struct { // EdgeNodes is a set, key is nodeName EdgeNodes sync.Map // contains filtered or unexported fields }
LocationCache cache the map of node, pod, configmap, secret
func (*LocationCache) AddOrUpdatePod ¶
func (lc *LocationCache) AddOrUpdatePod(pod v1.Pod)
AddOrUpdatePod add pod to node, pod to configmap, configmap to pod, pod to secret, secret to pod relation
func (*LocationCache) ConfigMapNodes ¶
func (lc *LocationCache) ConfigMapNodes(namespace, name string) (nodes []string)
ConfigMapNodes return all nodes which deploy pod on with configmap
func (*LocationCache) DeleteConfigMap ¶
func (lc *LocationCache) DeleteConfigMap(namespace, name string)
DeleteConfigMap from cache
func (*LocationCache) DeleteNode ¶
func (lc *LocationCache) DeleteNode(nodeName string)
DeleteNode from cache
func (*LocationCache) DeleteSecret ¶
func (lc *LocationCache) DeleteSecret(namespace, name string)
DeleteSecret from cache
func (*LocationCache) IsEdgeNode ¶
func (lc *LocationCache) IsEdgeNode(nodeName string) bool
IsEdgeNode checks weather node is edge node or not
func (*LocationCache) PodConfigMapsAndSecrets ¶
func (lc *LocationCache) PodConfigMapsAndSecrets(pod v1.Pod) (configMaps, secrets []string)
PodConfigMapsAndSecrets return configmaps and secrets used by pod
func (*LocationCache) SecretNodes ¶
func (lc *LocationCache) SecretNodes(namespace, name string) (nodes []string)
SecretNodes return all nodes which deploy pod on with secret
func (*LocationCache) UpdateEdgeNode ¶
func (lc *LocationCache) UpdateEdgeNode(nodeName string)
UpdateEdgeNode is to maintain edge nodes name upto-date by querying kubernetes client
type Manager ¶
Manager define the interface of a Manager, configmapManager and podManager implement it
type NodesManager ¶
type NodesManager struct {
// contains filtered or unexported fields
}
NodesManager manage all events of nodes by SharedInformer
func NewNodesManager ¶
func NewNodesManager(si cache.SharedIndexInformer) (*NodesManager, error)
NewNodesManager create NodesManager by kube clientset and namespace
func (*NodesManager) Events ¶
func (nm *NodesManager) Events() chan watch.Event
Events return the channel save events from watch nodes change
type PodManager ¶
type PodManager struct {
// contains filtered or unexported fields
}
PodManager is a manager watch pod change event
func NewPodManager ¶
func NewPodManager(config *v1alpha1.EdgeController, si cache.SharedIndexInformer) (*PodManager, error)
NewPodManager create PodManager from config
func (*PodManager) Events ¶
func (pm *PodManager) Events() chan watch.Event
Events return a channel, can receive all pod event
type RuleEndpointManager ¶ added in v1.6.0
type RuleEndpointManager struct {
// contains filtered or unexported fields
}
RuleEndpointManager manage all events of rule by SharedInformer
func NewRuleEndpointManager ¶ added in v1.6.0
func NewRuleEndpointManager(config *v1alpha1.EdgeController, si cache.SharedIndexInformer) (*RuleEndpointManager, error)
NewRuleEndpointManager create RuleEndpointManager by SharedIndexInformer
func (*RuleEndpointManager) Events ¶ added in v1.6.0
func (rem *RuleEndpointManager) Events() chan watch.Event
Events return the channel save events from watch secret change
type RuleManager ¶ added in v1.6.0
type RuleManager struct {
// contains filtered or unexported fields
}
RuleManager manage all events of rule by SharedInformer
func NewRuleManager ¶ added in v1.6.0
func NewRuleManager(config *v1alpha1.EdgeController, si cache.SharedIndexInformer) (*RuleManager, error)
NewRuleManager create RuleManager by SharedIndexInformer
func (*RuleManager) Events ¶ added in v1.6.0
func (rm *RuleManager) Events() chan watch.Event
Events return the channel save events from watch secret change
type SecretManager ¶
type SecretManager struct {
// contains filtered or unexported fields
}
SecretManager manage all events of secret by SharedInformer
func NewSecretManager ¶
func NewSecretManager(config *v1alpha1.EdgeController, si cache.SharedIndexInformer) (*SecretManager, error)
NewSecretManager create SecretManager by kube clientset and namespace
func (*SecretManager) Events ¶
func (sm *SecretManager) Events() chan watch.Event
Events return the channel save events from watch secret change