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

keda-operator is missing files in /usr/share/zoneinfo from tzdata causing cron triggers with timezone set to fail

    XMLWordPrintable

Details

    • +
    • Important
    • No
    • 2
    • OCPNODE Sprint 238 (Green)
    • 1
    • Proposed
    • False
    • Hide

      None

      Show
      None
    • Hide
      Cause:
      The custom-metrics-autoscaler and custom-metrics-autoscaler-adapter images were missing timezone information.

      Consequence:
      ScaledObjects with cron triggers failed to work because the controllers were unable to find timezone information.

      Fix:
      The image builds were updated to include timezone information.

      Result:
      ScaledObjects containing cron triggers can now function properly.
      Show
      Cause: The custom-metrics-autoscaler and custom-metrics-autoscaler-adapter images were missing timezone information. Consequence: ScaledObjects with cron triggers failed to work because the controllers were unable to find timezone information. Fix: The image builds were updated to include timezone information. Result: ScaledObjects containing cron triggers can now function properly.
    • Bug Fix
    • Proposed

    Description

      Description of problem:

      custom-metrics-autoscaler.v2.10.1-253 is failing with cron triggers when they have a timezone set as the keda-operator is missing the necessary tzdata files under /usr/share/zoneinfo. Those are being removed in the ubi8-minimal and only UTC is left there.
      
      So the below scaledobject will cause an error as reported in keda-operator
      
      #
      $ oc get scaledobject -n project-2 -o yaml cron-scaledobject
      apiVersion: keda.sh/v1alpha1
      kind: ScaledObject
      metadata:
        labels:
          scaledobject.keda.sh/name: cron-scaledobject
        name: cron-scaledobject
        namespace: project-2
      spec:
        scaleTargetRef:
          name: curl-ip
        triggers:
        - metadata:
            desiredReplicas: "2"
            end: '*/10 * * * *'
            start: '*/5 * * * *'
            timezone: Europe/Zurich
          type: cron
      #
      
      The error reported is as below:
      
      2023-06-21T11:47:52Z	ERROR	scale_handler	error getting scale decision	{"scaledObject.Namespace": "project-2", "scaledObject.Name": "cron-scaledobject", "scaler": "cronScaler", "error": "unable to load timezone. Error: unknown time zone Europe/Zurich"}
      
      When rebuilding the keda-operator image and re-install tzdata to have the files in /usr/share/zoneinfo the scaledobject can be successfully reconciled.
      
      #
      $ cat Dockerfile 
      FROM registry.redhat.io/custom-metrics-autoscaler/custom-metrics-autoscaler-rhel8:latest
      
      USER root
      RUN microdnf reinstall -y tzdata
      #
      
      The image is available on quay.io/rhn_support_sreber/cma:latest and when running the same the logs in keda-operator are as following:
      
      2023-06-21T14:58:38Z	INFO	Reconciling ScaledObject	{"controller": "scaledobject", "controllerGroup": "keda.sh", "controllerKind": "ScaledObject", "ScaledObject": {"name":"cron-scaledobject","namespace":"project-2"}, "namespace": "project-2", "name": "cron-scaledobject", "reconcileID": "6d3ae923-d3d1-4a16-9061-4601d07a2061"}
      

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

       - custom-metrics-autoscaler.v2.10.1-253
       - OpenShift Container Platform 4.12
      

      How reproducible:

       - Always
      

      Steps to Reproduce:

      1. Install OpenShift Container Platform 4.12 and Custom Metrics Autoscaler as per documentation (does not matter platform and install method)
      2. Create a ScaledObject with a cron trigger as shown above
      3. Check keda-operator logs in openshift-keda namespace
      

      Actual results:

      2023-06-21T11:47:52Z	ERROR	scale_handler	error getting scale decision	{"scaledObject.Namespace": "project-2", "scaledObject.Name": "cron-scaledobject", "scaler": "cronScaler", "error": "unable to load timezone. Error: unknown time zone Europe/Zurich"}
      

      Expected results:

      2023-06-21T14:58:38Z	INFO	Reconciling ScaledObject	{"controller": "scaledobject", "controllerGroup": "keda.sh", "controllerKind": "ScaledObject", "ScaledObject": {"name":"cron-scaledobject","namespace":"project-2"}, "namespace": "project-2", "name": "cron-scaledobject", "reconcileID": "6d3ae923-d3d1-4a16-9061-4601d07a2061"}
      

      Additional info:

       

      Attachments

        Issue Links

          Activity

            People

              joelsmith.redhat Joel Smith
              rhn-support-sreber Simon Reber
              Weinan Liu Weinan Liu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: