Documentation ¶
Index ¶
- func MakeIstioRoutes(u *v1alpha1.Route, tt *v1alpha1.TrafficTarget, ns string, ...) *istiov1alpha2.RouteRule
- func MakeRouteIngress(route *v1alpha1.Route) *v1beta1.Ingress
- func MakeRouteK8SService(route *v1alpha1.Route) *corev1.Service
- func NewController(kubeClientSet kubernetes.Interface, elaClientSet clientset.Interface, ...) controller.Interface
- type Controller
- type RevisionRoute
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeIstioRoutes ¶
func MakeIstioRoutes(u *v1alpha1.Route, tt *v1alpha1.TrafficTarget, ns string, routes []RevisionRoute, domain string, inactiveRev string) *istiov1alpha2.RouteRule
MakeIstioRoutes creates an Istio route
func MakeRouteIngress ¶
MakeRouteIngress creates an ingress rule, owned by the provided v1alpha1.Route. This ingress rule targets Istio by using the simple placeholder service name. All the routing actually happens in the route rules.
func MakeRouteK8SService ¶
MakeRouteK8SService creates a Service that targets nothing, owned by the provided v1alpha1.Route. This is now only a placeholder so that we can route the traffic to Istio and the balance with route rules exclusively to underlying k8s services that represent Revisions.
func NewController ¶
func NewController( kubeClientSet kubernetes.Interface, elaClientSet clientset.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory, elaInformerFactory informers.SharedInformerFactory, config *rest.Config, controllerConfig controller.Config, enableScaleToZero *k8sflag.BoolFlag, logger *zap.SugaredLogger) controller.Interface
NewController initializes the controller and is called by the generated code Registers eventhandlers to enqueue events config - client configuration for talking to the apiserver si - informer factory shared across all controllers for listening to events and indexing resource properties reconcileKey - function for mapping queue keys to resource names
Types ¶
type Controller ¶
type Controller struct { *controller.Base // contains filtered or unexported fields }
Controller implements the controller for Route resources. +controller:group=ela,version=v1alpha1,kind=Route,resource=routes
func (*Controller) Run ¶
func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error
Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.
type RevisionRoute ¶
type RevisionRoute struct { // Name for external routing. Optional Name string // RevisionName is the underlying revision that we're currently // routing to. Could be resolved from the Configuration or // specified explicitly in TrafficTarget RevisionName string // Service is the name of the k8s service we route to. // Note we should not put service namespace as a suffix in this field. Service string // The k8s service namespace Namespace string Weight int }
RevisionRoute represents a single target to route to. Basically represents a k8s service representing a specific Revision and how much of the traffic goes to it.