controller

package
v1.6.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CONTROLLER_CLASS = "haproxy.org/ingress-controller"
	// SyncType values
	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"
	// Modes
	HTTP Mode = "http"
	TCP  Mode = "tcp"
	// Status
	ADDED    = store.ADDED
	DELETED  = store.DELETED
	ERROR    = store.ERROR
	EMPTY    = store.EMPTY
	MODIFIED = store.MODIFIED
)
View Source
const (
	TRACE_API = false
)

TRACE_API outputs all k8s events received from k8s API nolint golint

Variables

View Source
var ErrIgnored = errors.New("ignored resource")

Functions

This section is empty.

Types

type HAProxyController

type HAProxyController struct {
	Cfg            config.ControllerCfg
	Client         api.HAProxyClient
	OSArgs         utils.OSArgs
	Store          store.K8s
	PublishService *store.Service
	AuxCfgModTime  int64
	// contains filtered or unexported fields
}

HAProxyController is ingress controller

func (*HAProxyController) Start

func (c *HAProxyController) Start()

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()

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

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 SyncDataEvent, stop chan struct{}, informer cache.SharedIndexInformer)

func (*K8s) EventsEndpoints

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

func (*K8s) EventsIngressClass added in v1.5.0

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

func (*K8s) EventsIngresses

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

func (*K8s) EventsNamespaces

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

func (*K8s) EventsSecrets

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

func (*K8s) EventsServices

func (k *K8s) EventsServices(channel chan SyncDataEvent, 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

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

type UpdateHandler added in v1.5.0

type UpdateHandler interface {
	Update(k store.K8s, cfg *config.ControllerCfg, 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