README ¶
Enabling/Disabling Function Discovery in Kubernetes
Gloo Edge'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 AdditionalClients ¶ added in v1.9.25
type AdditionalClients struct {
GraphqlClient v1beta1.GraphQLApiClient
}
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, clients AdditionalClients) 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 Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
func NewUpdater ¶
func NewUpdater(ctx context.Context, resolver Resolver, graphqlClient v1beta1.GraphQLApiClient, 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 (*Updater) UpstreamRemoved ¶
func (*Updater) UpstreamUpdated ¶
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 returns 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 couldn't be resolved DetectFunctions(ctx context.Context, url *url.URL, dependencies func() Dependencies, out func(UpstreamMutator) error) error }