Class Controller

All Implemented Interfaces:
Iterable<ComponentType>, Channel, ComponentType, Eligible, Manager

public class Controller extends Component
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 VmDefChanged 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.

Controller components

  • Constructor Details

  • Method Details

    • onHandlingError

      Special handling of ApiException thrown by handlers.
      Parameters:
      event - the event
    • onConfigurationUpdate

      Configure 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
    • onModifyVm

      @Handler public void onModifyVm(ModifyVm event, VmChannel channel) throws io.kubernetes.client.openapi.ApiException, IOException
      On modify vm.
      Parameters:
      event - the event
      Throws:
      io.kubernetes.client.openapi.ApiException - the api exception
      IOException - Signals that an I/O exception has occurred.
    • onUpdatedAssignment

      @Handler public void onUpdatedAssignment(UpdateAssignment event, VmChannel channel) throws io.kubernetes.client.openapi.ApiException
      Attempt to Update the assignment information in the status of the VM CR.

      Returns true if successful. The handler does not attempt retries, because in case of failure it will be necessary to re-evaluate the chosen VM.

      Parameters:
      event - the event
      channel - the channel
      Throws:
      io.kubernetes.client.openapi.ApiException - the api exception