ingress

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

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) 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 method to perform initializations
	Init(ctx context.Context, cmw configmap.Watcher, impl *controller.Impl)

	// set tracker
	SetTracker(tracker.Interface)
}

ReconcilerInitializer creates an Ingress Reconciler and exposes methods to perform initializations

type StatusManager

type StatusManager interface {
	IsReady(vs *v1alpha3.VirtualService) (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,
	podLister corev1listers.PodLister,
	transportFactory func() http.RoundTripper,
	readyCallback func(*v1alpha3.VirtualService)) *StatusProber

NewStatusProber creates a new instance of StatusProber

func (*StatusProber) Cancel

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

Cancel cancels probing of the provided VirtualService.

func (*StatusProber) IsReady

func (m *StatusProber) IsReady(vs *v1alpha3.VirtualService) (bool, error)

IsReady checks if the provided VirtualService is ready, i.e. the Envoy pods serving the VirtualService have all been updated. This function is designed to be used by the ClusterIngress controller, i.e. it will be called in the order of reconciliation. This means that if IsReady is called on a VirtualService, this VirtualService 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 ClusterIngress controller depends.
Package config holds the typed objects that define the schemas for assorted ConfigMap objects on which the ClusterIngress controller depends.
Package resources holds simple functions for synthesizing child resources from an Ingress resource and any relevant ClusterIngress controller configuration.
Package resources holds simple functions for synthesizing child resources from an Ingress resource and any relevant ClusterIngress 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