apiserver: k8s.io/apiserver/pkg/server/egressselector Index | Files

package egressselector

import "k8s.io/apiserver/pkg/server/egressselector"

Index

Package Files

config.go egress_selector.go

func ReadEgressSelectorConfiguration Uses

func ReadEgressSelectorConfiguration(configFilePath string) (*apiserver.EgressSelectorConfiguration, error)

ReadEgressSelectorConfiguration reads the egress selector configuration at the specified path. It returns the loaded egress selector configuration if the input file aligns with the required syntax. If it does not align with the provided syntax, it returns a default configuration which should function as a no-op. It does this by returning a nil configuration, which preserves backward compatibility. This works because prior to this there was no egress selector configuration. It returns an error if the file did not exist.

func ValidateEgressSelectorConfiguration Uses

func ValidateEgressSelectorConfiguration(config *apiserver.EgressSelectorConfiguration) field.ErrorList

ValidateEgressSelectorConfiguration checks the apiserver.EgressSelectorConfiguration for common configuration errors. It will return error for problems such as configuring mtls/cert settings for protocol which do not support security. It will also try to catch errors such as incorrect file paths. It will return nil if it does not find anything wrong.

type EgressSelector Uses

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

EgressSelector is the map of network context type to context dialer, for network egress.

func NewEgressSelector Uses

func NewEgressSelector(config *apiserver.EgressSelectorConfiguration) (*EgressSelector, error)

NewEgressSelector configures lookup mechanism for Lookup. It does so based on a EgressSelectorConfiguration which was read at startup.

func (*EgressSelector) Lookup Uses

func (cs *EgressSelector) Lookup(networkContext NetworkContext) (utilnet.DialFunc, error)

Lookup gets the dialer function for the network context. This is configured for the Kubernetes API Server at startup.

type EgressType Uses

type EgressType int

EgressType is an indicator of which egress selection should be used for sending traffic. See https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190226-network-proxy.md#network-context

const (
    // Master is the EgressType for traffic intended to go to the control plane.
    Master EgressType = iota
    // Etcd is the EgressType for traffic intended to go to Kubernetes persistence store.
    Etcd
    // Cluster is the EgressType for traffic intended to go to the system being managed by Kubernetes.
    Cluster
)

func (EgressType) AsNetworkContext Uses

func (s EgressType) AsNetworkContext() NetworkContext

AsNetworkContext is a helper function to make it easy to get the basic NetworkContext objects.

func (EgressType) String Uses

func (s EgressType) String() string

String returns the canonical string representation of the egress type

type Lookup Uses

type Lookup func(networkContext NetworkContext) (utilnet.DialFunc, error)

Lookup is the interface to get the dialer function for the network context.

type NetworkContext Uses

type NetworkContext struct {
    // EgressSelectionName is the unique name of the
    // EgressSelectorConfiguration which determines
    // the network we route the traffic to.
    EgressSelectionName EgressType
}

NetworkContext is the struct used by Kubernetes API Server to indicate where it intends traffic to be sent.

Package egressselector imports 19 packages (graph) and is imported by 12 packages. Updated 2019-11-16. Refresh now. Tools for package owners.