controller

package
v2.0.0-...-ec94ed8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetShadowServiceName

func GetShadowServiceName(namespace, name string) (string, error)

GetShadowServiceName returns the shadow service name corresponding to the given service namespace and name.

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.

func (*Controller) Run

func (c *Controller) Run() error

Run is the main controller loop.

func (*Controller) Shutdown

func (c *Controller) Shutdown()

Shutdown shut downs the controller.

type PortMapper

type PortMapper interface {
	Find(namespace, name string, port int32) (int32, bool)
	Add(namespace, name string, port int32) (int32, error)
	Set(namespace, name string, port, targetPort int32) error
	Remove(namespace, name string, port int32) (int32, bool)
}

PortMapper is capable of storing and retrieving a port mapping for a given service.

type ShadowServiceManager

type ShadowServiceManager struct {
	// contains filtered or unexported fields
}

ShadowServiceManager manages shadow services.

func (*ShadowServiceManager) LoadPortMapping

func (s *ShadowServiceManager) LoadPortMapping() error

LoadPortMapping loads the port mapping of existing shadow services into the different port mappers.

func (*ShadowServiceManager) SyncService

func (s *ShadowServiceManager) SyncService(ctx context.Context, namespace, name string) error

SyncService synchronizes the given service and its shadow service. If the shadow service doesn't exist it will be created. If it exists it will be updated and if the service doesn't exist, the shadow service will be removed.

type SharedStore

type SharedStore interface {
	SetConfiguration(cfg *dynamic.Configuration)
	SetTopology(topo *topology.Topology)
	SetReadiness(isReady bool)
}

SharedStore is used to share the controller state.

type TopologyBuilder

type TopologyBuilder interface {
	Build(resourceFilter *k8s.ResourceFilter) (*topology.Topology, error)
}

TopologyBuilder builds Topologies.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL