Documentation
¶
Index ¶
Constants ¶
View Source
const (
// maps a Container.HostPort to the same exact offered host port, ignores .HostPort = 0
StrategyFixed = Strategy("fixed")
// same as MappingFixed, except that .HostPort of 0 are mapped to any port offered
StrategyWildcard = Strategy("wildcard")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DuplicateError ¶
type DuplicateError struct {
// contains filtered or unexported fields
}
type Mapper ¶
type Mapper interface {
// Map maps the given pod and the given mesos offer and returns a
// slice of port mappings or an error if the mapping failed
Map(pod *api.Pod, roles []string, offer *mesos.Offer) ([]Mapping, error)
}
Objects implementing the Mapper interface generate port mappings from k8s container ports to ports offered by mesos
type MapperFunc ¶
type MapperFunc func(*api.Pod, []string, *mesos.Offer) ([]Mapping, error)
MapperFunc is a function adapter to the Mapper interface
type Mapping ¶
type Mapping struct {
ContainerIdx int // index of the container in the pod spec
PortIdx int // index of the port in a container's port spec
OfferPort uint64 // the port offered by mesos
Role string // the role asssociated with the offered port
}
A Mapping represents the mapping between k8s container ports ports offered by mesos. It references the k8s' container and port and specifies the offered mesos port and the offered port's role
func FixedMapper ¶
func FixedMapper(pod *api.Pod, roles []string, offer *mesos.Offer) ([]Mapping, error)
FixedMapper maps k8s host ports to offered ports ignoring hostPorts == 0 (remaining pod-private)
func WildcardMapper ¶
func WildcardMapper(pod *api.Pod, roles []string, offer *mesos.Offer) ([]Mapping, error)
WildcardMapper maps k8s wildcard ports (hostPort == 0) to any available offer port
type PortAllocationError ¶
type PortAllocationError struct {
PodID string
Ports []uint64
}
Click to show internal directories.
Click to hide internal directories.