controllers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Environment Variable Names
	EnvPodName              = "POD_NAME"
	EnvCFInstanceIP         = "CF_INSTANCE_IP"
	EnvCFInstanceGUID       = "CF_INSTANCE_GUID"
	EnvCFInstanceInternalIP = "CF_INSTANCE_INTERNAL_IP"
	EnvCFInstanceIndex      = "CF_INSTANCE_INDEX"

	// StatefulSet Keys
	AnnotationVersion     = "korifi.cloudfoundry.org/version"
	AnnotationAppID       = "korifi.cloudfoundry.org/application-id"
	AnnotationProcessGUID = "korifi.cloudfoundry.org/process-guid"

	LabelGUID                   = "korifi.cloudfoundry.org/guid"
	LabelVersion                = "korifi.cloudfoundry.org/version"
	LabelAppGUID                = "korifi.cloudfoundry.org/app-guid"
	LabelAppWorkloadGUID        = "korifi.cloudfoundry.org/appworkload-guid"
	LabelProcessType            = "korifi.cloudfoundry.org/process-type"
	LabelStatefulSetRunnerIndex = "korifi.cloudfoundry.org/add-stsr-index"

	ApplicationContainerName = "application"

	LivenessFailureThreshold  = 4
	ReadinessFailureThreshold = 1

	PodAffinityTermWeight = 100
)
View Source
const PdbMinAvailableInstances = "50%"

Variables

This section is empty.

Functions

func CreateLivenessProbe

func CreateLivenessProbe(appWorkload korifiv1alpha1.AppWorkload) *corev1.Probe

func CreateReadinessProbe

func CreateReadinessProbe(appWorkload korifiv1alpha1.AppWorkload) *corev1.Probe

func GetStatefulSetName

func GetStatefulSetName(appWorkload korifiv1alpha1.AppWorkload) (string, error)

func MebibyteQuantity

func MebibyteQuantity(miB int64) resource.Quantity

func StatefulSetLabelSelector

func StatefulSetLabelSelector(appWorkload *korifiv1alpha1.AppWorkload) *metav1.LabelSelector

Types

type AppWorkloadReconciler

type AppWorkloadReconciler struct {
	client.Client
	Scheme *runtime.Scheme

	Log logr.Logger
	// contains filtered or unexported fields
}

AppWorkloadReconciler reconciles a AppWorkload object

func NewAppWorkloadReconciler

func NewAppWorkloadReconciler(c client.Client, scheme *runtime.Scheme, pdb PDB, log logr.Logger) *AppWorkloadReconciler

func (*AppWorkloadReconciler) Convert

func (*AppWorkloadReconciler) Reconcile

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

func (*AppWorkloadReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type PDB

type PDB interface {
	Update(ctx context.Context, statefulSet *appsv1.StatefulSet) error
}

type PDBUpdater

type PDBUpdater struct {
	// contains filtered or unexported fields
}

func NewPDBUpdater

func NewPDBUpdater(client client.Client) *PDBUpdater

func (*PDBUpdater) Update

func (c *PDBUpdater) Update(ctx context.Context, statefulSet *appsv1.StatefulSet) error

Jump to

Keyboard shortcuts

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