Package org.jdrupes.vmoperator.manager
Class Controller
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jdrupes.vmoperator.manager.Controller
- All Implemented Interfaces:
- Iterable<ComponentType>,- Channel,- ComponentType,- Eligible,- Manager
Implements a controller as defined in the
Operator Whitepaper.
The implementation splits the controller in two components. The
VmMonitor and the Reconciler. The former watches
the VM definitions (CRs) and generates VmResourceChanged events
when they change. The latter handles the changes and reconciles the
resources in the cluster.
The controller itself supports a single configuration property:
"/Manager":
  "/Controller":
    namespace: vmop-dev
This may only be set when running the Manager (and thus the Controller) outside a container during development.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.jgrapes.core.ChannelChannel.Default
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidonAssignVm(AssignVm event) Assign a VM if not already assigned.voidConfigure the component.voidReturns the VM data.voidonHandlingError(HandlingError event) Special handling ofApiExceptionthrown by handlers.voidonPodChange(PodChanged event, VmChannel channel) Remove runner version from status when pod is deletedvoidonPoolChanged(VmPoolChanged event) When s pool is deleted, remove all related assignments.voidHandle the start event.Methods inherited from class org.jgrapes.core.Componentchannel, component, defaultCriterion, isEligibleFor, setNameMethods inherited from class org.jgrapes.core.internal.ComponentVertexactiveEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGeneratorMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
ControllerCreates a new instance.
 
- 
- 
Method Details- 
onHandlingErrorSpecial handling ofApiExceptionthrown by handlers.- Parameters:
- event- the event
 
- 
onConfigurationUpdateConfigure the component.- Parameters:
- event- the event
 
- 
onStart@Handler(priority=100) public void onStart(Start event) throws IOException, io.kubernetes.client.openapi.ApiException Handle the start event.Has higher priority because it configures the default Kubernetes client. - Parameters:
- event- the event
- Throws:
- IOException
- io.kubernetes.client.openapi.ApiException
 
- 
onGetVmsReturns the VM data.- Parameters:
- event- the event
 
- 
onAssignVm@Handler public void onAssignVm(AssignVm event) throws io.kubernetes.client.openapi.ApiException, InterruptedException Assign a VM if not already assigned.- Parameters:
- event- the event
- Throws:
- io.kubernetes.client.openapi.ApiException- the api exception
- InterruptedException
 
- 
onPoolChangedWhen s pool is deleted, remove all related assignments.- Parameters:
- event- the event
- Throws:
- InterruptedException
 
- 
onPodChange@Handler public void onPodChange(PodChanged event, VmChannel channel) throws io.kubernetes.client.openapi.ApiException Remove runner version from status when pod is deleted- Parameters:
- event- the event
- channel- the channel
- Throws:
- io.kubernetes.client.openapi.ApiException- the api exception
 
 
-