Documentation ¶
Index ¶
- Constants
- func CopyAnnotations(in map[string]string) map[string]string
- type ConfigMap
- type ConfigMaps
- type CustomResources
- type Endpoints
- type ErrNotFound
- type HAProxySrv
- type Ingress
- type IngressClass
- type IngressCore
- type IngressPath
- type IngressRule
- type IngressTLS
- type K8s
- func (k *K8s) Clean()
- func (k *K8s) EventBackendCR(namespace, name string, data *corev1alpha1.Backend) bool
- func (k *K8s) EventConfigMap(ns *Namespace, data *ConfigMap) (updateRequired bool)
- func (k *K8s) EventDefaultsCR(namespace, name string, data *corev1alpha1.Defaults) bool
- func (k *K8s) EventEndpoints(ns *Namespace, data *Endpoints, ...) (updateRequired bool)
- func (k *K8s) EventGlobalCR(namespace, name string, data *corev1alpha1.Global) bool
- func (k *K8s) EventIngress(ns *Namespace, data *Ingress) (updateRequired bool)
- func (k *K8s) EventIngressClass(data *IngressClass) (updateRequired bool)
- func (k *K8s) EventNamespace(ns *Namespace, data *Namespace) (updateRequired bool)
- func (k *K8s) EventPod(podEvent PodEvent) (updateRequired bool)
- func (k *K8s) EventPublishService(ns *Namespace, data *Service) (updateRequired bool)
- func (k *K8s) EventSecret(ns *Namespace, data *Secret) (updateRequired bool)
- func (k *K8s) EventService(ns *Namespace, data *Service) (updateRequired bool)
- func (k K8s) GetEndpoints(namespace, name string) (endpoints map[string]*PortEndpoints, err error)
- func (k K8s) GetNamespace(name string) *Namespace
- func (k K8s) GetSecret(namespace, name string) (*Secret, error)
- func (k K8s) GetService(namespace, name string) (*Service, error)
- type MapStringW
- func (a *MapStringW) Clean()
- func (a *MapStringW) Clone() MapStringW
- func (a *MapStringW) Equal(b MapStringW) bool
- func (a *MapStringW) Get(name string) (data *StringW, err error)
- func (a *MapStringW) SetStatus(old MapStringW) (different bool)
- func (a *MapStringW) SetStatusState(state Status)
- func (a *MapStringW) String() string
- type Namespace
- type NamespacesWatch
- type PodEvent
- type PortEndpoints
- type RuntimeBackend
- type Secret
- type Service
- type ServicePort
- type Status
- type StringW
Constants ¶
const ( NETWORKINGV1BETA1 = "networking.k8s.io/v1beta1" EXTENSIONSV1BETA1 = "extensions/v1beta1" NETWORKINGV1 = "networking.k8s.io/v1" PATH_TYPE_EXACT = "Exact" PATH_TYPE_PREFIX = "Prefix" PATH_TYPE_IMPLEMENTATION_SPECIFIC = "ImplementationSpecific" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigMap ¶
type ConfigMap struct { Namespace string Name string Loaded bool Annotations map[string]string Status Status }
ConfigMap is useful data from k8s structures about configmap
type ConfigMaps ¶
type CustomResources ¶
type Endpoints ¶
type Endpoints struct { SliceName string Namespace string Service string Ports map[string]*PortEndpoints // Ports[portName] Status Status }
Endpoints describes endpoints of a service
type ErrNotFound ¶
type ErrNotFound error
type HAProxySrv ¶
type Ingress ¶
type Ingress struct { IngressCore Ignored bool // true if resource ignored because of non matching Controller Class Status Status // Used for store purpose Addresses []string }
Ingress is useful data from k8s structures about ingress
func ConvertToIngress ¶
ConvertToIngress detects the interface{} provided by the SharedInformer and select the proper strategy to convert and return the resource as a store.Ingress struct
type IngressClass ¶
type IngressClass struct { APIVersion string Name string Controller string Annotations map[string]string Status Status // Used for store purpose }
func ConvertToIngressClass ¶
func ConvertToIngressClass(resource interface{}) (ingress *IngressClass, err error)
type IngressCore ¶
type IngressCore struct { // Required for K8s.UpdateIngressStatus to select proper versioned Client Set APIVersion string Namespace string Name string Class string Annotations map[string]string Rules map[string]*IngressRule DefaultBackend *IngressPath TLS map[string]*IngressTLS }
type IngressPath ¶
type IngressPath struct { SvcNamespace string SvcName string SvcPortInt int64 SvcPortString string SvcPortResolved *ServicePort Path string PathTypeMatch string IsDefaultBackend bool }
IngressPath is useful data from k8s structures about ingress path
type IngressRule ¶
type IngressRule struct { Host string Paths map[string]*IngressPath }
IngressRule is useful data from k8s structures about ingress rule
type IngressTLS ¶
IngressTLS describes the transport layer security associated with an Ingress.
type K8s ¶
type K8s struct { NbrHAProxyInst int64 Namespaces map[string]*Namespace IngressClasses map[string]*IngressClass NamespacesAccess NamespacesWatch ConfigMaps ConfigMaps PublishServiceAddresses []string SecretsProcessed map[string]struct{} ServiceProcessed map[string]struct{} UpdateStatusFunc func(ingresses []*Ingress, publishServiceAddresses []string) }
func NewK8sStore ¶
func (*K8s) EventBackendCR ¶
func (k *K8s) EventBackendCR(namespace, name string, data *corev1alpha1.Backend) bool
func (*K8s) EventConfigMap ¶
func (*K8s) EventDefaultsCR ¶
func (k *K8s) EventDefaultsCR(namespace, name string, data *corev1alpha1.Defaults) bool
func (*K8s) EventEndpoints ¶
func (*K8s) EventGlobalCR ¶
func (k *K8s) EventGlobalCR(namespace, name string, data *corev1alpha1.Global) bool
func (*K8s) EventIngress ¶
func (*K8s) EventIngressClass ¶
func (k *K8s) EventIngressClass(data *IngressClass) (updateRequired bool)
func (*K8s) EventNamespace ¶
func (*K8s) EventPublishService ¶
func (*K8s) EventSecret ¶
func (*K8s) EventService ¶
func (K8s) GetEndpoints ¶
func (k K8s) GetEndpoints(namespace, name string) (endpoints map[string]*PortEndpoints, err error)
GetEndpoints takes the ns and name of a service and provides a map of endpoints: portName --> *PortEndpoints
func (K8s) GetNamespace ¶
GetNamespace returns Namespace. Creates one if not existing
type MapStringW ¶
MapStringW stores values and enables
func (*MapStringW) Equal ¶
func (a *MapStringW) Equal(b MapStringW) bool
Equal compares if two maps are equal
func (*MapStringW) Get ¶
func (a *MapStringW) Get(name string) (data *StringW, err error)
Get checks if name exists and if not, returns default value if defined
func (*MapStringW) SetStatus ¶
func (a *MapStringW) SetStatus(old MapStringW) (different bool)
SetStatus sets Status state for all items in map
func (*MapStringW) SetStatusState ¶
func (a *MapStringW) SetStatusState(state Status)
SetStatusState sets all watches to desired state
func (*MapStringW) String ¶
func (a *MapStringW) String() string
Get checks if name exists and if not, returns default value if defined
type Namespace ¶
type Namespace struct { Name string Relevant bool Ingresses map[string]*Ingress Endpoints map[string]map[string]*Endpoints // service -> sliceName -> Endpoints Services map[string]*Service Secret map[string]*Secret HAProxyRuntime map[string]map[string]*RuntimeBackend // service -> portName -> Backend CRs *CustomResources Status Status // contains filtered or unexported fields }
Namespace is useful data from k8s structures about namespace
type NamespacesWatch ¶
type PortEndpoints ¶
PortEndpoints describes endpoints of a service port
func (*PortEndpoints) Equal ¶
func (a *PortEndpoints) Equal(b *PortEndpoints) bool
Equal checks if old PortEndpoints equals to a new PortEndpoints.
type RuntimeBackend ¶
type RuntimeBackend struct { Name string HAProxySrvs []*HAProxySrv Endpoints PortEndpoints DynUpdateFailed bool }
RuntimeBackend holds the runtime state of an HAProxy backend
type Service ¶
type Service struct { Namespace string Name string Ports []ServicePort Addresses []string // Used only for publish-service DNS string Annotations map[string]string Status Status }
Service is useful data from k8s structures about service
func (*Service) EqualWithAddresses ¶
type ServicePort ¶
ServicePort describes port of a service
func (*ServicePort) Equal ¶
func (a *ServicePort) Equal(b *ServicePort) bool