Documentation
¶
Overview ¶
+kubebuilder:validation:Optional
Index ¶
- Variables
- func InvokeServiceDiscovery(in FxInSvc) error
- func Module() fx.Option
- func RegisterControlPointCacheService(handler *Handler, server *grpc.Server)
- type AutoScaler
- type ControlPoint
- type ControlPointCache
- type ControlPointStore
- type FxInK8sScale
- type FxInSvc
- type Handler
- type KubernetesDiscoveryConfig
Constants ¶
This section is empty.
Variables ¶
var ( // ConfigKey is the configuration key for Kubernetes Discovery. ConfigKey = common.DiscoveryConfigKey + ".kubernetes" // FxTagBase is the tag's base used to identify the Kubernetes Control Points Tracker. FxTagBase = "kubernetes_control_points" // FxTag is the tag used to identify the Kubernetes Control Points Tracker. FxTag = config.NameTag(FxTagBase) )
Functions ¶
func InvokeServiceDiscovery ¶ added in v0.19.0
InvokeServiceDiscovery creates a Kubernetes service discovery.
func Module ¶ added in v0.19.0
Module returns an fx.Option that provides the Kubernetes discovery module.
func RegisterControlPointCacheService ¶ added in v0.23.0
RegisterControlPointCacheService registers the ControlPointCache service handler with the gRPC server.
Types ¶
type AutoScaler ¶ added in v0.19.0
type AutoScaler interface {
Scale(ControlPoint, int32)
}
AutoScaler provides an interface to invoke auto-scale.
type ControlPoint ¶ added in v0.19.0
A ControlPoint is identified by Group, Version, Kind, Namespace and Name.
func ControlPointFromSelector ¶ added in v0.19.0
func ControlPointFromSelector(k8sObjectSelector *policylangv1.KubernetesObjectSelector) (ControlPoint, error)
ControlPointFromSelector converts a policylangv1.KubernetesObjectSelector to a ControlPoint.
func (*ControlPoint) ToProto ¶ added in v0.19.0
func (cp *ControlPoint) ToProto() *controlpointcachev1.KubernetesControlPoint
ToProto converts a ControlPoint to a KubernetesControlPoint.
type ControlPointCache ¶ added in v0.19.0
type ControlPointCache interface { Keys() []ControlPoint AddKeyNotifier(notifiers.KeyNotifier) error RemoveKeyNotifier(notifiers.KeyNotifier) error }
ControlPointCache is the interface for Reading or Watching Kubernetes Control Points.
func ProvideControlPointCache ¶ added in v0.19.0
func ProvideControlPointCache(in FxInK8sScale) (ControlPointCache, error)
ProvideControlPointCache provides Kubernetes AutoScaler and starts Kubernetes control point discovery if enabled.
type ControlPointStore ¶ added in v0.19.0
type ControlPointStore interface { Add(cp ControlPoint) Update(cp ControlPoint) Delete(cp ControlPoint) }
ControlPointStore is the interface for Storing Kubernetes Control Points.
type FxInK8sScale ¶ added in v0.19.0
type FxInK8sScale struct { fx.In Unmarshaller config.Unmarshaller Lifecycle fx.Lifecycle StatusRegistry status.Registry KubernetesClient k8s.K8sClient `optional:"true"` Election *election.Election Trackers notifiers.Trackers `name:"kubernetes_control_points"` }
FxInK8sScale is the input for the ProvideKuberetesControlPointsCache function.
type FxInSvc ¶ added in v0.19.0
type FxInSvc struct { fx.In Unmarshaller config.Unmarshaller Lifecycle fx.Lifecycle StatusRegistry status.Registry KubernetesClient k8s.K8sClient EntityTrackers *entitycache.EntityTrackers }
FxInSvc describes parameters passed to k8s discovery constructor.
type Handler ¶ added in v0.23.0
type Handler struct { controlpointcachev1.UnimplementedControlPointCacheServer ControlPointCache ControlPointCache }
Handler is the gRPC server handler.
func NewHandler ¶ added in v0.23.0
func NewHandler(cpc ControlPointCache) *Handler
NewHandler returns a new Handler.
func (*Handler) GetControlPoints ¶ added in v0.23.0
func (h *Handler) GetControlPoints(ctx context.Context, _ *emptypb.Empty) (*controlpointcachev1.KubernetesControlPoints, error)
GetControlPoints returns a ControlPoint from the cache.
type KubernetesDiscoveryConfig ¶
type KubernetesDiscoveryConfig struct { // NodeName is the name of the k8s node the agent should be monitoring NodeName string `json:"node_name"` PodName string `json:"pod_name"` DiscoveryEnabled bool `json:"discovery_enabled" default:"true"` AutoscaleEnabled bool `json:"autoscale_enabled" default:"true"` }
KubernetesDiscoveryConfig for Kubernetes service discovery. swagger:model +kubebuilder:object:generate=true
func (*KubernetesDiscoveryConfig) DeepCopy ¶ added in v0.1.2
func (in *KubernetesDiscoveryConfig) DeepCopy() *KubernetesDiscoveryConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesDiscoveryConfig.
func (*KubernetesDiscoveryConfig) DeepCopyInto ¶ added in v0.1.2
func (in *KubernetesDiscoveryConfig) DeepCopyInto(out *KubernetesDiscoveryConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.