Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RoutingDiscovery ¶
type RoutingDiscovery struct {
// contains filtered or unexported fields
}
RoutingDiscovery allows to get fresh director and backendpool configuration filled with autogenerated routings based on service annotations. See more details about it in server/README.md#Running_with_Dynaming_Routing_Discovery
func NewFromFlags ¶
func NewFromFlags(logger logrus.FieldLogger, baseDirector *pb_config.DirectorConfig, baseBackendpool *pb_config.BackendPoolConfig) (*RoutingDiscovery, error)
NewFromFlags creates new RoutingDiscovery flow flags.
func NewWithClient ¶
func NewWithClient(logger logrus.FieldLogger, baseDirector *pb_config.DirectorConfig, baseBackendpool *pb_config.BackendPoolConfig, serviceClient serviceClient) *RoutingDiscovery
NewWithClient returns a new Kubernetes RoutingDiscovery using given k8s.APIClient configured to be used against kube-apiserver.
func (*RoutingDiscovery) DiscoverAndSetFlags ¶
func (d *RoutingDiscovery) DiscoverAndSetFlags( ctx context.Context, directorFlagz *protoflagz.DynProto3Value, backendpoolFlagz *protoflagz.DynProto3Value, ) error
DiscoverAndSetFlags constantly watches service list endpoint for changes and sets director and backendpool flags to change routing configuration. Having it set by flagz is giving us possibility to see current values in debug/flagz page and perform proper apply in different place (where we are parsing flags).
func (*RoutingDiscovery) DiscoverOnce ¶
func (d *RoutingDiscovery) DiscoverOnce(ctx context.Context, timeToWait time.Duration) (*pb_config.DirectorConfig, *pb_config.BackendPoolConfig, error)
DiscoverOnce returns director & backendpool configs filled with mix of persistent routes & backends given in base configs and dynamically discovered ones.