controller

package
v1.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Ingress resource
	Ingress = iota
	// IngressMinion resource, which is a Minion Ingress resource
	IngressMinion
	// Endpoints resource
	Endpoints
	// ConfigMap resource
	ConfigMap
	// Secret resource
	Secret
	// Service resource
	Service
)

Variables

This section is empty.

Functions

func FindPort added in v0.9.0

func FindPort(pod *api_v1.Pod, svcPort *api_v1.ServicePort) (int32, error)

FindPort locates the container port for the given pod and portName. If the targetPort is a number, use that. If the targetPort is a string, look that string up in all named ports in all containers in the target pod. If no match is found, fail.

func NewLeaderElector added in v1.3.0

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

NewLeaderElector creates a new LeaderElection and returns the Elector.

func NewTaskQueue

func NewTaskQueue(syncFn func(Task)) *taskQueue

NewTaskQueue creates a new task queue with the given sync function. The sync function is called for every element inserted into the queue.

func ParseNamespaceName added in v1.0.0

func ParseNamespaceName(value string) (ns string, name string, err error)

ParseNamespaceName parses the string in the <namespace>/<name> format and returns the name and the namespace. It returns an error in case the string does not follow the <namespace>/<name> format.

Types

type Kind added in v1.0.0

type Kind int

Kind represents the kind of the Kubernetes resources of a task

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

func (lbc *LoadBalancerController) Run()

Run starts the loadbalancer controller

func (*LoadBalancerController) Stop added in v1.0.0

func (lbc *LoadBalancerController) Stop()

Stop shutdowns the load balancer controller

func (*LoadBalancerController) ValidateSecret added in v1.0.0

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.

type NewLoadBalancerControllerInput added in v1.3.0

type NewLoadBalancerControllerInput struct {
	KubeClient            kubernetes.Interface
	ResyncPeriod          time.Duration
	Namespace             string
	CNF                   *nginx.Configurator
	NginxConfigMaps       string
	DefaultServerSecret   string
	NginxPlus             bool
	IngressClass          string
	UseIngressClassOnly   bool
	ExternalServiceName   string
	ControllerNamespace   string
	ReportIngressStatus   bool
	LeaderElectionEnabled bool
}

NewLoadBalancerControllerInput holds the input needed to call NewLoadBalancerController.

type StatusUpdater added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

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

ClearIngressStatus clears the Ingress status.

func (*StatusUpdater) ClearStatusFromExternalService added in v1.3.0

func (su *StatusUpdater) ClearStatusFromExternalService()

ClearStatusFromExternalService clears the saved status from the External Service

func (*StatusUpdater) SaveStatusFromExternalService added in v1.3.0

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 added in v1.3.0

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 added in v1.3.0

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

UpdateIngressStatus updates the status on the selected Ingress.

func (*StatusUpdater) UpdateManagedAndMergeableIngresses added in v1.3.0

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 added in v1.3.0

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

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

type StoreToConfigMapLister

type StoreToConfigMapLister struct {
	cache.Store
}

StoreToConfigMapLister makes a Store that lists ConfigMaps

func (*StoreToConfigMapLister) List

func (s *StoreToConfigMapLister) List() (cfgm api_v1.ConfigMapList, err error)

List lists all Ingress' in the store.

type StoreToEndpointLister added in v0.9.0

type StoreToEndpointLister struct {
	cache.Store
}

StoreToEndpointLister makes a Store that lists Endponts

func (*StoreToEndpointLister) GetServiceEndpoints added in v0.9.0

func (s *StoreToEndpointLister) GetServiceEndpoints(svc *api_v1.Service) (ep api_v1.Endpoints, err error)

GetServiceEndpoints returns the endpoints of a service, matched on service name.

type StoreToIngressLister

type StoreToIngressLister struct {
	cache.Store
}

StoreToIngressLister makes a Store that lists Ingress. TODO: Move this to cache/listers post 1.1.

func (*StoreToIngressLister) GetByKeySafe added in v1.3.0

func (s *StoreToIngressLister) GetByKeySafe(key string) (ing *extensions.Ingress, exists bool, err error)

GetByKeySafe calls Store.GetByKeySafe and returns a copy of the ingress so it is safe to modify.

func (*StoreToIngressLister) GetServiceIngress

func (s *StoreToIngressLister) GetServiceIngress(svc *api_v1.Service) (ings []extensions.Ingress, err error)

GetServiceIngress gets all the Ingress' that have rules pointing to a service. Note that this ignores services without the right nodePorts.

func (*StoreToIngressLister) List

func (s *StoreToIngressLister) List() (ing extensions.IngressList, err error)

List lists all Ingress' in the store.

type StoreToSecretLister added in v1.0.0

type StoreToSecretLister struct {
	cache.Store
}

StoreToSecretLister makes a Store that lists Secrets

type Task added in v1.0.0

type Task struct {
	Kind Kind
	Key  string
}

Task is an element of a taskQueue

func NewTask added in v1.0.0

func NewTask(key string, obj interface{}) (Task, error)

NewTask creates a new task

Jump to

Keyboard shortcuts

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