Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-2009

User should be warned that MetalLB controller pod config node affinity cannot have weight 0

XMLWordPrintable

    • Moderate
    • None
    • 1
    • OCP VE Sprint 228
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      The metallb controller pod is not created if the YAML has weight to be zero (valid values 1-100). The error message is logged in metallb-operator-controller-manager
      
      
      1.6649185044360003e+09    ERROR    Reconciler error    {"controller": "metallb", "controllerGroup": "metallb.io", "controllerKind": "MetalLB", "metalLB": {"name":"metallb","namespace":"metallb-system"}, "namespace": "metallb-system", "name": "metallb", "reconcileID": "1577360a-b53c-45e9-a67a-c8dba8c2a251", "error": "FailedToSyncMetalLBResources: could not apply (apps/v1, Kind=Deployment) metallb-system/controller: Deployment.apps \"controller\" is invalid: spec.template.spec.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].weight: Invalid value: 0: must be in the range 1-100", "errorVerbose": "Deployment.apps \"controller\" is invalid: spec.template.spec.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].weight: Invalid value: 0: must be in the range 1-100\ncould not apply (apps/v1, Kind=Deployment) metallb-system/controller\ngithub.com/metallb/metallb-operator/controllers.(*MetalLBReconciler).syncMetalLBResources\n\t/workspace/controllers/metallb_controller.go:169\ngithub.com/metallb/metallb-operator/controllers.(*MetalLBReconciler).reconcileResource\n\t/workspace/controllers/metallb_controller.go:116\ngithub.com/metallb/metallb-operator/controllers.(*MetalLBReconciler).Reconcile\n\t/workspace/controllers/metallb_controller.go:100\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:121\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:320\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:234\nruntime.goexit\n\t/usr/lib/golang/src/runtime/asm_amd64.s:1571\nFailedToSyncMetalLBResources\ngithub.com/metallb/metallb-operator/controllers.(*MetalLBReconciler).reconcileResource\n\t/workspace/controllers/metallb_controller.go:118\ngithub.com/metallb/metallb-operator/controllers.(*MetalLBReconciler).Reconcile\n\t/workspace/controllers/metallb_controller.go:100\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:121\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:320\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:273\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:234\nruntime.goexit\n\t/usr/lib/golang/src/runtime/asm_amd64.s:1571"}
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
          /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:273
      sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
          /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:234
      
      
      As the controller pod is not created at all the speakers are stuck as below:-
      oc get pods -n metallb-system
      NAME                                                   READY   STATUS                       RESTARTS   AGE
      metallb-operator-controller-manager-6bddfc4fd8-zk2cb   1/1     Running                      0          7h2m
      metallb-operator-webhook-server-65dd5ddb94-qc4gm       1/1     Running                      0          7h2m
      speaker-fq7zx                                          5/6     CreateContainerConfigError   0          36m
      speaker-qdrj8                                          5/6     CreateContainerConfigError   0          36m
      speaker-w858k                                          5/6     CreateContainerConfigError   0          36m
      speaker-wmq6m                                          5/6     CreateContainerConfigError   0          36m
      speaker-xjxgf                                          5/6     CreateContainerConfigError   0          36m
      

      Version-Release number of selected component (if applicable):

      4.12

      How reproducible:

      Always

      Steps to Reproduce:

      1.Install metallb operator 
      2. Create a metallb CR with YAML below to see the issue. apiVersion: metallb.io/v1beta1
      kind: MetalLB
      metadata:
        name: metallb
        namespace: metallb-system
      spec:
        controllerConfig:
          affinity:
            nodeAffinity:
              preferredDuringSchedulingIgnoredDuringExecution:
                - preference:
                    matchExpressions:
                      - values:
                          - east
                        key: zone
                        operator: In
                  weight: 0
        speakerConfig:
          affinity:
            nodeAffinity:
              preferredDuringSchedulingIgnoredDuringExecution:
                - preference:
                    matchExpressions:
                      - values:
                          - west
                        key: zone
                        operator: In
                  weight: 1
        logLevel: debug 

      Actual results:

      Controller pod and speaker pods not created

      Expected results:

      User be warned about invalid value.
      User provides valid values and the pods are created successfully.

      Additional info:

       

       

       

              pepalani@redhat.com Periyasamy Palanisamy
              rhn-support-asood Arti Sood
              Arti Sood Arti Sood
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: