types

package
v0.0.0-...-eb30ed4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 7 Imported by: 7

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 (
	// ClientAccessNetwork indicates the client accesses k8s api-server via a network call.
	ClientAccessNetwork ClientAccessMode = "Network"
	// ClientAccessInMemory 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.
	ClientAccessInMemory ClientAccessMode = "InMemory"
)

type ClientFacades

type ClientFacades struct {
	// Mode indicates the access mode of the Kubernetes client.
	Mode ClientAccessMode
	// 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
}

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 (
	// AWSCloudProvider indicates AWS as cloud provider.
	AWSCloudProvider CloudProvider = "aws"
	// GCPCloudProvider indicates GCP as cloud provider.
	GCPCloudProvider CloudProvider = "gcp"
	// AzureCloudProvider indicates Azure as cloud provider.
	AzureCloudProvider CloudProvider = "azure"
	// AliCloudProvider indicates Alibaba Cloud as cloud provider.
	AliCloudProvider CloudProvider = "ali"
	// OpenStackCloudProvider indicates OpenStack as cloud provider.
	OpenStackCloudProvider 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 (
	// LeastWasteNodeScoringStrategy represents a scoring strategy that minimizes resource waste.
	LeastWasteNodeScoringStrategy NodeScoringStrategy = "LeastWaste"
	// LeastCostNodeScoringStrategy represents a scoring strategy that minimizes cost.
	LeastCostNodeScoringStrategy NodeScoringStrategy = "LeastCost"
)

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 {
	HostPort `json:",inline"`
	// KubeConfigPath is the path to master kube-config.
	KubeConfigPath string `json:"kubeConfigPath"`
	// ProfilingEnabled indicates whether this service should register the standard pprof HTTP handlers: /debug/pprof/*
	ProfilingEnabled bool `json:"profilingEnabled"`
	// GracefulShutdownTimeout is the time given to the service to gracefully shutdown.
	GracefulShutdownTimeout metav1.Duration `json:"gracefulShutdownTimeout"`
}

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.

Jump to

Keyboard shortcuts

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