ingress

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Overview

Package ingress implements a kubernetes controller which tracks Ingress resource and reconcile VirtualService as its child resource.

Index

Constants

View Source
const (

	// NotReconciledReason specifies the reason that ingress reconciliation has failed
	NotReconciledReason = "ReconcileIngressFailed"

	// NotReconciledMessage indicates the message that ingress reconciliation has failed
	NotReconciledMessage = "Ingress reconciliation failed"
)

Variables

This section is empty.

Functions

func CreateController

func CreateController(ctx context.Context, cmw configmap.Watcher, workQueueName string,
	initializerCtor InitializerConstructor) *controller.Impl

CreateController creates an Ingress Controller

func NewController

func NewController(
	ctx context.Context,
	cmw configmap.Watcher,
) *controller.Impl

NewController works as a constructor for Ingress Controller

func SetupSecretTracker

func SetupSecretTracker(ctx context.Context, init ReconcilerInitializer, impl *controller.Impl)

SetupSecretTracker initializes Secret Tracker

Types

type BaseIngressReconciler

type BaseIngressReconciler struct {
	*reconciler.Base

	// listers index properties about resources
	VirtualServiceLister istiolisters.VirtualServiceLister
	GatewayLister        istiolisters.GatewayLister
	SecretLister         corev1listers.SecretLister
	ConfigStore          reconciler.ConfigStore

	Tracker   tracker.Interface
	Finalizer string

	StatusManager StatusManager
}

BaseIngressReconciler is the conmon struct for InjectReconciles

func NewBaseIngressReconciler

func NewBaseIngressReconciler(ctx context.Context, agentName, finalizer string, cmw configmap.Watcher) *BaseIngressReconciler

NewBaseIngressReconciler creates a new BaseIngressReconciler

func (*BaseIngressReconciler) GetKubeClient added in v0.9.0

func (r *BaseIngressReconciler) GetKubeClient() kubernetes.Interface

GetKubeClient returns the client to access k8s resources.

func (*BaseIngressReconciler) GetSecretLister added in v0.9.0

func (r *BaseIngressReconciler) GetSecretLister() corev1listers.SecretLister

GetSecretLister returns the lister for Secret.

func (*BaseIngressReconciler) GetSharedClient

func (r *BaseIngressReconciler) GetSharedClient() sharedclientset.Interface

GetSharedClient returns the client to access shared resources.

func (*BaseIngressReconciler) GetVirtualServiceLister

func (r *BaseIngressReconciler) GetVirtualServiceLister() istiolisters.VirtualServiceLister

GetVirtualServiceLister returns the lister for VirtualService.

func (*BaseIngressReconciler) ReconcileIngress

func (r *BaseIngressReconciler) ReconcileIngress(ctx context.Context, ra ReconcilerAccessor, key string) error

ReconcileIngress retrieves Ingress by key and performs reconciliation

type InitializerConstructor

type InitializerConstructor func(ctx context.Context, cmw configmap.Watcher) ReconcilerInitializer

InitializerConstructor constructor function of ReconcilerInitializer

type Reconciler

type Reconciler struct {
	*BaseIngressReconciler
	// contains filtered or unexported fields
}

func (*Reconciler) GetIngress

func (r *Reconciler) GetIngress(ns, name string) (v1alpha1.IngressAccessor, error)

GetIngress returns an Ingress object of type IngressAccesso

func (*Reconciler) Init

func (r *Reconciler) Init(ctx context.Context, cmw configmap.Watcher, impl *controller.Impl)

Init method performs initializations to ingress reconciler

func (*Reconciler) PatchIngress

func (r *Reconciler) PatchIngress(ns, name string, pt types.PatchType, data []byte, subresources ...string) (v1alpha1.IngressAccessor, error)

PatchIngress invokes APIs tp Patch an Ingress

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, key string) error

Reconcile compares the actual state with the desired, and attempts to converge the two. It then updates the Status block of the Ingress resource with the current status of the resource.

func (*Reconciler) SetTracker

func (r *Reconciler) SetTracker(tracker tracker.Interface)

SetTracker assigns the Tracker field

func (*Reconciler) UpdateIngress

UpdateIngress invokes APIs tp Update an Ingress

func (*Reconciler) UpdateIngressStatus

func (r *Reconciler) UpdateIngressStatus(ia v1alpha1.IngressAccessor) (v1alpha1.IngressAccessor, error)

UpdateIngressStatus invokes APIs tp Update an IngressStatus

type ReconcilerAccessor

type ReconcilerAccessor interface {
	GetIngress(ns, name string) (v1alpha1.IngressAccessor, error)
	PatchIngress(ns, name string, pt types.PatchType, data []byte, subresources ...string) (v1alpha1.IngressAccessor, error)
	UpdateIngress(v1alpha1.IngressAccessor) (v1alpha1.IngressAccessor, error)
	UpdateIngressStatus(v1alpha1.IngressAccessor) (v1alpha1.IngressAccessor, error)
}

ReconcilerAccessor defines functions that access reconciler data specific to Ingress types

type ReconcilerInitializer

type ReconcilerInitializer interface {
	controller.Reconciler

	// Init initializes the reconciler.
	Init(ctx context.Context, cmw configmap.Watcher, impl *controller.Impl)

	// Sets tracker.
	SetTracker(tracker.Interface)
}

ReconcilerInitializer creates an Ingress Reconciler and exposes methods to perform initializations.

type StatusManager

type StatusManager interface {
	IsReady(ia v1alpha1.IngressAccessor, gw map[v1alpha1.IngressVisibility]sets.String) (bool, error)
}

StatusManager provides a way to check if a VirtualService is ready

type StatusProber

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

StatusProber provides a way to check if a VirtualService is ready by probing the Envoy pods handling that VirtualService.

func NewStatusProber

func NewStatusProber(
	logger *zap.SugaredLogger,
	gatewayLister istiolisters.GatewayLister,
	endpointsLister corev1listers.EndpointsLister,
	serviceLister corev1listers.ServiceLister,
	readyCallback func(v1alpha1.IngressAccessor)) *StatusProber

NewStatusProber creates a new instance of StatusProber

func (*StatusProber) CancelPodProbing added in v0.10.0

func (m *StatusProber) CancelPodProbing(pod *corev1.Pod)

CancelPodProbing cancels probing of the provided Pod IP.

func (*StatusProber) CancelVirtualServiceProbing added in v0.10.0

func (m *StatusProber) CancelVirtualServiceProbing(vs *v1alpha3.VirtualService)

CancelVirtualServiceProbing cancels probing of the provided VirtualService.

func (*StatusProber) IsReady

IsReady checks if the provided IngressAccessor is ready, i.e. the Envoy pods serving the IngressAccessor have all been updated. This function is designed to be used by the Ingress controller, i.e. it will be called in the order of reconciliation. This means that if IsReady is called on an IngressAccessor, this IngressAccessor is the latest known version and therefore anything related to older versions can be ignored. Also, it means that IsReady is not called concurrently.

func (*StatusProber) Start

func (m *StatusProber) Start(done <-chan struct{})

Start starts the StatusManager background operations

Directories

Path Synopsis
Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Ingress controller depends.
Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the Ingress controller depends.
Package resources holds simple functions for synthesizing child resources from an Ingress resource and any relevant Ingress controller configuration.
Package resources holds simple functions for synthesizing child resources from an Ingress resource and any relevant Ingress controller configuration.
names
Package names holds simple functions for synthesizing resource names.
Package names holds simple functions for synthesizing resource names.

Jump to

Keyboard shortcuts

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