service

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func New

func New(k store.K8s, path *store.IngressPath, certs certs.Certificates, tcpService bool, annList ...map[string]string) (*Service, error)

New returns a Service instance to handle the k8s IngressPath resource given in params. An error will be returned if there is no k8s Service resource corresponding to the service description in IngressPath.

func NewLocal

func NewLocal(k store.K8s, path *store.IngressPath, backend *models.Backend, annList ...map[string]string) (*Service, error)

NewLocal returns a Service instance to handle the k8s IngressPath resource given in params.

func (*Service) GetBackendName

func (s *Service) GetBackendName() (name string, err error)

GetBackendName checks if servicePort provided in IngressPath exists and construct corresponding backend name Backend name is in format "ServiceNS_ServiceName_PortName"

func (*Service) GetResource

func (s *Service) GetResource() *store.Service

func (*Service) HandleBackend

func (s *Service) HandleBackend(store store.K8s, client api.HAProxyClient, a annotations.Annotations) (reload bool, err error)

HandleBackend processes a Service and creates/updates corresponding backend configuration in HAProxy

func (*Service) HandleHAProxySrvs

func (s *Service) HandleHAProxySrvs(k8s store.K8s, client api.HAProxyClient) (reload bool)

HandleHAProxySrvs handles the haproxy backend servers of the corresponding IngressPath (service + port)

func (*Service) SetDefaultBackend

func (s *Service) SetDefaultBackend(k store.K8s, h haproxy.HAProxy, frontends []string, a annotations.Annotations) (reload bool, err error)

SetDefaultBackend configures the default service in kubernetes ingress resource as haproxy default backend of the frontends in params.

Jump to

Keyboard shortcuts

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