Documentation ¶
Index ¶
- Variables
- func AddFinalizerIfNotPresent(ctx context.Context, generalClient client.Client, object client.Object, ...) (bool, error)
- func AnnotateIfNotPresent(ctx context.Context, generalClient client.Client, object client.Object, ...) (bool, error)
- func AnnotateObject(ctx context.Context, generalClient client.Client, object client.Object, ...) (bool, error)
- func GetMetadata(resourceName, hash string, object client.Object, kind schema.GroupVersionKind) metav1.ObjectMeta
- func GetOrchestLabelSelector(object client.Object) (labels.Selector, error)
- func GetOrchestMatchLabels(object client.Object) map[string]string
- func GetRbacManifest(metadata metav1.ObjectMeta) []client.Object
- func GetResourceLables(resourceName, hash string, object client.Object) map[string]string
- func GetResourceMatchLables(resourceName string, object client.Object) map[string]string
- func IsComponentReady(component orchestv1alpha1.OrchestComponent) bool
- func IsNginxIngressClass(name string) bool
- func RemoveAnnotation(ctx context.Context, generalClient client.Client, object client.Object, ...) (bool, error)
- func RemoveFinalizerIfPresent(ctx context.Context, generalClient client.Client, object client.Object, ...) (bool, error)
- func UpsertObject(ctx context.Context, generalClient client.Client, object client.Object) error
- type ControleeGetterFunction
- type Controller
- type SyncHandlerFunction
- type Watcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //Components OrchestDatabase = "orchest-database" OrchestApi = "orchest-api" OrchestApiCleanup = "orchest-api-cleanup" Rabbitmq = "rabbitmq-server" CeleryWorker = "celery-worker" AuthServer = "auth-server" OrchestWebserver = "orchest-webserver" NodeAgent = "node-agent" BuildKitDaemon = "buildkit-daemon" // PVC names UserDirName = "userdir-pvc" OrchestStateVolumeName = "orchest-state" // Deprecated, the PVC is removed. OldBuilderDirName = "image-builder-cache-pvc" // Mount paths UserdirMountPath = "/userdir" OrchestStateMountPath = "/orchest/state" // database paths DBMountPath = "/userdir/.orchest/database/data" DBSubPath = ".orchest/database/data" // rabbitmq paths RabbitmountPath = "/var/lib/rabbitmq/mnesia" RabbitSubPath = ".orchest/rabbitmq-mnesia" // Ingress constants PrefixPathType = netsv1.PathType("Prefix") // Labels and Annotations OrchestHashLabelKey = "orchest.io/orchest-hash" DeploymentHashLabelKey = "orchest.io/deployment-hash" GenerationKey = "controller.orchest.io/generation" OwnerLabelKey = "controller.orchest.io/owner" ControllerPartOfLabel = "controller.orchest.io/part-of" ComponentLabelKey = "controller.orchest.io/component" K8sDistroAnnotationKey = "controller.orchest.io/k8s" IngressAnnotationKey = "controller.orchest.io/deploy-ingress" RestartAnnotationKey = "orchest.io/restart" // Runtime annotations KubeAdmCRISocketAnnotationKey = "kubeadm.alpha.kubernetes.io/cri-socket" ContainerRuntimeSocketPathAnnotationKey = "orchest.io/container-runtime-socket" )
View Source
var (
KeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc
)
Functions ¶
func AddFinalizerIfNotPresent ¶
func AddFinalizerIfNotPresent(ctx context.Context, generalClient client.Client, object client.Object, finalizer string) (bool, error)
AddFinalizer adds specified finalizer string to object
func AnnotateIfNotPresent ¶
func AnnotateObject ¶
func GetMetadata ¶
func GetMetadata(resourceName, hash string, object client.Object, kind schema.GroupVersionKind) metav1.ObjectMeta
func GetOrchestLabelSelector ¶
func GetRbacManifest ¶
func GetRbacManifest(metadata metav1.ObjectMeta) []client.Object
func GetResourceLables ¶
func GetResourceMatchLables ¶
func IsComponentReady ¶
func IsComponentReady(component orchestv1alpha1.OrchestComponent) bool
IsComponentReady checks if the OrchestComponent is ready or not
func IsNginxIngressClass ¶
IsComponentReady checks if the OrchestComponent is ready or not
func RemoveAnnotation ¶
Types ¶
type ControleeGetterFunction ¶
type Controller ¶
type Controller[Object client.Object] struct { // sync function SyncHandler SyncHandlerFunction // The lister of controlee ControleeGetter ControleeGetterFunction // the list of informerSynced InformerSyncedList []cache.InformerSynced // contains filtered or unexported fields }
OrchestClusterController reconciles OrchestCluster CRD.
func NewController ¶
func NewController[Object client.Object](name string, threadiness int, kubeClient kubernetes.Interface, gvk *schema.GroupVersionKind) *Controller[Object]
func (*Controller[Object]) Client ¶
func (c *Controller[Object]) Client() kubernetes.Interface
func (*Controller[Object]) Enqueue ¶
func (c *Controller[Object]) Enqueue(obj interface{})
func (*Controller[Object]) EnqueueAfter ¶
func (c *Controller[Object]) EnqueueAfter(obj interface{})
func (*Controller[Object]) Run ¶
func (c *Controller[Object]) Run(stopCh <-chan struct{})
Run will not return until stopCh is closed. workers determines how many objects will be handled in parallel.
type Watcher ¶
type Watcher[WatchObject, ControllerObject client.Object] struct { *Controller[ControllerObject] // contains filtered or unexported fields }
func NewControlleeWatcher ¶
func NewControlleeWatcher[WatchObject, ControllerObject client.Object](ctrl *Controller[ControllerObject]) Watcher[WatchObject, ControllerObject]
func NewControllerWatcher ¶
func NewControllerWatcher[ControllerObject client.Object](ctrl *Controller[ControllerObject]) Watcher[ControllerObject, ControllerObject]
func (*Watcher[WatchObject, ControllerObject]) AddObject ¶
func (w *Watcher[WatchObject, ControllerObject]) AddObject(obj interface{})
func (*Watcher[WatchObject, ControllerObject]) DeleteObject ¶
func (w *Watcher[WatchObject, ControllerObject]) DeleteObject(obj interface{})
func (*Watcher[WatchObject, ControllerObject]) UpdateObject ¶
func (w *Watcher[WatchObject, ControllerObject]) UpdateObject(old, cur interface{})
Click to show internal directories.
Click to hide internal directories.