controller

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONTROLLER_CLASS = "haproxy.org/ingress-controller"
	// Configmaps
	Main        = "main"
	TCPServices = "tcpservices"
	Errorfiles  = "errorfiles"
	//sections
	FrontendHTTP      = "http"
	FrontendHTTPS     = "https"
	FrontendSSL       = "ssl"
	SSLDefaultBaceknd = "ssl"
	//Status
	ADDED    = store.ADDED
	DELETED  = store.DELETED
	ERROR    = store.ERROR
	EMPTY    = store.EMPTY
	MODIFIED = store.MODIFIED
	// MapFiles
	SNI         = "sni"
	HOST        = "host"
	PATH_EXACT  = "path-exact"
	PATH_PREFIX = "path-prefix"
)

nolint

View Source
const (
	TRACE_API = false
)

TRACE_API outputs all k8s events received from k8s API nolint golint

Variables

View Source
var (
	HAProxyBinary        string
	HAProxyCFG           string
	HAProxyCfgDir        string
	HAProxyCertDir       string
	HAProxyFtCertDir     string
	HAProxyBdCertDir     string
	HAProxyCaCertDir     string
	HAProxyStateDir      string
	HAProxyMapDir        string
	HAProxyErrFileDir    string
	HAProxyRuntimeSocket string
	HAProxyPIDFile       string
	TransactionDir       string
)
View Source
var ErrIgnored = errors.New("Ignored resource") //nolint golint

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	MapFiles       haproxy.Maps
	HAProxyRules   *haproxy.Rules
	Certificates   *haproxy.Certificates
	IngressRoutes  ingress.Routes
	HTTPS          bool
	SSLPassthrough bool
}

func (*Configuration) Clean

func (c *Configuration) Clean()

Clean cleans all the statuses of various data that was changed deletes them completely or just resets them if needed

func (*Configuration) HAProxyRulesInit added in v1.5.0

func (c *Configuration) HAProxyRulesInit() error

func (*Configuration) Init

func (c *Configuration) Init()

Init initialize configuration

type ErrorFile added in v1.5.0

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

func (ErrorFile) Update added in v1.5.0

func (e ErrorFile) Update(k store.K8s, cfg *Configuration, api api.HAProxyClient) (reload bool, err error)

type HAProxyController

type HAProxyController struct {
	Store          store.K8s
	PublishService *store.Service
	IngressClass   string

	Client api.HAProxyClient

	UpdateHandlers []UpdateHandler
	// contains filtered or unexported fields
}

HAProxyController is ingress controller

func (*HAProxyController) Start

func (c *HAProxyController) Start(osArgs utils.OSArgs)

Start initializes and runs HAProxyController

func (*HAProxyController) Stop added in v1.5.1

func (c *HAProxyController) Stop()

Stop handles shutting down HAProxyController

func (*HAProxyController) SyncData

func (c *HAProxyController) SyncData(chConfigMapReceivedAndProcessed chan bool)

SyncData gets all kubernetes changes, aggregates them and apply to HAProxy. All the changes must come through this function

type HTTPS added in v1.5.0

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

func (HTTPS) Update added in v1.5.0

func (h HTTPS) Update(k store.K8s, cfg *Configuration, api api.HAProxyClient) (reload bool, err error)

type K8s

type K8s struct {
	API    *kubernetes.Clientset
	Logger utils.Logger
}

K8s is structure with all data required to synchronize with k8s

func GetKubernetesClient

func GetKubernetesClient() (*K8s, error)

GetKubernetesClient returns new client that communicates with k8s

func GetRemoteKubernetesClient

func GetRemoteKubernetesClient(kubeconfig string) (*K8s, error)

GetRemoteKubernetesClient returns new client that communicates with k8s

func (*K8s) EventsConfigfMaps

func (k *K8s) EventsConfigfMaps(channel chan *store.ConfigMap, stop chan struct{}, informer cache.SharedIndexInformer)

func (*K8s) EventsEndpoints

func (k *K8s) EventsEndpoints(channel chan *store.Endpoints, stop chan struct{}, informer cache.SharedIndexInformer)

func (*K8s) EventsIngressClass added in v1.5.0

func (k *K8s) EventsIngressClass(channel chan *store.IngressClass, stop chan struct{}, informer cache.SharedIndexInformer)

func (*K8s) EventsIngresses

func (k *K8s) EventsIngresses(channel chan *store.Ingress, stop chan struct{}, informer cache.SharedIndexInformer)

func (*K8s) EventsNamespaces

func (k *K8s) EventsNamespaces(channel chan *store.Namespace, stop chan struct{}, informer cache.SharedIndexInformer)

func (*K8s) EventsSecrets

func (k *K8s) EventsSecrets(channel chan *store.Secret, stop chan struct{}, informer cache.SharedIndexInformer)

func (*K8s) EventsServices

func (k *K8s) EventsServices(channel chan *store.Service, stop chan struct{}, informer cache.SharedIndexInformer, publishSvc *store.Service)

func (*K8s) GetPublishServiceAddresses

func (k *K8s) GetPublishServiceAddresses(service *corev1.Service, publishSvc *store.Service)

func (*K8s) IsNetworkingV1ApiSupported added in v1.5.0

func (k *K8s) IsNetworkingV1ApiSupported() bool

func (*K8s) IsNetworkingV1Beta1ApiSupported added in v1.5.0

func (k *K8s) IsNetworkingV1Beta1ApiSupported() bool

func (*K8s) UpdateIngressStatus

func (k *K8s) UpdateIngressStatus(ingress *store.Ingress, publishSvc *store.Service) (err error)

type Mode

type Mode string
const (
	HTTP Mode = "http"
	TCP  Mode = "tcp"
)

func (Mode) MarshalFlag

func (n Mode) MarshalFlag() (string, error)

MarshalFlag Marshals flag

func (*Mode) UnmarshalFlag

func (n *Mode) UnmarshalFlag(value string) error

UnmarshalFlag Unmarshal flag

type ProxyProtocol added in v1.5.0

type ProxyProtocol struct{}

func (ProxyProtocol) Update added in v1.5.0

func (p ProxyProtocol) Update(k store.K8s, cfg *Configuration, api api.HAProxyClient) (reload bool, err error)

type RefreshHandler added in v1.5.0

type RefreshHandler struct{}

func (RefreshHandler) Update added in v1.5.0

func (h RefreshHandler) Update(k store.K8s, cfg *Configuration, api api.HAProxyClient) (reload bool, err error)

type SyncDataEvent

type SyncDataEvent struct {
	SyncType
	Namespace string
	Data      interface{}
	// contains filtered or unexported fields
}

SyncDataEvent represents converted k8s received message

type SyncType

type SyncType string

SyncType represents type of k8s received message

const (
	COMMAND       SyncType = "COMMAND"
	CONFIGMAP     SyncType = "CONFIGMAP"
	ENDPOINTS     SyncType = "ENDPOINTS"
	INGRESS       SyncType = "INGRESS"
	INGRESS_CLASS SyncType = "INGRESS_CLASS"
	NAMESPACE     SyncType = "NAMESPACE"
	SERVICE       SyncType = "SERVICE"
	SECRET        SyncType = "SECRET"
)

SyncType values nolint

type TCPHandler added in v1.5.0

type TCPHandler struct {
}

func (TCPHandler) Update added in v1.5.0

func (t TCPHandler) Update(k store.K8s, cfg *Configuration, api api.HAProxyClient) (reload bool, err error)

type UpdateHandler added in v1.5.0

type UpdateHandler interface {
	Update(k store.K8s, cfg *Configuration, api api.HAProxyClient) (reload bool, err error)
}

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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