Documentation ¶
Overview ¶
package k8sautoscale implements Deployments and Deployment interface for a Kubernetes cluster.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InClusterAutoscaler ¶
func InClusterAutoscaler( ctx context.Context, configPath string, time int64, scaleReporter interfaces.ScaleReporter, ) (*wqautoscale.AutoScale, error)
InClusterAutoscaler creates an autoscaler for scaling deployments within the cluster the process is running within.
Types ¶
type Config ¶
type Config struct { // Namespace of the k8s deployments. Namespace string // Redis options for accessing work queues. Redis redis.Options // QueueNamePrefix is the prefix used for generating queue names. QueueNamePrefix string `yaml:"queueNamePrefix"` // SegmentedDeployments determines if the k8s deployments interface should be wrapped in `SegmentedDeployments`. // // This allows deployment counts to be segmented. SegmentedDeployments bool `yaml:"segmentedDeployments"` // Autoscale config. Autoscale wqautoscale.Config }
func LoadConfig ¶
type WorkQueues ¶
WorkQueues provides an interface allowing work queues to be generated by name.
func NewWorkQueues ¶
func NewWorkQueues(namePrefix string, db *redis.Client) *WorkQueues
func (*WorkQueues) GetWorkQueue ¶
func (queues *WorkQueues) GetWorkQueue(name string) wqautoscale.WorkQueue
type WrappedWorkQueue ¶
type WrappedWorkQueue struct {
// contains filtered or unexported fields
}
WrappedWorkQueue is a WorkQueue, wrapped with a redis database, providing the TotalItems method.
Click to show internal directories.
Click to hide internal directories.