controller

package
v0.0.0-...-ac5cff2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FaultToleranceRuleKind       = "fault-tolerance.opensergo.io/v1alpha1/FaultToleranceRule"
	RateLimitStrategyKind        = "fault-tolerance.opensergo.io/v1alpha1/RateLimitStrategy"
	ThrottlingStrategyKind       = "fault-tolerance.opensergo.io/v1alpha1/ThrottlingStrategy"
	ConcurrencyLimitStrategyKind = "fault-tolerance.opensergo.io/v1alpha1/ConcurrencyLimitStrategy"
	CircuitBreakerStrategyKind   = "fault-tolerance.opensergo.io/v1alpha1/CircuitBreakerStrategy"
	TrafficRouterKind            = "traffic.opensergo.io/v1alpha1/TrafficRouter"
)
View Source
const (
	UpdateRule = 201
	DeleteRule = 202
	AddRule    = 203
)
View Source
const (
	EXTENSION_ROUTE_FALL_BACK = "envoy.router.cluster_specifier_plugin.cluster_fallback"
)

Variables

This section is empty.

Functions

func BuildRouteConfiguration

func BuildRouteConfiguration(cls *traffic.TrafficRouter) *routev3.RouteConfiguration

BuildRouteConfiguration for Istio RouteConfiguration

Types

type CRDCache

type CRDCache struct {
	// contains filtered or unexported fields
}

CRDCache caches versioned CRD objects in local.

func NewCRDCache

func NewCRDCache(kind string) *CRDCache

func (*CRDCache) DeleteByNamespaceApp

func (c *CRDCache) DeleteByNamespaceApp(n model.NamespacedApp, name string)

func (*CRDCache) DeleteByNamespacedName

func (c *CRDCache) DeleteByNamespacedName(n types.NamespacedName)

func (*CRDCache) GetAppByNamespacedName

func (c *CRDCache) GetAppByNamespacedName(n types.NamespacedName) (string, bool)

func (*CRDCache) GetByNamespaceApp

func (c *CRDCache) GetByNamespaceApp(n model.NamespacedApp) ([]client.Object, int64)

func (*CRDCache) GetByNamespacedName

func (c *CRDCache) GetByNamespacedName(n types.NamespacedName) (client.Object, bool)

func (*CRDCache) SetByNamespaceApp

func (c *CRDCache) SetByNamespaceApp(n model.NamespacedApp, object client.Object) int

func (*CRDCache) SetByNamespacedName

func (c *CRDCache) SetByNamespacedName(n types.NamespacedName, object client.Object)

type CRDGenerator

type CRDGenerator = func() client.Object

CRDGenerator represents a generator function of an OpenSergo CRD.

type CRDKind

type CRDKind = string

type CRDMetadata

type CRDMetadata struct {
	// contains filtered or unexported fields
}

func GetCrdMetadata

func GetCrdMetadata(kind CRDKind) (*CRDMetadata, bool)

func NewCRDMetadata

func NewCRDMetadata(kind CRDKind, generator CRDGenerator) *CRDMetadata

func (*CRDMetadata) Generator

func (m *CRDMetadata) Generator() CRDGenerator

func (*CRDMetadata) Kind

func (m *CRDMetadata) Kind() CRDKind

type CRDObjectsHolder

type CRDObjectsHolder struct {
	// contains filtered or unexported fields
}

type CRDType

type CRDType int32
const (
	FaultToleranceRuleCRDType CRDType = iota
	RateLimitStrategyCRDType
)

func (CRDType) String

func (c CRDType) String() string

type CRDWatcher

type CRDWatcher struct {
	client.Client
	// contains filtered or unexported fields
}

CRDWatcher watches a specific kind of CRD.

func NewCRDWatcher

func NewCRDWatcher(crdManager ctrl.Manager, kind model.SubscribeKind, crdGenerator func() client.Object, sendDataHandler model.DataEntirePushHandler) *CRDWatcher

func (*CRDWatcher) AddSubscribeTarget

func (r *CRDWatcher) AddSubscribeTarget(target model.SubscribeTarget) error

func (*CRDWatcher) GetRules

func (r *CRDWatcher) GetRules(n model.NamespacedApp) ([]*anypb.Any, int64)

func (*CRDWatcher) HasAnySubscribedOfApp

func (r *CRDWatcher) HasAnySubscribedOfApp(app model.NamespacedApp) bool

func (*CRDWatcher) HasAnySubscribedOfNamespace

func (r *CRDWatcher) HasAnySubscribedOfNamespace(namespace string) bool

func (*CRDWatcher) HasSubscribed

func (r *CRDWatcher) HasSubscribed(target model.SubscribeTarget) bool

func (*CRDWatcher) Kind

func (r *CRDWatcher) Kind() model.SubscribeKind

func (*CRDWatcher) Reconcile

func (r *CRDWatcher) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*CRDWatcher) RemoveSubscribeTarget

func (r *CRDWatcher) RemoveSubscribeTarget(target model.SubscribeTarget) error

func (*CRDWatcher) SetupWithManager

func (r *CRDWatcher) SetupWithManager(mgr ctrl.Manager) error

type KubernetesOperator

type KubernetesOperator struct {
	// contains filtered or unexported fields
}

func NewKubernetesOperator

func NewKubernetesOperator(sendDataHandler model.DataEntirePushHandler) (*KubernetesOperator, error)

NewKubernetesOperator creates a OpenSergo Kubernetes operator.

func (*KubernetesOperator) AddWatcher

func (k *KubernetesOperator) AddWatcher(target model.SubscribeTarget) error

func (*KubernetesOperator) Close

func (k *KubernetesOperator) Close() error

Close exit the K8S KubernetesOperator

func (*KubernetesOperator) ComponentName

func (k *KubernetesOperator) ComponentName() string

func (*KubernetesOperator) GetWatcher

func (k *KubernetesOperator) GetWatcher(kind string) (*CRDWatcher, bool)

func (*KubernetesOperator) RegisterControllersAndStart

func (k *KubernetesOperator) RegisterControllersAndStart(info model.SubscribeTarget) error

func (*KubernetesOperator) RegisterWatcher

func (k *KubernetesOperator) RegisterWatcher(target model.SubscribeTarget) (*CRDWatcher, error)

RegisterWatcher registers given CRD type and CRD name. For each CRD type, it can be registered only once.

func (*KubernetesOperator) Run

func (k *KubernetesOperator) Run() error

Run runs the k8s KubernetesOperator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL