ingress_controller

package module
v0.0.0-...-52feba5 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

README

ingress-controller

monitor changes to an ingress in kubernetes

This is meant to automatically monitor the changes in kubernetes ingress definitions. This will manage an inmemory map of all the ingresses currently available within a kube cluster.

Matcher

Three matchers are available PrefixMatch, ExactMatch and RegexMatch are available.

Example

  controller := InitIngressController(context.Background(), kubeclient)
	namespace, ingressName, serviceRoute, found := controller.PrefixMatch("host.com", "/query")
	namespace, ingressName, serviceRoute, found := controller.ExactMatch("host.com", "/query")

Read Issues to identify what needs to be done.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IngressController

type IngressController struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func InitIngressController

func InitIngressController(
	ctx context.Context,
	kubeClient *kubernetes.Clientset,
) *IngressController

InitIngressController initializes the Ingress controller. You need to provide the context which on cancel will stop the watcher for ingress updates and kubeClient which can be used to initialize the event listener

func (*IngressController) ExactMatch

func (ing *IngressController) ExactMatch(host, path string) (string, string, string, bool)

func (*IngressController) PrefixMatch

func (ing *IngressController) PrefixMatch(host, path string) (string, string, string, bool)

func (*IngressController) RegexMatch

func (ing *IngressController) RegexMatch(host, path, pattern string) (string, string, string, bool)

type RouterInfo

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

Jump to

Keyboard shortcuts

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