fds

package
v0.18.19 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

README

Enabling/Disabling Function Discovery in Kubernetes

Gloo's Function Discovery Service (FDS) runs by default on all namespaces except kube-system and kube-public.

FDS sends http requests to discover well-known OpenAPI Endpoints (e.g. /swagger.json) as well as services implementing gRPC Reflection.

This behavior can be disabled at the namespace or service scope.

Simply run the following command to label a namespace or service to indicate that the services in the namespace (or the service itself) should not be polled by FDS for possible function types:

# disable fds for all services in a namespace
kubectl label namespace <namespace> discovery.solo.io/function_discovery=disabled
# disable fds for a single service 
kubectl label service -n <namespace> <service> discovery.solo.io/function_discovery=disabled

Note that FDS is disabled by default for kube-system and kube-public namespaces. To enable:

# enable fds on kube-system
kubectl label namespace kube-system discovery.solo.io/function_discovery=enabled

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	Secrets v1.SecretList
}

type FunctionDiscovery

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

func NewFunctionDiscovery

func NewFunctionDiscovery(updater *Updater) *FunctionDiscovery

func (*FunctionDiscovery) Update

func (d *FunctionDiscovery) Update(upstreams v1.UpstreamList, secrets v1.SecretList) error

type FunctionDiscoveryFactory

type FunctionDiscoveryFactory interface {
	NewFunctionDiscovery(u *v1.Upstream) UpstreamFunctionDiscovery
}

upstreams can be obviously functional like AWS λ, fission,... or an upstream that was already detected and marked as such. or potentially like static upstreams.

detectors detect a specific type of functional service if they detect the service, they return service info and annotations (optional) for the service we want to bake sure that detect upstream for aws doesn't do anything perhaps we can do just that

type Resolver

type Resolver interface {
	/*
		tcp if not known
		http \ https if known or perhaps nats?
	*/
	Resolve(us *v1.Upstream) (*url.URL, error)
}

type Resolvers

type Resolvers []Resolver

func (Resolvers) Resolve

func (resolvers Resolvers) Resolve(us *v1.Upstream) (*url.URL, error)

type Updater

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

func NewUpdater

func NewUpdater(ctx context.Context, resolver Resolver, upstreamclient UpstreamWriterClient, maxconncurrency uint, functionalPlugins []FunctionDiscoveryFactory) *Updater

func (*Updater) GetSecrets

func (u *Updater) GetSecrets() v1.SecretList

func (*Updater) SetSecrets

func (u *Updater) SetSecrets(secretlist v1.SecretList)

func (*Updater) UpstreamAdded

func (u *Updater) UpstreamAdded(upstream *v1.Upstream)

func (*Updater) UpstreamRemoved

func (u *Updater) UpstreamRemoved(upstream *v1.Upstream)

func (*Updater) UpstreamUpdated

func (u *Updater) UpstreamUpdated(upstream *v1.Upstream)

type UpstreamFunctionDiscovery

type UpstreamFunctionDiscovery interface {
	// if this returns true we can skip DetectUpstreamType and go straight to DetectFunctions
	// if this returns false we should call detect upstream type.
	// if detect upstream type retrurns true, we have the type!
	// if it returns false and nil error, it means it was detected to not be of this type -
	// ideally this means that this detector will no longer be used with this upstream. in practice this can be logged\ignored.
	// if it returns false and some error, try again later with back-off \ timeout.
	IsFunctional() bool

	// Returns
	// err != nil temporary error. try again
	// err == nil spec == nil. no type detected, don't try again
	// url is never nil
	DetectType(ctx context.Context, url *url.URL) (*plugins.ServiceSpec, error)

	// url maybe nil if it couldnt be resolved
	DetectFunctions(ctx context.Context, url *url.URL, dependencies func() Dependencies, out func(UpstreamMutator) error) error
}

type UpstreamMutator

type UpstreamMutator func(*v1.Upstream) error

type UpstreamWriterClient

type UpstreamWriterClient interface {
	Write(resource *v1.Upstream, opts clients.WriteOpts) (*v1.Upstream, error)
	Read(namespace, name string, opts clients.ReadOpts) (*v1.Upstream, error)
}

Directories

Path Synopsis
discoveries
aws

Jump to

Keyboard shortcuts

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