Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ACLEnabled bool DefaultMode string Namespace string WatchNamespaces []string IgnoreNamespaces []string MinHTTPPort int32 MaxHTTPPort int32 MinTCPPort int32 MaxTCPPort int32 MinUDPPort int32 MaxUDPPort int32 }
Config holds the configuration of the controller.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller hold controller configuration.
func NewMeshController ¶
func NewMeshController(clients k8s.Client, cfg Config, store SharedStore, logger logrus.FieldLogger) *Controller
NewMeshController builds the informers and other required components of the mesh controller, and returns an initialized mesh controller object.
type PortMapper ¶
type PortMapper interface { Find(namespace, name string, port int32) (int32, bool) Add(namespace, name string, port int32) (int32, error) Remove(namespace, name string, port int32) (int32, error) }
PortMapper is capable of storing and retrieving a port mapping for a given service.
type PortMapping ¶
type PortMapping struct {
// contains filtered or unexported fields
}
PortMapping is a PortMapper.
func NewPortMapping ¶
func NewPortMapping(namespace string, serviceLister listers.ServiceLister, logger logrus.FieldLogger, minPort, maxPort int32) *PortMapping
NewPortMapping creates and returns a new PortMapping instance.
func (*PortMapping) Add ¶
func (p *PortMapping) Add(namespace, name string, port int32) (int32, error)
Add adds a new mapping between the given service port and the first port available in the range defined within minPort and maxPort. If there's no port left, an error will be returned.
func (*PortMapping) Find ¶
func (p *PortMapping) Find(namespace, name string, port int32) (int32, bool)
Find searches the port mapped to the given service port.
func (*PortMapping) LoadState ¶
func (p *PortMapping) LoadState() error
LoadState initializes the mapping table from the current shadow service state.
type ShadowServiceManager ¶
type ShadowServiceManager struct {
// contains filtered or unexported fields
}
ShadowServiceManager manages shadow services.
func NewShadowServiceManager ¶
func NewShadowServiceManager(logger logrus.FieldLogger, serviceLister listers.ServiceLister, namespace string, tcpStateTable, udpStateTable PortMapper, defaultTrafficType string, minHTTPPort, maxHTTPPort int32, kubeClient kubernetes.Interface) *ShadowServiceManager
NewShadowServiceManager returns new shadow service manager.
func (*ShadowServiceManager) CreateOrUpdate ¶
func (s *ShadowServiceManager) CreateOrUpdate(ctx context.Context, svc *corev1.Service) (*corev1.Service, error)
CreateOrUpdate creates or updates the shadow service corresponding to the given service.
type SharedStore ¶
type SharedStore interface {}
SharedStore is used to share the controller state.
type TopologyBuilder ¶
type TopologyBuilder interface {
Build(resourceFilter *k8s.ResourceFilter) (*topology.Topology, error)
}
TopologyBuilder builds Topologies.