controller

package
v0.0.0-...-c3c3f06 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeLayout = "15:04"

	GoodnightPrefix = "goodnight.joshmeyer.dev"

	AwakeTimeLabel     = "goodnight.joshmeyer.dev/awake-time"
	AwakeReplicasLabel = "goodnight.joshmeyer.dev/awake-replicas"
	SleepTimeLabel     = "goodnight.joshmeyer.dev/sleep-time"
	SleepReplicasLabel = "goodnight.joshmeyer.dev/sleep-replicas"

	IsSleepingLabel = "goodnight.joshmeyer.dev/sleeping"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GoodnightDeploymentReconciler

type GoodnightDeploymentReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	SleepList
}

GoodnightDeploymentReconciler reconciles a GoodnightDeployment object

func (*GoodnightDeploymentReconciler) EnterSandman

func (*GoodnightDeploymentReconciler) LoadDeployments

func (r *GoodnightDeploymentReconciler) LoadDeployments(ctx context.Context)

func (*GoodnightDeploymentReconciler) Monitor

func (*GoodnightDeploymentReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the GoodnightDeployment object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

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

func (*GoodnightDeploymentReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type SleepList

type SleepList struct {
	sync.RWMutex
	SleepyDeployments map[string]SleepyDeployment
}

type SleepyDeployment

type SleepyDeployment struct {
	Deployment    *appsv1.Deployment
	AwakeTime     time.Time
	AwakeReplicas int32
	SleepTime     time.Time
	SleepReplicas int32
}

Jump to

Keyboard shortcuts

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