controller

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrResourceDoesNotExist is used as part of the Event 'reason' when some
	// resource is missing in yaml
	ErrResourceDoesNotExist = "ErrResourceDoesNotExist"
	// MessageResourceDoesNotExist is used for Events when some
	// resource is missing in yaml
	MessageResourceDoesNotExist = "Resource %q is missing in yaml"
	// ErrResourceExists is used as part of the Event 'reason' when an SlurmClusterCluster
	// fails to sync due to dependent resources of the same name already
	// existing.
	ErrResourceExists = "ErrResourceExists"
	// MessageResourceExists is the message used for Events when a resource
	// fails to sync due to dependent resources already existing.
	MessageResourceExists = "Resource %q of SlurmClusterClusterKind %q already exists and is not managed by SlurmClusterCluster"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KubeClusterReconciler

type KubeClusterReconciler struct {
	ctrlcommon.ClusterController
	client.Client
	Scheme *runtime.Scheme

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

KubeClusterReconciler reconciles a KubeCluster object

func NewReconciler

func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc ctrlcommon.GangSchedulingSetupFunc) *KubeClusterReconciler

func (*KubeClusterReconciler) ControllerName

func (r *KubeClusterReconciler) ControllerName() string

func (*KubeClusterReconciler) DeleteCluster

func (r *KubeClusterReconciler) DeleteCluster(metaObject metav1.Object) error

func (*KubeClusterReconciler) FilterServicesForReplicaType

func (r *KubeClusterReconciler) FilterServicesForReplicaType(services []*corev1.Service, replicaType string) ([]*corev1.Service, error)

func (*KubeClusterReconciler) GenLabelSelector

func (r *KubeClusterReconciler) GenLabelSelector(clusterName string,
	rtype v1alpha1.ReplicaType) *metav1.LabelSelector

func (*KubeClusterReconciler) GetAPIGroupVersion

func (r *KubeClusterReconciler) GetAPIGroupVersion() schema.GroupVersion

func (*KubeClusterReconciler) GetAPIGroupVersionKind

func (r *KubeClusterReconciler) GetAPIGroupVersionKind() schema.GroupVersionKind

func (*KubeClusterReconciler) GetClusterFromInformerCache

func (r *KubeClusterReconciler) GetClusterFromInformerCache(namespace, name string) (metav1.Object, error)

func (*KubeClusterReconciler) GetConfigMapForCluster

func (r *KubeClusterReconciler) GetConfigMapForCluster(kcluster *v1alpha1.KubeCluster) (*corev1.ConfigMap, error)

func (*KubeClusterReconciler) GetGroupNameLabelValue

func (r *KubeClusterReconciler) GetGroupNameLabelValue() string

func (*KubeClusterReconciler) GetPodsForCluster

func (r *KubeClusterReconciler) GetPodsForCluster(kcluster *v1alpha1.KubeCluster) ([]*corev1.Pod, error)

GetPodsForCluster returns the set of pods that this cluster should manage. It also reconciles ControllerRef by adopting/orphaning. Note that the returned Pods are pointers into the cache.

func (*KubeClusterReconciler) GetSchemaReconciler

func (r *KubeClusterReconciler) GetSchemaReconciler(clusterType v1alpha1.ClusterType) common.ClusterSchemaReconciler

func (*KubeClusterReconciler) GetServiceSlices

func (r *KubeClusterReconciler) GetServiceSlices(services []*corev1.Service, replicas int, logger *logrus.Entry) [][]*corev1.Service

GetServiceSlices returns a slice, which element is the slice of service. Assume the return object is serviceSlices, then serviceSlices[i] is an array of pointers to services corresponding to Services for replica i.

func (*KubeClusterReconciler) GetServicesForCluster

func (r *KubeClusterReconciler) GetServicesForCluster(kcluster *v1alpha1.KubeCluster) ([]*corev1.Service, error)

func (*KubeClusterReconciler) Reconcile

func (r *KubeClusterReconciler) 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.

func (*KubeClusterReconciler) SetupWithManager

func (r *KubeClusterReconciler) SetupWithManager(mgr ctrl.Manager, controllerThreads int) error

SetupWithManager sets up the controller with the Manager.

func (*KubeClusterReconciler) UpdateClusterStatus

func (r *KubeClusterReconciler) UpdateClusterStatus(
	kcluster *v1alpha1.KubeCluster,
	replicas map[v1alpha1.ReplicaType]*v1alpha1.ReplicaSpec,
	clusterStatus *v1alpha1.ClusterStatus,
) error

func (*KubeClusterReconciler) UpdateClusterStatusInApiServer

func (r *KubeClusterReconciler) UpdateClusterStatusInApiServer(
	metaObject metav1.Object,
	clusterStatus *v1alpha1.ClusterStatus,
) error

func (*KubeClusterReconciler) UpdateConfigMapInApiServer

func (r *KubeClusterReconciler) UpdateConfigMapInApiServer(metaObject metav1.Object, configMap *corev1.ConfigMap) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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