Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-25963 FLIP-212: Introduce Flink Kubernetes Operator
  3. FLINK-26660

Specify EventSource when watching multiple namespaces

    XMLWordPrintableJSON

Details

    Description

      Currently when watching multiple namespaces, for example via the following command:

       

      kubectl create ns flink-system
      kubectl create ns flink-prod
      kubectl create ns flink-user
      helm install --namespace flink-system --set "watchNamespaces={flink-prod,flink-user}" flink-operator helm/flink-operator 

       

      The operator itself comes up healthy, but on FlinkDeployment submission and is unable to reconcile:

       

      # Modify the example to deploy to flink-prod namespace!
      kubectl create -f examples/basic.yaml 

      The operator log show the following:

      flink-operator 2022-03-15 16:06:40,694 i.j.o.p.e.ReconciliationDispatcher [ERROR] Error during event processing ExecutionScope{ resource id: CustomResourceID{name= │
      │ 'basic-example', namespace='flink-prod'}, version: 12332} failed.                                                                                                   │
      │ flink-operator org.apache.flink.kubernetes.operator.exception.ReconciliationException: java.lang.IllegalArgumentException: There are multiple EventSources register │
      │ ed for type io.fabric8.kubernetes.api.model.apps.Deployment, you need to provide a name to specify which EventSource you want to query. Known names: null-flink-pro │
      │ d,null-flink-user                                                                                                                                                   │
      │ flink-operator     at org.apache.flink.kubernetes.operator.controller.FlinkDeploymentController.reconcile(FlinkDeploymentController.java:131)                       │
      │ flink-operator     at org.apache.flink.kubernetes.operator.controller.FlinkDeploymentController.reconcile(FlinkDeploymentController.java:57)                        │
      │ flink-operator     at io.javaoperatorsdk.operator.processing.Controller$2.execute(Controller.java:101)                                                              │
      │ flink-operator     at io.javaoperatorsdk.operator.processing.Controller$2.execute(Controller.java:76)                                                               │
      │ flink-operator     at io.javaoperatorsdk.operator.api.monitoring.Metrics.timeControllerExecution(Metrics.java:34)                                                   │
      │ flink-operator     at io.javaoperatorsdk.operator.processing.Controller.reconcile(Controller.java:75)                                                               │
      │ flink-operator     at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.reconcileExecution(ReconciliationDispatcher.java:151)                   │
      │ flink-operator     at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.handleReconcile(ReconciliationDispatcher.java:117)                      │
      │ flink-operator     at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.handleDispatch(ReconciliationDispatcher.java:82)                        │
      │ flink-operator     at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.handleExecution(ReconciliationDispatcher.java:51)                       │
      │ flink-operator     at io.javaoperatorsdk.operator.processing.event.EventProcessor$ControllerExecution.run(EventProcessor.java:385)                                  │
      │ flink-operator     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)                                                                   │
      │ flink-operator     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)                                                                  │
      │ flink-operator     at java.base/java.lang.Thread.run(Unknown Source)                                                                                                │
      │ flink-operator Caused by: java.lang.IllegalArgumentException: There are multiple EventSources registered for type io.fabric8.kubernetes.api.model.apps.Deployment,  │
      │ you need to provide a name to specify which EventSource you want to query. Known names: null-flink-prod,null-flink-user                                             │
      │ flink-operator     at io.javaoperatorsdk.operator.processing.event.EventSourceManager$EventSources.get(EventSourceManager.java:266)                                 │
      │ flink-operator     at io.javaoperatorsdk.operator.processing.event.EventSourceManager.getResourceEventSourceFor(EventSourceManager.java:163)                        │
      │ flink-operator     at io.javaoperatorsdk.operator.api.reconciler.DefaultContext.getSecondaryResource(DefaultContext.java:28)                                        │
      │ flink-operator     at io.javaoperatorsdk.operator.api.reconciler.Context.getSecondaryResource(Context.java:10)                                                      │
      │ flink-operator     at org.apache.flink.kubernetes.operator.observer.BaseObserver.observeJmDeployment(BaseObserver.java:69)                                          │
      │ flink-operator     at org.apache.flink.kubernetes.operator.observer.JobObserver.observe(JobObserver.java:49)                                                        │
      │ flink-operator     at org.apache.flink.kubernetes.operator.controller.FlinkDeploymentController.reconcile(FlinkDeploymentController.java:124)                       │
      │ flink-operator     ... 13 more 

       

      Attachments

        Issue Links

          Activity

            People

              gyfora Gyula Fora
              mbalassi Márton Balassi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: