Skip to content

Latest commit

 

History

History
33 lines (16 loc) · 1.39 KB

selective_controller_init.md

File metadata and controls

33 lines (16 loc) · 1.39 KB

Selective initilization of controllers

Overview

There are multiple controllers with in the project and the controller have dependency to specific kubernetes API resources.

When a required resource for the specific controller is not present the controller should not be started.

Behaviors

If the manadatory kubernete resource is not present, the operator will not start the corresponding controller that depended on the resource. The main() function of the operator have a monitor go routine for the kubernete API resources. Once the missing manadatory kubernete resource was installed, the operator will gracefully shutdown and kubernetes will restart the pod. Once the pod have restarted, the controller cluster deployment based on hive will be started.

Controller and their manadatory resources

controller/managedcluster-import

  • clusterdeployments.hive.openshift.io/v1
  • cluster.open-cluster-management.io/v1

controller/csr

  • certificates.k8s.io/v1beta1

Development note

The main controller package controller/controller generated by operator-sdk was modified in order to implement this behavior.

In the future if we need to add a new controller modification need to be done to the controller/add_<controllername>.go file generated by the operator-sdk. (for example refer to `add_clusterdeployment.go)