Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller ensures that zero or more routes exist to match any supported ingress. The controller creates a controller owner reference from the route to the parent ingress, allowing users to orphan their ingress. All owned routes have specific spec fields managed (those attributes present on the ingress), while any other fields may be modified by the user.
Invariants:
- For every ingress path rule with a non-empty backend statement, a route should exist that points to that backend.
- For every TLS hostname that has a corresponding path rule and points to a secret that exists, a route should exist with a valid TLS config from that secret.
- For every service referenced by the ingress path rule, the route should have a target port based on the service.
- A route owned by an ingress that is not described by any of the three invariants above should be deleted.
The controller also relies on the use of expectations to remind itself whether there are route creations it has not yet observed, which prevents the controller from creating more objects than it needs. The expectations are reset when the ingress object is modified. It is possible that expectations could leak if an ingress is deleted and its deletion is not observed by the cache, but such leaks are only expected if there is a bug in the informer cache which must be fixed anyway.
Unsupported attributes:
* the ingress class attribute * nginx annotations * the empty backend * paths with empty backends * creating a dynamic route spec.host
func NewController ¶
func NewController(eventsClient kv1core.EventsGetter, client routeclient.RoutesGetter, ingresses extensionsinformers.IngressInformer, secrets coreinformers.SecretInformer, services coreinformers.ServiceInformer, routes routeinformers.RouteInformer) *Controller
NewController instantiates a Controller
func (*Controller) Run ¶
func (c *Controller) Run(workers int, stopCh <-chan struct{})
Run begins watching and syncing.