Documentation ¶
Index ¶
- Constants
- func GetDomainConfigMapName() string
- func GetElaK8SActivatorNamespace() string
- func GetElaK8SActivatorServiceName() string
- func GetElaK8SIngressName(u *v1alpha1.Route) string
- func GetElaK8SServiceName(u *v1alpha1.Route) string
- func GetElaK8SServiceNameForRevision(u *v1alpha1.Revision) string
- func GetElaNamespaceName(ns string) string
- func GetOrCreateNamespace(ctx context.Context, namespace string, c clientset.Interface) (string, error)
- func GetOrCreateRevisionNamespace(ctx context.Context, ns string, c clientset.Interface) (string, error)
- func GetRevisionAutoscalerName(u *v1alpha1.Revision) string
- func GetRevisionDeploymentName(u *v1alpha1.Revision) string
- func GetRevisionHeaderName() string
- func GetRevisionHeaderNamespace() string
- func GetRouteRuleName(u *v1alpha1.Route, tt *v1alpha1.TrafficTarget) string
- func LookupOwningConfigurationName(ownerRefs []v1.OwnerReference) string
- func LookupOwningRouteName(ownerRefs []v1.OwnerReference) string
- func NewConfigurationControllerRef(config *v1alpha1.Configuration) *metav1.OwnerReference
- func NewRevisionControllerRef(rev *v1alpha1.Revision) *metav1.OwnerReference
- func NewRouteControllerRef(route *v1alpha1.Route) *metav1.OwnerReference
- func NewServiceControllerRef(service *v1alpha1.Service) *metav1.OwnerReference
- type Base
- type Config
- type Interface
- type LabelSelector
Constants ¶
const ( PromLabelValueInvalid = "invalid" PromLabelValueSuccess = "success" PromLabelValueFailure = "failure" )
Standard labels and values to use in Prometheus metrics.
Variables ¶
This section is empty.
Functions ¶
func GetDomainConfigMapName ¶
func GetDomainConfigMapName() string
func GetElaK8SActivatorNamespace ¶
func GetElaK8SActivatorNamespace() string
func GetElaK8SActivatorServiceName ¶
func GetElaK8SActivatorServiceName() string
func GetElaK8SIngressName ¶
func GetElaK8SServiceName ¶
func GetElaNamespaceName ¶
Various functions for naming the resources for consistency
func GetOrCreateNamespace ¶
func GetRevisionHeaderName ¶
func GetRevisionHeaderName() string
func GetRevisionHeaderNamespace ¶
func GetRevisionHeaderNamespace() string
func GetRouteRuleName ¶
func GetRouteRuleName(u *v1alpha1.Route, tt *v1alpha1.TrafficTarget) string
func LookupOwningConfigurationName ¶
func LookupOwningConfigurationName(ownerRefs []v1.OwnerReference) string
LookupOwningConfigurationName returns the name of Configuration as OwnerReference if there is any in the given OwnerReference array.
func LookupOwningRouteName ¶
func LookupOwningRouteName(ownerRefs []v1.OwnerReference) string
LookupOwningRouteName returns the name of Route as OwnerReference if there is any in the given OwnerReference array.
func NewConfigurationControllerRef ¶
func NewConfigurationControllerRef(config *v1alpha1.Configuration) *metav1.OwnerReference
NewConfigurationControllerRef creates an OwnerReference pointing to the given Service.
func NewRevisionControllerRef ¶
func NewRevisionControllerRef(rev *v1alpha1.Revision) *metav1.OwnerReference
NewRevisionControllerRef creates an OwnerReference pointing to the given Service.
func NewRouteControllerRef ¶
func NewRouteControllerRef(route *v1alpha1.Route) *metav1.OwnerReference
NewRouteControllerRef creates an OwnerReference pointing to the given Service.
func NewServiceControllerRef ¶
func NewServiceControllerRef(service *v1alpha1.Service) *metav1.OwnerReference
NewServiceControllerRef creates an OwnerReference pointing to the given Service.
Types ¶
type Base ¶
type Base struct { // KubeClientSet allows us to talk to the k8s for core APIs KubeClientSet kubernetes.Interface // ElaClientSet allows us to configure Ela objects ElaClientSet clientset.Interface // KubeInformerFactory provides shared informers for resources // in all known API group versions KubeInformerFactory kubeinformers.SharedInformerFactory // ElaInformerFactory provides shared informers for resources // in all known API group versions ElaInformerFactory informers.SharedInformerFactory // Recorder is an event recorder for recording Event resources to the // Kubernetes API. Recorder record.EventRecorder // WorkQueue is a rate limited work queue. This is used to queue work to be // processed instead of performing it as soon as a change happens. This // means we can ensure we only process a fixed amount of resources at a // time, and makes it easy to ensure we are never processing the same item // simultaneously in two different workers. WorkQueue workqueue.RateLimitingInterface // Sugared logger is easier to use but is not as performant as the // raw logger. In performance critical paths, call logger.Desugar() // and use the returned raw logger instead. In addition to the // performance benefits, raw logger also preserves type-safety at // the expense of slightly greater verbosity. Logger *zap.SugaredLogger }
Base implements most of the boilerplate and common code we have in our controllers.
func NewBase ¶
func NewBase( kubeClientSet kubernetes.Interface, elaClientSet clientset.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory, elaInformerFactory informers.SharedInformerFactory, informer cache.SharedIndexInformer, controllerAgentName string, workQueueName string, logger *zap.SugaredLogger) *Base
NewBase instantiates a new instance of Base implementing the common & boilerplate code between our controllers.
func (*Base) RunController ¶
func (c *Base) RunController( threadiness int, stopCh <-chan struct{}, informersSynced []cache.InformerSynced, syncHandler func(string) error, controllerName string) error
RunController 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 Config ¶
type Config struct { // Domains map from domain to label selector. If a route has // labels matching a particular selector, it will use the // corresponding domain. If multiple selectors match, we choose // the most specific selector. Domains map[string]*LabelSelector }
Config contains controller configurations.
type LabelSelector ¶
LabelSelector represents map of {key,value} pairs. A single {key,value} in the map is equivalent to a requirement key == value. The requirements are ANDed.