Documentation ¶
Index ¶
- type ConfigMap
- type ConfigMaps
- type Endpoints
- type HAProxySrv
- type Ingress
- type IngressClass
- type IngressPath
- type IngressRule
- type IngressTLS
- type K8s
- func (k K8s) Clean()
- func (k *K8s) EventConfigMap(ns *Namespace, data *ConfigMap) (updateRequired bool)
- func (k *K8s) EventEndpoints(ns *Namespace, data *Endpoints, ...) (updateRequired bool)
- func (k *K8s) EventIngress(ns *Namespace, data *Ingress, controllerClass string) (updateRequired bool)
- func (k *K8s) EventIngressClass(data *IngressClass) (updateRequired bool)
- func (k *K8s) EventNamespace(ns *Namespace, data *Namespace) (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) FetchSecret(secretPath, defaultNs string) (*Secret, error)
- func (k K8s) GetNamespace(name string) *Namespace
- func (k K8s) GetValueFromAnnotations(annotationName string, annotations ...MapStringW) (data *StringW, err error)
- func (k K8s) SetDefaultAnnotation(annotation, value string)
- 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 PortEndpoints
- type Secret
- type Service
- type ServicePort
- type Status
- type StringW
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigMap ¶
type ConfigMap struct { Namespace string Name string Loaded bool Annotations MapStringW Status Status }
ConfigMap is useful data from k8s structures about configmap
type ConfigMaps ¶ added in v1.6.0
type Endpoints ¶
type Endpoints struct { Namespace string Service StringW Ports map[string]*PortEndpoints Status Status }
Endpoints describes endpoints of a service
type HAProxySrv ¶
type Ingress ¶
type Ingress struct { // Required for K8s.UpdateIngressStatus to select proper versioned Client Set APIVersion string Namespace string Name string Class string Annotations MapStringW Rules map[string]*IngressRule DefaultBackend *IngressPath TLS map[string]*IngressTLS Status Status }
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 ¶
func ConvertToIngressClass ¶
func ConvertToIngressClass(resource interface{}) (ingress *IngressClass, err error)
func (*IngressClass) Equal ¶
func (a *IngressClass) Equal(b *IngressClass) bool
Equal checks if IngressClasses are equal
type IngressPath ¶
type IngressPath struct { SvcName string SvcPortInt int64 SvcPortString string SvcPortResolved *ServicePort Path string ExactPathMatch bool IsDefaultBackend bool Status Status }
IngressPath is useful data from k8s structures about ingress path
func (*IngressPath) Equal ¶
func (a *IngressPath) Equal(b *IngressPath) bool
Equal checks if Ingress Paths are equal
type IngressRule ¶
type IngressRule struct { Host string Paths map[string]*IngressPath Status Status }
IngressRule is useful data from k8s structures about ingress rule
func (*IngressRule) Equal ¶
func (a *IngressRule) Equal(b *IngressRule) bool
Equal checks if Ingress Rules are equal
type IngressTLS ¶
IngressTLS describes the transport layer security associated with an Ingress.
func (*IngressTLS) Equal ¶
func (a *IngressTLS) Equal(b *IngressTLS) bool
Equal checks if Ingress secrets are equal
type K8s ¶
type K8s struct { Namespaces map[string]*Namespace IngressClasses map[string]*IngressClass NamespacesAccess NamespacesWatch ConfigMaps ConfigMaps }
func NewK8sStore ¶
func (*K8s) EventConfigMap ¶
func (*K8s) EventEndpoints ¶
func (*K8s) EventIngress ¶
func (*K8s) EventIngressClass ¶
func (k *K8s) EventIngressClass(data *IngressClass) (updateRequired bool)
func (*K8s) EventNamespace ¶
func (*K8s) EventSecret ¶
func (*K8s) EventService ¶
func (K8s) FetchSecret ¶
FetchSecret fetches secret with secretPath format "namespace/secretName" if format is just "secretName" defaultNs param will be used.
func (K8s) GetNamespace ¶
GetNamespace returns Namespace. Creates one if not existing
func (K8s) GetValueFromAnnotations ¶
func (k K8s) GetValueFromAnnotations(annotationName string, annotations ...MapStringW) (data *StringW, err error)
GetValueFromAnnotations returns value by checking in multiple annotations. moves through list until it finds value if value is new or deleted, we check for next state to correctly set watch & value
func (K8s) SetDefaultAnnotation ¶
type MapStringW ¶
MapStringW stores values and enables
func ConvertToMapStringW ¶
func ConvertToMapStringW(annotations map[string]string) MapStringW
ConvertToMapStringW removes prefixes in annotation
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]*Endpoints Services map[string]*Service Secret map[string]*Secret Status Status // contains filtered or unexported fields }
Namespace is useful data from k8s structures about namespace
type NamespacesWatch ¶
type PortEndpoints ¶
type PortEndpoints struct { Port int64 BackendName string // For runtime operations DynUpdateFailed bool AddrCount int AddrNew map[string]struct{} HAProxySrvs []*HAProxySrv }
PortEndpoints describes endpionts of a service port
func (*PortEndpoints) Equal ¶
func (oldE *PortEndpoints) Equal(newE *PortEndpoints) bool
Equal checks if old PortEndpoints equals to a new PortEndpoints. All Addresses of a new PortEndpoints are in AddrNew. Addresses of old PortEndpoints are configured in HAProxySrvs and some may be still in AddrNew in case len(HAProxySrvs) < AddrCount. (Eventually all addresses will be in HAProxySrvs after updateHAProxy())
type Service ¶
type Service struct { Namespace string Name string Ports []ServicePort Addresses []string // Used only for publish-service DNS string Annotations MapStringW Selector MapStringW Status Status }
Service is useful data from k8s structures about service
type ServicePort ¶
ServicePort describes port of a service
func (*ServicePort) Equal ¶
func (a *ServicePort) Equal(b *ServicePort) bool