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

kmm-hub failing to build driver

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • 4.16
    • 4.14.z
    • kmm
    • None
    • No
    • False
    • Hide

      None

      Show
      None
    • The DTK_AUTO build argument is now provided to Hub builds.
    • Bug Fix
    • In Progress

      Description of problem:

      kmm-hub failing to build driver

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

      OCP 4.14.11
      kernel-module-management-hub.v2.0.2

      How reproducible:

      Steps to Reproduce:

      1. Deploy OCP 4.14.11 cluster with ACM
      [root@cnfdt17-installer ~]# oc get node
      NAME                                  STATUS   ROLES                          AGE    VERSION
      dhcp-97-113.lab.eng.tlv2.redhat.com   Ready    control-plane,master,virtual   2d5h   v1.27.10+28ed2d7
      dhcp-97-138.lab.eng.tlv2.redhat.com   Ready    control-plane,master,virtual   2d5h   v1.27.10+28ed2d7
      dhcp-97-152.lab.eng.tlv2.redhat.com   Ready    worker                         2d4h   v1.27.10+28ed2d7
      dhcp-97-217.lab.eng.tlv2.redhat.com   Ready    worker                         2d4h   v1.27.10+28ed2d7
      dhcp-97-98.lab.eng.tlv2.redhat.com    Ready    control-plane,master,virtual   2d5h   v1.27.10+28ed2d7
      [root@cnfdt17-installer ~]# oc get clusterversion
      NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
      version   4.14.11   True        False         2d4h    Cluster version is 4.14.11
          
      2. Deploy SNO 4.14.11 and import to the hub cluster
      [kni@cnfdt2 sabina]$ oc get node
      NAME                              STATUS   ROLES                         AGE   VERSION
      cnfdt12.lab.eng.tlv2.redhat.com   Ready    control-plane,master,worker   2d    v1.27.10+28ed2d7
      
      [root@cnfdt17-installer ~]# oc get managedcluster
      4NAME            HUB ACCEPTED   MANAGED CLUSTER URLS                               JOINED   AVAILABLE   AGE
      cnfdt12         true           https://api.cnfdt12.lab.eng.tlv2.redhat.com:6443   True     True        30h
      local-cluster   true           https://api.cnfdt17.lab.eng.tlv2.redhat.com:6443   True     True        2d4h
      
      3. Install kmm-hub:
      https://docs.openshift.com/container-platform/4.14/hardware_enablement/kmm-kernel-module-management.html#kmm-hub-installing-kmm-hub-creating-resources_kernel-module-management-operator
      
      4. Use RHACM policy to install KMM on the spoke cluster:
      https://docs.openshift.com/container-platform/4.14/hardware_enablement/kmm-kernel-module-management.html#kmm-hub-running-kmm-on-the-spoke_kernel-module-management-operator
      
      5. Apply the following to build and sign the kmm-ci driver
      ---
      apiVersion: v1
      kind: ConfigMap
      metadata:
        name: example-module-dockerfile
        namespace: default 
      data:
        dockerfile: |
          ARG DTK_AUTO
          ARG KERNEL_VERSION
          FROM ${DTK_AUTO} as builder
          WORKDIR /build/
          RUN git clone -b main --single-branch https://github.com/rh-ecosystem-edge/kernel-module-management.git
          WORKDIR kernel-module-management/ci/kmm-kmod/
          RUN make
          FROM registry.access.redhat.com/ubi9/ubi:latest
          ARG KERNEL_VERSION
          RUN yum -y install kmod && yum clean all
          RUN mkdir -p /opt/lib/modules/${KERNEL_VERSION}
          COPY --from=builder /build/kernel-module-management/ci/kmm-kmod/*.ko /opt/lib/modules/${KERNEL_VERSION}/
          RUN /usr/sbin/depmod -b /opt
      ---
      apiVersion: hub.kmm.sigs.x-k8s.io/v1beta1
      kind: ManagedClusterModule
      metadata:
        name: example-module
      spec:
        moduleSpec: 
          moduleLoader:
            container:
              modprobe:
                moduleName: kmm_ci_a
              kernelMappings:
                - regexp: '^.*\.x86_64$'
                  containerImage: quay.io/saledort/kmm-ci-driver:final-default_example-module_kmm_unsigned
                  build:
                    dockerfileConfigMap:
                      name: example-module-dockerfile
                  sign:
                    keySecret:
                      name: kmm-kmod-signing-key
                    certSecret:
                      name: kmm-kmod-signing-cert
                    filesToSign:
                      - /opt/lib/modules/5.14.0-284.48.1.el9_2.x86_64/kmm_ci_a.ko
          imageRepoSecret: 
            name: saledort-repo-pull-secret
          selector: # top-level selector
            kubernetes.io/arch: amd64
        spokeNamespace: cnfdt12
        selector: 
          name: cnfdt12
      
      

      Actual results:

      1. kmm-hub controller expecting both the repo secret and the configmap be in openshift-kmm-hub namespace resulting these errors:
      
      mm_unsigned: cannot get keychain from the registry auth getter: cannot find secret openshift-kmm-hub/saledort-repo-pull-secret: Secret \"saledort-repo-pull-secret\" not found" "ManagedClusterModule"={"name":"example-module"} "cluster"="cnfdt12" "controller"="ManagedClusterModule" "controllerGroup"="hub.kmm.sigs.x-k8s.io" "controllerKind"="ManagedClusterModule" "name"="example-module" "namespace"="" "reconcileID"="947c3bb2-cac3-44c2-9f14-abe9516cf6e0"
      
      ClusterModule"={"name":"example-module"} "controller"="ManagedClusterModule" "controllerGroup"="hub.kmm.sigs.x-k8s.io" "controllerKind"="ManagedClusterModule" "name"="example-module" "namespace"="" "reconcileID"="788bd98a-813d-4d1a-9e2e-419d4d65e12f"E0221 14:30:28.790993       1 managedclustermodule_reconciler.go:112] kmm-hub "msg"="failed to build" "error"="could not synchronize the build: could not make Build template: failed to get dockerfile data from configmap: failed to get dockerfile ConfigMap openshift-kmm-hub/example-module-dockerfile: ConfigMap \"example-module-dockerfile\" not found" "ManagedClusterModule"={"name":"example-module"} "cluster"="cnfdt12" "controller"="ManagedClusterModule" "controllerGroup"="hub.kmm.sigs.x-k8s.io" "controllerKind"="ManagedClusterModule" "name"="example-module" "namespace"="" "reconcileID"="788bd98a-813d-4d1a-9e2e-419d4d65e12f"
      
      2. Building the driver failing with the following error even tough both hub and spoke are on the same OCP version and kernel
      
      [root@cnfdt17-installer ~]# oc get node dhcp-97-113.lab.eng.tlv2.redhat.com -o jsonpath={.status.nodeInfo.kernelVersion}
      5.14.0-284.50.1.el9_2.x86_64
      
      [kni@cnfdt2 sabina]$ oc get node cnfdt12.lab.eng.tlv2.redhat.com -o jsonpath={.status.nodeInfo.kernelVersion}
      5.14.0-284.50.1.el9_2.x86_64
      
      I0221 14:55:16.327067       1 managedclustermodule_reconciler.go:99] kmm-hub "msg"="Requested KMMO ManagedClusterModule" "ManagedClusterModule"={"name":"example-module"} "controller"="ManagedClusterModule" "controllerGroup"="hub.kmm.sigs.x-k8s.io" "controllerKind"="ManagedClusterModule" "name"="example-module" "namespace"="" "reconcileID"="f3bb3b8a-c361-46dd-8621-200608cccd1a"E0221 14:55:17.599713       1 managedclustermodule_reconciler.go:112] kmm-hub "msg"="failed to build" "error"="could not synchronize the build: could not make Build template: could not get DTK image for kernel 5.14.0-284.50.1.el9_2.x86_64: could not find kernel 5.14.0-284.50.1.el9_2.x86_64 in kernel --> OS mapping" "ManagedClusterModule"={"name":"example-module"} "cluster"="cnfdt12" "controller"="ManagedClusterModule" "controllerGroup"="hub.kmm.sigs.x-k8s.io" "controllerKind"="ManagedClusterModule" "name"="example-module" "namespace"="" "reconcileID"="f3bb3b8a-c361-46dd-8621-200608cccd1a"

      Expected results:

      The driver should be built and signed     

      Additional info:

          

              qbarrand@redhat.com Quentin Barrand (Inactive)
              saledort@redhat.com Sabina Aledort
              Constantin Daniel Vultur Constantin Daniel Vultur
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: