Documentation
¶
Overview ¶
Package integrations knows the proxies Inkwall wires into (0004 §4.2): how to recognise each one's IngressClass and pods, and which engine adapter its pods use. Traefik is the first.
Index ¶
- Variables
- type Integration
- type Selectors
- func (s *Selectors) Equal(o *Selectors) bool
- func (s *Selectors) ForPod(podLabels map[string]string) *Integration
- func (s *Selectors) LabelSelector(name string) *metav1.LabelSelector
- func (s *Selectors) PodSelector() labels.Selector
- func (s *Selectors) Selector(name string) labels.Selector
- func (s *Selectors) String() string
Constants ¶
This section is empty.
Variables ¶
var All = []Integration{Traefik}
All are the known integrations.
var Traefik = Integration{ Name: "traefik", Controller: "traefik.io/ingress-controller", PodSelector: labels.Set{"app.kubernetes.io/name": "traefik"}, Adapter: []string{"forward-auth"}, }
Traefik is the Traefik integration: the engine answers its ForwardAuth middleware.
Functions ¶
This section is empty.
Types ¶
type Integration ¶
type Integration struct {
// Name, e.g. "traefik".
Name string
// Controller is the IngressClass spec.controller of the proxy.
Controller string
// PodSelector matches the proxy's data-plane pods by default (the
// labels its official Helm chart sets); InkwallConfig can override it
// (Selectors).
PodSelector labels.Set
// Adapter is the engine command and its flags for this proxy.
Adapter []string
}
Integration is one proxy.
func ForController ¶
func ForController(controller string) *Integration
ForController returns the integration of an IngressClass controller, or nil when Inkwall doesn't know it.
type Selectors ¶
type Selectors struct {
// contains filtered or unexported fields
}
Selectors are the pod selectors in effect, by integration: each one's default, or InkwallConfig.spec.integrations[].selector. The operator reads them when it starts, since its cache of proxy pods is built from them. A nil *Selectors is the defaults.
func FromConfig ¶
func FromConfig(specs []wafv1alpha1.IntegrationSpec) (*Selectors, []string, error)
FromConfig applies the overrides of an InkwallConfig's integrations. It returns the controllers it ignored, which Inkwall doesn't integrate yet.
func (*Selectors) ForPod ¶
func (s *Selectors) ForPod(podLabels map[string]string) *Integration
ForPod returns the integration whose pods carry podLabels, or nil.
func (*Selectors) LabelSelector ¶
func (s *Selectors) LabelSelector(name string) *metav1.LabelSelector
LabelSelector returns an integration's selector, for the Pod webhook's objectSelector.
func (*Selectors) PodSelector ¶
PodSelector matches the pods of every integration, for the operator's cache and the controllers' lists. A label selector can't express a union of selectors with different keys; with Traefik the only integration, it is Traefik's.