controller

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLeaderElector

func NewLeaderElector(client kubernetes.Interface, callbacks leaderelection.LeaderCallbacks, namespace string) (*leaderelection.LeaderElector, error)

NewLeaderElector creates a new LeaderElection and returns the Elector.

Types

type LoadBalancerController

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

LoadBalancerController watches Kubernetes API and reconfigures NGINX via NginxController when needed

func NewLoadBalancerController

func NewLoadBalancerController(input NewLoadBalancerControllerInput) *LoadBalancerController

NewLoadBalancerController creates a controller

func (*LoadBalancerController) AddConfigMapHandler

func (lbc *LoadBalancerController) AddConfigMapHandler(handlers cache.ResourceEventHandlerFuncs, namespace string)

AddConfigMapHandler adds the handler for config maps to the controller

func (*LoadBalancerController) AddEndpointHandler

func (lbc *LoadBalancerController) AddEndpointHandler(handlers cache.ResourceEventHandlerFuncs)

AddEndpointHandler adds the handler for endpoints to the controller

func (*LoadBalancerController) AddIngressHandler

func (lbc *LoadBalancerController) AddIngressHandler(handlers cache.ResourceEventHandlerFuncs)

AddIngressHandler adds the handler for ingresses to the controller

func (*LoadBalancerController) AddLeaderHandler

func (lbc *LoadBalancerController) AddLeaderHandler(leaderHandler leaderelection.LeaderCallbacks)

AddLeaderHandler adds the handler for leader election to the controller

func (*LoadBalancerController) AddSecretHandler

func (lbc *LoadBalancerController) AddSecretHandler(handlers cache.ResourceEventHandlerFuncs)

AddSecretHandler adds the handler for secrets to the controller

func (*LoadBalancerController) AddServiceHandler

func (lbc *LoadBalancerController) AddServiceHandler(handlers cache.ResourceEventHandlerFuncs)

AddServiceHandler adds the handler for services to the controller

func (*LoadBalancerController) AddSyncQueue

func (lbc *LoadBalancerController) AddSyncQueue(item interface{})

AddSyncQueue enqueues the provided item on the sync queue

func (*LoadBalancerController) EnqueueIngressForService

func (lbc *LoadBalancerController) EnqueueIngressForService(svc *api_v1.Service)

EnqueueIngressForService enqueues the ingress for the given service

func (*LoadBalancerController) FindMasterForMinion

func (lbc *LoadBalancerController) FindMasterForMinion(minion *extensions.Ingress) (*extensions.Ingress, error)

FindMasterForMinion returns a master for a given minion

func (*LoadBalancerController) GetDefaultServerSecret

func (lbc *LoadBalancerController) GetDefaultServerSecret() string

GetDefaultServerSecret returns the default server secret

func (*LoadBalancerController) GetIngressClassKey

func (lbc *LoadBalancerController) GetIngressClassKey() string

GetIngressClassKey returns the ingress class key

func (*LoadBalancerController) GetManagedIngresses

func (lbc *LoadBalancerController) GetManagedIngresses() ([]extensions.Ingress, map[string]*nginx.MergeableIngresses)

GetManagedIngresses gets Ingress resources that the IC is currently responsible for

func (*LoadBalancerController) IsExternalServiceForStatus

func (lbc *LoadBalancerController) IsExternalServiceForStatus(svc *api_v1.Service) bool

IsExternalServiceForStatus matches the service specified by the external-service arg

func (*LoadBalancerController) IsNginxIngress

func (lbc *LoadBalancerController) IsNginxIngress(ing *extensions.Ingress) bool

IsNginxIngress checks if resource ingress class annotation (if exists) is matching with ingress controller class If annotation is absent and use-ingress-class-only enabled - ingress resource would ignore

func (*LoadBalancerController) Run

func (lbc *LoadBalancerController) Run()

Run starts the loadbalancer controller

func (*LoadBalancerController) Stop

func (lbc *LoadBalancerController) Stop()

Stop shutdowns the load balancer controller

func (*LoadBalancerController) UpdateManagedAndMergeableIngresses

func (lbc *LoadBalancerController) UpdateManagedAndMergeableIngresses(ingresses []v1beta1.Ingress, mergeableIngresses map[string]*nginx.MergeableIngresses) error

UpdateManagedAndMergeableIngresses invokes the UpdateManagedAndMergeableIngresses method on the Status Updater

func (*LoadBalancerController) ValidateSecret

func (lbc *LoadBalancerController) ValidateSecret(secret *api_v1.Secret) error

ValidateSecret validates that the secret follows the TLS Secret format. For NGINX Plus, it also checks if the secret follows the JWK Secret format.

func (*LoadBalancerController) WatchNginxConfigMaps

func (lbc *LoadBalancerController) WatchNginxConfigMaps()

WatchNginxConfigMaps sets the controller to watch config map changes

type NewLoadBalancerControllerInput

type NewLoadBalancerControllerInput struct {
	KubeClient              kubernetes.Interface
	ResyncPeriod            time.Duration
	Namespace               string
	NginxConfigurator       *nginx.Configurator
	DefaultServerSecret     string
	IsNginxPlus             bool
	IngressClass            string
	UseIngressClassOnly     bool
	ExternalServiceName     string
	ControllerNamespace     string
	ReportIngressStatus     bool
	IsLeaderElectionEnabled bool
}

NewLoadBalancerControllerInput holds the input needed to call NewLoadBalancerController.

type StatusUpdater

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

StatusUpdater reports Ingress status information via the kubernetes API, primarily the IP or host of the LoadBalancer Service exposing the Ingress Controller, or an external IP specified in the ConfigMap.

func (*StatusUpdater) BulkUpdateIngressStatus

func (su *StatusUpdater) BulkUpdateIngressStatus(ings []v1beta1.Ingress) error

BulkUpdateIngressStatus sets the status field on the selected Ingresses, specifically the External IP field.

func (*StatusUpdater) ClearIngressStatus

func (su *StatusUpdater) ClearIngressStatus(ing v1beta1.Ingress) error

ClearIngressStatus clears the Ingress status.

func (*StatusUpdater) ClearStatusFromExternalService

func (su *StatusUpdater) ClearStatusFromExternalService()

ClearStatusFromExternalService clears the saved status from the External Service

func (*StatusUpdater) SaveStatusFromExternalService

func (su *StatusUpdater) SaveStatusFromExternalService(svc *api_v1.Service)

SaveStatusFromExternalService saves the external IP or address from the service. This method does not update ingress status - UpdateIngressStatus must be called separately.

func (*StatusUpdater) SaveStatusFromExternalStatus

func (su *StatusUpdater) SaveStatusFromExternalStatus(externalStatusAddress string)

SaveStatusFromExternalStatus saves the status from a string. For use with the external-status-address ConfigMap setting. This method does not update ingress status - StatusUpdater.UpdateIngressStatus must be called separately.

func (*StatusUpdater) UpdateIngressStatus

func (su *StatusUpdater) UpdateIngressStatus(ing v1beta1.Ingress) error

UpdateIngressStatus updates the status on the selected Ingress.

func (*StatusUpdater) UpdateManagedAndMergeableIngresses

func (su *StatusUpdater) UpdateManagedAndMergeableIngresses(managedIngresses []v1beta1.Ingress, mergableIngExes map[string]*nginx.MergeableIngresses) error

UpdateManagedAndMergeableIngresses handles the full return format of LoadBalancerController.getManagedIngresses

func (*StatusUpdater) UpdateMergableIngresses

func (su *StatusUpdater) UpdateMergableIngresses(mergableIngresses *nginx.MergeableIngresses) error

UpdateMergableIngresses is a convience passthru to update Ingresses with our nginx.MergableIngresses type

Jump to

Keyboard shortcuts

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