Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientAccessMode ¶
type ClientAccessMode string
ClientAccessMode indicates the access mode of k8s client
const ( // ClientAccessModeNetwork indicates the client accesses k8s api-server via a network call. ClientAccessModeNetwork ClientAccessMode = "Network" // ClientAccessModeInMemory indicates the client accesses k8s api-server via in-memory calls by passing network calls // thus reducing the need for serialization and deserialization of requests and responses. ClientAccessModeInMemory ClientAccessMode = "InMemory" )
type ClientFacades ¶
type ClientFacades struct {
// Client is the standard Kubernetes clientset for accessing core APIs.
Client kubernetes.Interface
// DynClient is the dynamic client for accessing arbitrary Kubernetes resources.
DynClient dynamic.Interface
// InformerFactory provides shared informers for core Kubernetes resources.
InformerFactory informers.SharedInformerFactory
// DynInformerFactory provides shared informers for dynamic Kubernetes resources.
DynInformerFactory dynamicinformer.DynamicSharedInformerFactory
// Mode indicates the access mode of the Kubernetes client.
Mode ClientAccessMode
}
ClientFacades is a holder for the primary k8s client and informer interfaces.
type CloudProvider ¶
type CloudProvider string
CloudProvider represents the cloud provider type for the cluster.
const ( // CloudProviderAWS indicates AWS as cloud provider. CloudProviderAWS CloudProvider = "aws" // CloudProviderGCP indicates GCP as cloud provider. CloudProviderGCP CloudProvider = "gcp" // CloudProviderAzure indicates Azure as cloud provider. CloudProviderAzure CloudProvider = "azure" // CloudProviderAli indicates Alibaba Cloud as cloud provider. CloudProviderAli CloudProvider = "ali" // CloudProviderOpenStack indicates OpenStack as cloud provider. CloudProviderOpenStack CloudProvider = "openstack" )
func AsCloudProvider ¶
func AsCloudProvider(cloudProvider string) (CloudProvider, error)
AsCloudProvider converts a string to CloudProvider type. It returns an error if the cloudProvider string is not supported.
type ConstraintReference ¶
type ConstraintReference struct {
// Name is the name of the ClusterScalingConstraint.
Name string `json:"name"`
// Namespace is the namespace of the ClusterScalingConstraint.
Namespace string `json:"namespace"`
}
ConstraintReference is a reference to the ClusterScalingConstraint for which this advice is generated.
type HostPort ¶
type HostPort struct {
// Host is the IP address on which to listen for the specified port.
Host string `json:"host"`
// Port is the port on which to serve requests.
Port int `json:"port"`
}
HostPort contains information for service host and port.
type NodeScoringStrategy ¶
type NodeScoringStrategy string
NodeScoringStrategy represents a node scoring strategy variant.
const ( // NodeScoringStrategyLeastWaste represents a scoring strategy that minimizes resource waste. NodeScoringStrategyLeastWaste NodeScoringStrategy = "least-waste" // NodeScoringStrategyLeastCost represents a scoring strategy that minimizes cost. NodeScoringStrategyLeastCost NodeScoringStrategy = "least-cost" )
type QPSBurst ¶
type QPSBurst struct {
// QPS is the queries per second rate limit for the client.
QPS float32 `json:"qps"`
// Burst is the burst size for rate limiting, allowing temporary spikes above QPS.
Burst int `json:"burst"`
}
QPSBurst is a simple encapsulation of client QPS and Burst settings.
type ServerConfig ¶
type ServerConfig struct {
// KubeConfigPath is the path to master kube-config.
KubeConfigPath string `json:"kubeConfigPath"`
HostPort `json:",inline"`
// GracefulShutdownTimeout is the time given to the service to gracefully shutdown.
GracefulShutdownTimeout metav1.Duration `json:"gracefulShutdownTimeout"`
// ProfilingEnabled indicates whether this service should register the standard pprof HTTP handlers: /debug/pprof/*
ProfilingEnabled bool `json:"profilingEnabled"`
}
ServerConfig is the common configuration for a server.
type Service ¶
type Service interface {
// Start starts the service with the given context. Start may block depending on the implementation - if the service is a server.
// The context is expected to be populated with a logger.
Start(ctx context.Context) error
// Stop stops the service. Stop does not block.
Stop(ctx context.Context) error
}
Service is a component that can be started and stopped.