state

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServicePortNotFound     = errors.New("service port not found")
	ErrServicePortNameNotFound = errors.New("port name specified but not found in service")
	ErrInvalidBackendService   = errors.New("backend service does contain neither port name nor port number for path")
	ErrTlsSecretNotFound       = errors.New("referenced secret for tls certificate not found")
	ErrTlsSecretWrongType      = errors.New("referenced secret for tls certificate has wrong type has to be kubernetes.io/tls")
)

Functions

This section is empty.

Types

type BackendPath

type BackendPath struct {
	PathType    *v1Net.PathType
	Path        string
	Namespace   string
	ServiceName string
	ServicePort int32
}

BackendPath is a data struct that holds the properties of a certain service backend

type DomainConfig

type DomainConfig struct {
	BackendPaths []*BackendPath
	TlsCert      *TlsCert
}

DomainConfig is the Ingress state for a specific domain

type IngressReconciler

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

IngressReconciler holds the main logic of the ingress controller regarding state updating

func New

func New(mgr ctrl.Manager, ingressClassName string, hostIp net.IP) (*IngressReconciler, error)

New creates a new Kubernetes Ingress reconsiler and registers it with the manager. The hostIp is an optional argument. If and only if it is set the ingress status is updated.

func (*IngressReconciler) CleanIngressStatus

func (r *IngressReconciler) CleanIngressStatus(ctx context.Context) []error

CleanIngressStatus is supposed to be called during shutdown and removes all ingress status entries set by this instance. The internal state channel is not updated.

func (*IngressReconciler) GetStateChan

func (r *IngressReconciler) GetStateChan() <-chan IngressState

GetStateChan returns a read-only channel that carries the current state

func (*IngressReconciler) Reconcile

func (r *IngressReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.1/pkg/reconcile

func (*IngressReconciler) Start

func (r *IngressReconciler) Start(ctx context.Context) error

Start sets up the informers and the controller with the Manager, blocks till the context is cancelled or an error occurs.

type IngressState

type IngressState map[string]*DomainConfig

IngressState is the current state of the ingress configurations

type TlsCert

type TlsCert struct {
	Cert []byte
	Key  []byte
}

TlsCert is a data struct that holds a tls certificate and private kay

Jump to

Keyboard shortcuts

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