Documentation ¶
Index ¶
- Constants
- Variables
- func IsIngressTLSEnabled(ingress *extsv1beta1.Ingress) bool
- func SetEdgeLBManager(m edgelbmanager.EdgeLBManager)
- func SetIngressEdgeLBPoolSpec(ingress *extsv1beta1.Ingress, obj *IngressEdgeLBPoolSpec) error
- func SetServiceEdgeLBPoolSpec(service *corev1.Service, obj *ServiceEdgeLBPoolSpec) error
- type BaseEdgeLBPoolSpec
- type EdgeLBPoolCreationStrategy
- type EdgeLBPoolManagementStrategies
- type IngressEdgeLBPoolFrontendsSpec
- type IngressEdgeLBPoolHTTPFrontendSpec
- type IngressEdgeLBPoolHTTPSFrontendSpec
- type IngressEdgeLBPoolSpec
- type ServiceEdgeLBPoolFrontendSpec
- type ServiceEdgeLBPoolSpec
Constants ¶
const ( IngressEdgeLBHTTPModeDisabled = "disabled" IngressEdgeLBHTTPModeEnabled = "enabled" IngressEdgeLBHTTPModeRedirect = "redirect" )
Variables ¶
var ( // DefaultEdgeLBPoolCpus is the amount of CPU to request for an EdgeLB pool when a value is not provided. DefaultEdgeLBPoolCpus = float64(0.1) // DefaultEdgeLBPoolCreationStrategy is the strategy to use for creating an EdgeLB pool when a value is not provided. DefaultEdgeLBPoolCreationStrategy = EdgeLBPoolCreationStrategyIfNotPresent // DefaultEdgeLBPoolMemory is the amount of memory to request for an EdgeLB pool when a value is not provided. DefaultEdgeLBPoolMemory = int32(128) // DefaultEdgeLBPoolHTTPPort is the HTTP port to use as the frontend bind port for an EdgeLB pool used to provision an Ingress resource when a value is not provided. DefaultEdgeLBPoolHTTPPort = int32(80) // DefaultEdgeLBPoolHTTPSPort is the HTTPS port to use as the frontend bind port for an EdgeLB pool used to provision an Ingress resource when a value is not provided. DefaultEdgeLBPoolHTTPSPort = int32(443) // DefaultEdgeLBPoolRole is the role to use for an EdgeLB pool when a value is not provided. DefaultEdgeLBPoolRole = constants.EdgeLBRolePublic // DefaultEdgeLBPoolSize is the size to use for an EdgeLB pool when a value is not provided. DefaultEdgeLBPoolSize = int(1) )
var ( // EdgeLBPoolCreationStrategyIfNotPresent denotes the strategy that creates an EdgeLB pool whenever a pool with the same name doesn't already exist. EdgeLBPoolCreationStrategyIfNotPresent = EdgeLBPoolCreationStrategy("IfNotPresent") // EdgeLBPoolCreationStrategyNever denotes the strategy that never creates an EdgeLB pool, expecting it to have been created out-of-band. EdgeLBPoolCreationStrategyNever = EdgeLBPoolCreationStrategy("Never") // EdgeLBPoolCreationStrategyOnce denotes the strategy that creates an EdgeLB pool only if a pool for a given Ingress/Service resource has never been created. EdgeLBPoolCreationStrategyOnce = EdgeLBPoolCreationStrategy("Once") )
Functions ¶
func IsIngressTLSEnabled ¶
func IsIngressTLSEnabled(ingress *extsv1beta1.Ingress) bool
IsIngressTLSEnabled checks if ingress has TLS spec defined.
func SetEdgeLBManager ¶
func SetEdgeLBManager(m edgelbmanager.EdgeLBManager)
SetEdgeLBManager instructs the Translator API to use the specified instance of the EdgeLB manager whenever access to EdgeLB is required.
func SetIngressEdgeLBPoolSpec ¶
func SetIngressEdgeLBPoolSpec(ingress *extsv1beta1.Ingress, obj *IngressEdgeLBPoolSpec) error
SetIngressEdgeLBPoolSpec updates the provided Ingress resource with the provided EdgeLB pool specification.
func SetServiceEdgeLBPoolSpec ¶
func SetServiceEdgeLBPoolSpec(service *corev1.Service, obj *ServiceEdgeLBPoolSpec) error
SetServiceEdgeLBPoolSpec updates the provided Service resource with the provided EdgeLB pool specification.
Types ¶
type BaseEdgeLBPoolSpec ¶
type BaseEdgeLBPoolSpec struct { // CloudProviderConfiguration is the raw, JSON-encoded configuration to set on the target EdgeLB pool's ".cloudProvider" field. CloudProviderConfiguration *string `yaml:"cloudProviderConfiguration"` // Constraints is a Marathon style constraints for load balancer instance placement. Constraints *string `yaml:"constraints"` // CPUs is the amount of CPU to request for the target EdgeLB pool. CPUs *float64 `yaml:"cpus"` // Memory is the amount of memory to request for the target EdgeLB pool. Memory *int32 `yaml:"memory"` // Name is the name of the target EdgeLB pool. Name *string `yaml:"name"` // Network is the name of the DC/OS virtual network where to place the target EdgeLB pool. Network *string `yaml:"network"` // Role is the role to request for the target EdgeLB pool. Role *string `yaml:"role"` // Size is the size to request for the target EdgeLB pool. Size *int32 `yaml:"size"` // Strategies groups together strategies used to customize the management of the target EdgeLB pool. Strategies *EdgeLBPoolManagementStrategies `yaml:"strategies"` }
BaseEdgeLBPoolSpec contains EdgeLB pool configuration properties that are common to both Service and Ingress resources.
func (*BaseEdgeLBPoolSpec) Validate ¶
func (o *BaseEdgeLBPoolSpec) Validate() error
Validate checks whether the current object is valid.
func (*BaseEdgeLBPoolSpec) ValidateTransition ¶
func (o *BaseEdgeLBPoolSpec) ValidateTransition(previous *BaseEdgeLBPoolSpec) error
ValidateTransition validates the transition between "previous" and the current object.
type EdgeLBPoolCreationStrategy ¶
type EdgeLBPoolCreationStrategy string
EdgeLBPoolCreationStrategy represents a strategy used to create EdgeLB pools.
func (*EdgeLBPoolCreationStrategy) UnmarshalYAML ¶
func (s *EdgeLBPoolCreationStrategy) UnmarshalYAML(fn func(interface{}) error) error
UnmarshalYAML unmarshals the underlying value as an "EdgeLBPoolCreationStrategy" object.
type EdgeLBPoolManagementStrategies ¶
type EdgeLBPoolManagementStrategies struct {
Creation *EdgeLBPoolCreationStrategy `yaml:"creation"`
}
EdgeLBPoolManagementStrategies groups together strategies used to customize the management of EdgeLB pools.
type IngressEdgeLBPoolFrontendsSpec ¶
type IngressEdgeLBPoolFrontendsSpec struct { // HTTP contains the specification of the HTTP EdgeLB frontend associated with the Ingress resource. HTTP *IngressEdgeLBPoolHTTPFrontendSpec `yaml:"http"` HTTPS *IngressEdgeLBPoolHTTPSFrontendSpec `yaml:"https"` }
IngressEdgeLBPoolFrontendsSpec contains the specification of the EdgeLB frontends associated with a given Ingress resource.
type IngressEdgeLBPoolHTTPFrontendSpec ¶
type IngressEdgeLBPoolHTTPFrontendSpec struct { // Mode describes if this frontend is disabled, enabled or in redirect mode. Mode *string `yaml:"mode"` // Port is the port to use as the frontend bind port for HTTP traffic. Port *int32 `yaml:"port"` }
IngressEdgeLBPoolHTTPFrontendSpec contains the specification of the HTTP EdgeLB frontend associated with a given Ingress resource.
type IngressEdgeLBPoolHTTPSFrontendSpec ¶
type IngressEdgeLBPoolHTTPSFrontendSpec struct { // Port is the port to use as the frontend bind port for HTTP traffic. Port *int32 `yaml:"port"` }
IngressEdgeLBPoolHTTPSFrontendSpec contains the specification of the HTTP EdgeLB frontend associated with a given Ingress resource.
type IngressEdgeLBPoolSpec ¶
type IngressEdgeLBPoolSpec struct { BaseEdgeLBPoolSpec `yaml:",inline"` // Frontends contains the specification of the EdgeLB frontends associated with the Ingress resource. Frontends *IngressEdgeLBPoolFrontendsSpec `yaml:"frontends"` }
IngressEdgeLBPoolSpec contains the specification of the target EdgeLB pool for a given Ingress resource.
func GetIngressEdgeLBPoolSpec ¶
func GetIngressEdgeLBPoolSpec(ingress *extsv1beta1.Ingress) (*IngressEdgeLBPoolSpec, error)
GetIngressEdgeLBPoolSpec attempts to parse the contents of the "kubernetes.dcos.io/dklb-config" annotation of the specified Ingress resource as the specification of the target EdgeLB pool. Parsing is strict in the sense that any unrecognized fields will originate a parsing error. If no value has been provided for the "kubernetes.dcos.io/dklb-config" annotation, a default EdgeLB pool specification object is returned.
func NewDefaultIngressEdgeLBPoolSpecForIngress ¶
func NewDefaultIngressEdgeLBPoolSpecForIngress(ingress *extsv1beta1.Ingress) *IngressEdgeLBPoolSpec
NewDefaultIngressEdgeLBPoolSpecForIngress returns a new EdgeLB pool specification for the provided Ingress resource that uses default values.
func (*IngressEdgeLBPoolSpec) SetDefaults ¶
func (o *IngressEdgeLBPoolSpec) SetDefaults(ingress *extsv1beta1.Ingress)
SetDefaults sets default values whenever a value hasn't been specifically provided.
func (*IngressEdgeLBPoolSpec) Validate ¶
func (o *IngressEdgeLBPoolSpec) Validate(obj *extsv1beta1.Ingress) error
Validate checks whether the current object is valid.
func (*IngressEdgeLBPoolSpec) ValidateTransition ¶
func (o *IngressEdgeLBPoolSpec) ValidateTransition(previous *IngressEdgeLBPoolSpec) error
ValidateTransition validates the transition between "previous" and the current object.
type ServiceEdgeLBPoolFrontendSpec ¶
type ServiceEdgeLBPoolFrontendSpec struct { // Port is the frontend bind port to use when exposing the current service port. Port *int32 `yaml:"port"` // ServicePort is the current service port. ServicePort int32 `yaml:"servicePort"` }
ServiceEdgeLBPoolFrontendSpec contains the specification of a single EdgeLB frontend associated with a given Service resource.
type ServiceEdgeLBPoolSpec ¶
type ServiceEdgeLBPoolSpec struct { BaseEdgeLBPoolSpec `yaml:",inline"` // Frontends contains the specification of the EdgeLB frontends associated with the Service resource. Frontends []ServiceEdgeLBPoolFrontendSpec `yaml:"frontends"` }
ServiceEdgeLBPoolSpec contains the specification of the target EdgeLB pool for a given Service resource.
func GetServiceEdgeLBPoolSpec ¶
func GetServiceEdgeLBPoolSpec(service *corev1.Service) (*ServiceEdgeLBPoolSpec, error)
GetServiceEdgeLBPoolSpec attempts to parse the contents of the "kubernetes.dcos.io/dklb-config" annotation of the specified Service resource as the specification of the target EdgeLB pool. Parsing is strict in the sense that any unrecognized fields will originate a parsing error. If no value has been provided for the "kubernetes.dcos.io/dklb-config" annotation, a default EdgeLB pool specification object is returned.
func NewDefaultServiceEdgeLBPoolSpecForService ¶
func NewDefaultServiceEdgeLBPoolSpecForService(service *corev1.Service) *ServiceEdgeLBPoolSpec
NewDefaultServiceEdgeLBPoolSpecForService returns a new EdgeLB pool specification for the provided Service resource that uses default values.
func (*ServiceEdgeLBPoolSpec) SetDefaults ¶
func (o *ServiceEdgeLBPoolSpec) SetDefaults(service *corev1.Service)
SetDefaults sets default values whenever a value hasn't been specifically provided.
func (*ServiceEdgeLBPoolSpec) Validate ¶
func (o *ServiceEdgeLBPoolSpec) Validate(svc *corev1.Service) error
Validate checks whether the current object is valid.
func (*ServiceEdgeLBPoolSpec) ValidateTransition ¶
func (o *ServiceEdgeLBPoolSpec) ValidateTransition(previous *ServiceEdgeLBPoolSpec) error
ValidateTransition validates the transition between "previous" and the current object.