controllers

package
v0.0.0-...-2acb69d Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseRootUserName          = "root"
	DatabaseServiceUserName       = "stroomuser"
	DatabasePort            int32 = 3306
)
View Source
const (
	AppPortName                   = "app"
	AppPortNumber                 = 8080
	AdminPortName                 = "admin"
	AdminPortNumber               = 8081
	StroomNodePvcName             = "data"
	StroomNodeContainerName       = "stroom-node"
	StroomApiTokenVolumeMountName = "api-token"
	StroomApiTokenMountPath       = "/stroom/auth"
	LogSenderDefaultCpuLimit      = "500m"
	LogSenderDefaultMemoryLimit   = "256Mi"
)
View Source
const (
	MaximumMetricRetentionPeriodMins = 60
)

Variables

View Source
var StaticFiles embed.FS

Functions

func CloseDatabase

func CloseDatabase(database *sql.DB)

func GetDatabaseConnectionInfo

func GetDatabaseConnectionInfo(client client.Client, ctx context.Context, dbRef *stroomv1.DatabaseServerRef, ownerNamespace string, dbConnectionInfo *DatabaseConnectionInfo) error

func OpenDatabase

func OpenDatabase(client client.Reader, ctx context.Context, dbInfo *DatabaseConnectionInfo, secretNamespace string, databaseName string) (*sql.DB, error)

Types

type DatabaseBackupReconciler

type DatabaseBackupReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

DatabaseBackupReconciler reconciles a DatabaseBackup object

func (*DatabaseBackupReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*DatabaseBackupReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type DatabaseConnectionInfo

type DatabaseConnectionInfo struct {
	DatabaseServer *v1.DatabaseServer
	v1.ServerAddress
	UserName string
}

func (*DatabaseConnectionInfo) ToJdbcConnectionString

func (dbInfo *DatabaseConnectionInfo) ToJdbcConnectionString(databaseName string) string

type DatabaseServerReconciler

type DatabaseServerReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
}

DatabaseServerReconciler reconciles a DatabaseServer object

func (*DatabaseServerReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*DatabaseServerReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type StroomClusterReconciler

type StroomClusterReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
}

StroomClusterReconciler reconciles a StroomCluster object

func (*StroomClusterReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*StroomClusterReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type StroomNodeMetric

type StroomNodeMetric struct {
	Time     time.Time
	CpuUsage *resource.Quantity
}

func (*StroomNodeMetric) IsZero

func (in *StroomNodeMetric) IsZero() bool

type StroomNodeMetricMap

type StroomNodeMetricMap struct {
	// Stored pod metrics
	Items map[string][]StroomNodeMetric

	// When a pod last had its tasks autoscaled
	LastScaled map[string]time.Time
}

func NewNodeMetricMap

func NewNodeMetricMap() StroomNodeMetricMap

func (*StroomNodeMetricMap) AddMetric

func (in *StroomNodeMetricMap) AddMetric(podName string, metric StroomNodeMetric)

func (*StroomNodeMetricMap) AgeOff

func (in *StroomNodeMetricMap) AgeOff(retentionPeriodMins int, currentTime time.Time)

AgeOff removes metrics in the map older than the specified retention period (in minutes)

func (*StroomNodeMetricMap) DeletePodData

func (in *StroomNodeMetricMap) DeletePodData(podName string)

func (*StroomNodeMetricMap) GetSlidingWindowMean

func (in *StroomNodeMetricMap) GetSlidingWindowMean(podName string, slidingWindowIntervalMins int, currentTime time.Time, result *int64) bool

GetSlidingWindowMean calculates the mean of all metrics for a pod name, within the specified sliding window interval (in minutes)

func (*StroomNodeMetricMap) IsScaleScheduled

func (in *StroomNodeMetricMap) IsScaleScheduled(podName string) bool

func (*StroomNodeMetricMap) SetLastScaled

func (in *StroomNodeMetricMap) SetLastScaled(podName string, currentTime time.Time)

func (*StroomNodeMetricMap) ShouldScale

func (in *StroomNodeMetricMap) ShouldScale(podName string, adjustmentIntervalMins int, currentTime time.Time) bool

type StroomTaskAutoscalerReconciler

type StroomTaskAutoscalerReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger

	Metrics StroomNodeMetricMap
}

StroomTaskAutoscalerReconciler reconciles a StroomTaskAutoscaler object

func (*StroomTaskAutoscalerReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*StroomTaskAutoscalerReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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