Documentation ¶
Index ¶
- Constants
- Variables
- func CloseDatabase(database *sql.DB)
- func GetDatabaseConnectionInfo(client client.Client, ctx context.Context, dbRef *stroomv1.DatabaseServerRef, ...) error
- func OpenDatabase(client client.Reader, ctx context.Context, dbInfo *DatabaseConnectionInfo, ...) (*sql.DB, error)
- type DatabaseBackupReconciler
- type DatabaseConnectionInfo
- type DatabaseServerReconciler
- type StroomClusterReconciler
- type StroomNodeMetric
- type StroomNodeMetricMap
- func (in *StroomNodeMetricMap) AddMetric(podName string, metric StroomNodeMetric)
- func (in *StroomNodeMetricMap) AgeOff(retentionPeriodMins int, currentTime time.Time)
- func (in *StroomNodeMetricMap) DeletePodData(podName string)
- func (in *StroomNodeMetricMap) GetSlidingWindowMean(podName string, slidingWindowIntervalMins int, currentTime time.Time, ...) bool
- func (in *StroomNodeMetricMap) IsScaleScheduled(podName string) bool
- func (in *StroomNodeMetricMap) SetLastScaled(podName string, currentTime time.Time)
- func (in *StroomNodeMetricMap) ShouldScale(podName string, adjustmentIntervalMins int, currentTime time.Time) bool
- type StroomTaskAutoscalerReconciler
Constants ¶
const ( DatabaseRootUserName = "root" DatabaseServiceUserName = "stroomuser" DatabasePort int32 = 3306 )
const ( AppHttpPortName = "app-http" AppHttpPortNumber = 8080 AppHttpsPortName = "app-https" AppHttpsPortNumber = 8443 AdminPortName = "admin" AdminPortNumber = 8081 StroomNodePvcName = "data" StroomNodeContainerName = "stroom-node" StroomTlsVolumeName = "tls" StroomApiTokenVolumeName = "api-token" StroomApiTokenMountPath = "/stroom/auth" LogSenderDefaultCpuLimit = "500m" LogSenderDefaultMemoryLimit = "256Mi" )
const (
MaximumMetricRetentionPeriodMins = 60
)
Variables ¶
var StaticFiles embed.FS
Functions ¶
func CloseDatabase ¶
func GetDatabaseConnectionInfo ¶
func GetDatabaseConnectionInfo(client client.Client, ctx context.Context, dbRef *stroomv1.DatabaseServerRef, ownerNamespace string, dbConnectionInfo *DatabaseConnectionInfo) error
Types ¶
type DatabaseBackupReconciler ¶
DatabaseBackupReconciler reconciles a DatabaseBackup object
func (*DatabaseBackupReconciler) Reconcile ¶
func (r *DatabaseBackupReconciler) 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 (*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 ¶
DatabaseServerReconciler reconciles a DatabaseServer object
func (*DatabaseServerReconciler) Reconcile ¶
func (r *DatabaseServerReconciler) 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 (*DatabaseServerReconciler) SetupWithManager ¶
func (r *DatabaseServerReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type StroomClusterReconciler ¶
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 ¶
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 ¶
type StroomTaskAutoscalerReconciler ¶
type StroomTaskAutoscalerReconciler struct { client.Client Scheme *runtime.Scheme Log logr.Logger Metrics StroomNodeMetricMap }
StroomTaskAutoscalerReconciler reconciles a StroomTaskAutoscaler object
func (*StroomTaskAutoscalerReconciler) Reconcile ¶
func (r *StroomTaskAutoscalerReconciler) 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 (*StroomTaskAutoscalerReconciler) SetupWithManager ¶
func (r *StroomTaskAutoscalerReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.