Documentation
¶
Index ¶
- Constants
- Variables
- func GetIngressPod(kubeClient clientset.Interface) error
- func GetNodeIPOrName(kubeClient clientset.Interface, name string, useInternalIP bool) string
- func IsIngressAlbClass(ing networking.Ingress) bool
- func IsValid(ing *networking.Ingress) bool
- func MetaNamespaceKey(obj interface{}) string
- func NetworkingIngressAvailable(client clientset.Interface) (bool, bool, bool)
- func ParseNameNS(input string) (string, string, error)
- func SetDefaultALBPathType(ing *networking.Ingress)
- type ConfigMapLister
- type EndpointLister
- type Informer
- type Ingress
- type IngressFilterFunc
- type IngressLister
- type IngressWithAnnotationsLister
- type Lister
- type NodeLister
- type NotExistsError
- type ObjectRefMap
- type PodInfo
- type PodLister
- type SecretLister
- type ServiceLister
- type Storer
Constants ¶
const ( // IngressKey picks a specific "class" for the Ingress. // The controller only processes Ingresses with this annotation either // unset, or set to either the configured value or the empty string. IngressKey = "kubernetes.io/ingress.class" )
const IngressNGINXController = "k8s.io/ingress-nginx"
IngressNGINXController defines the valid value of IngressClass Controller field for ingress-nginx
Variables ¶
var ( // DefaultClass defines the default class used in the alb ingress controller DefaultClass = "alb" // IngressClass sets the runtime ingress class to use // An empty string means accept all ingresses without // annotation and the ones configured with class alb IngressClassName = "alb" )
var IngressClass *networking.IngressClass
IngressClass indicates the class of the Ingress to use as filter
var IsIngressV1Beta1Ready bool
IsIngressV1Beta1Ready indicates if the running Kubernetes version is at least v1.18.0
var IsIngressV1Ready bool
IsIngressV1Ready indicates if the running Kubernetes version is at least v1.19.0
Functions ¶
func GetIngressPod ¶
GetIngressPod load the ingress-nginx pod
func GetNodeIPOrName ¶
GetNodeIPOrName returns the IP address or the name of a node in the cluster
func IsIngressAlbClass ¶
func IsIngressAlbClass(ing networking.Ingress) bool
func IsValid ¶
func IsValid(ing *networking.Ingress) bool
IsValid returns true if the given Ingress specify the ingress.class annotation or IngressClassName resource for Kubernetes >= v1.18
func MetaNamespaceKey ¶
func MetaNamespaceKey(obj interface{}) string
MetaNamespaceKey knows how to make keys for API objects which implement meta.Interface.
func NetworkingIngressAvailable ¶
NetworkingIngressAvailable checks if the package "k8s.io/api/networking/v1beta1" is available or not and if Ingress V1 is supported (k8s >= v1.18.0)
func ParseNameNS ¶
ParseNameNS parses a string searching a namespace and name
func SetDefaultALBPathType ¶
func SetDefaultALBPathType(ing *networking.Ingress)
SetDefaultNGINXPathType sets a default PathType when is not defined.
Types ¶
type ConfigMapLister ¶
ConfigMapLister makes a Store that lists Configmaps.
type EndpointLister ¶
EndpointLister makes a Store that lists Endpoints.
type Informer ¶
type Informer struct { Ingress cache.SharedIndexInformer Endpoint cache.SharedIndexInformer Service cache.SharedIndexInformer Node cache.SharedIndexInformer Pod cache.SharedIndexInformer }
Informer defines the required SharedIndexInformers that interact with the API server.
type Ingress ¶
type Ingress struct {
networking.Ingress `json:"-"`
}
Ingress holds the definition of an Ingress plus its annotations
func FilterIngresses ¶
func FilterIngresses(ingresses []*Ingress, filterFunc IngressFilterFunc) []*Ingress
FilterIngresses returns the list of Ingresses
type IngressFilterFunc ¶
IngressFilterFunc decides if an Ingress should be omitted or not
type IngressLister ¶
IngressLister makes a Store that lists Ingress.
func (IngressLister) ByKey ¶
func (il IngressLister) ByKey(key string) (*networking.Ingress, error)
ByKey returns the Ingress matching key in the local Ingress Store.
type IngressWithAnnotationsLister ¶
IngressWithAnnotationsLister makes a Store that lists Ingress rules with annotations already parsed
type Lister ¶
type Lister struct { Ingress IngressLister Service ServiceLister Endpoint EndpointLister Pod PodLister Node NodeLister IngressWithAnnotation IngressWithAnnotationsLister }
Lister contains object listers (stores).
type NodeLister ¶
NodeLister makes a Store that lists Nodes.
type NotExistsError ¶
type NotExistsError string
NotExistsError is returned when an object does not exist in a local store.
func (NotExistsError) Error ¶
func (e NotExistsError) Error() string
Error implements the error interface.
type ObjectRefMap ¶
type ObjectRefMap interface { Insert(consumer string, ref ...string) Delete(consumer string) Len() int Has(ref string) bool HasConsumer(consumer string) bool Reference(ref string) []string ReferencedBy(consumer string) []string }
ObjectRefMap is a map of references from object(s) to object (1:n). It is used to keep track of which data objects (Secrets) are used within Ingress objects.
func NewObjectRefMap ¶
func NewObjectRefMap() ObjectRefMap
NewObjectRefMap returns a new ObjectRefMap.
type PodInfo ¶
type PodInfo struct { metav1.TypeMeta metav1.ObjectMeta }
PodInfo contains runtime information about the pod running the Ingres controller +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
var ( // IngressPodDetails hold information about the ingress-nginx pod IngressPodDetails *PodInfo )
type SecretLister ¶
SecretLister makes a Store that lists Secrets.
type ServiceLister ¶
ServiceLister makes a Store that lists Services.
type Storer ¶
type Storer interface { // GetService returns the Service matching key. GetService(key string) (*corev1.Service, error) // GetServiceEndpoints returns the Endpoints of a Service matching key. GetServiceEndpoints(key string) (*corev1.Endpoints, error) GetPod(key string) (*corev1.Pod, error) // ListIngresses returns a list of all Ingresses in the store. ListIngresses() []*Ingress // Run initiates the synchronization of the controllers Run(stopCh chan struct{}) }
Storer is the interface that wraps the required methods to gather information about ingresses, services, secrets and ingress annotations.