Uploaded image for project: 'OpenShift Logging'
  1. OpenShift Logging
  2. LOG-6033

[release-5.9] Validation for ClusterLogForwarder fails when using multiple pipelines without name

XMLWordPrintable

    • False
    • None
    • False
    • NEW
    • VERIFIED
    • Hide
      Before this update, using multiple unnamed pipelines writing to the default output in the ClusterLogForwarder caused a validation error because of duplicate autogenerated names. With this update, duplicate names are avoided when generating the pipeline names.
      Show
      Before this update, using multiple unnamed pipelines writing to the default output in the ClusterLogForwarder caused a validation error because of duplicate autogenerated names. With this update, duplicate names are avoided when generating the pipeline names.
    • Bug Fix
    • Log Collection - Sprint 259

      Description of problem:

      In LokiStack, if multiple pipelines without specified names are set to CLF, such as the following example, the CLF validation fails with "duplicate name "default_loki_pipeline_0_"".

      Sample configuration of CLF:

      apiVersion: logging.openshift.io/v1
      kind: ClusterLogForwarder
      metadata:
        name: instance
        namespace: openshift-logging
      spec:
        pipelines:
        - inputRefs:
          - infrastructure
          outputRefs:
          - default
        - inputRefs:
          - application
          outputRefs:
          - default
        - inputRefs:
          - audit
          outputRefs:
          - default
      

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

      cluster-logging.v5.9.0
      loki-operator.v5.9.0

      # oc get csv -n openshift-logging | grep -e logging -e loki
      cluster-logging.v5.9.0                 Red Hat OpenShift Logging                        5.9.0      cluster-logging.v5.8.1                            Succeeded
      loki-operator.v5.9.0                   Loki Operator                                    5.9.0      loki-operator.v5.8.1 
      

      How reproducible:

      Always

      Steps to Reproduce:

      Step1. Apply the following CLF yaml.

      # cat clf-separate.yaml
      apiVersion: logging.openshift.io/v1
      kind: ClusterLogForwarder
      metadata:
        name: instance
        namespace: openshift-logging
      spec:
        pipelines:
        - inputRefs:
          - infrastructure
          outputRefs:
          - default
        - inputRefs:
          - application
          outputRefs:
          - default
        - inputRefs:
          - audit
          outputRefs:
          - default
      
      # oc apply -f clf-separate.yaml
      

      Step2. Check pods in openshift-logging.

      # oc get pod -n openshift-logging
      NAME                                        READY   STATUS    RESTARTS   AGE
      cluster-logging-operator-5d5d644bb4-b2c4k   1/1     Running   0          25h
      logging-view-plugin-69c7b5bccd-v8mh6        1/1     Running   0          25h
      lokistack-compactor-0                       1/1     Running   0          21h
      lokistack-distributor-699c9cf4cc-qnwjx      1/1     Running   0          21h
      lokistack-gateway-58cf659768-n4974          2/2     Running   0          21h
      lokistack-gateway-58cf659768-s2srg          2/2     Running   0          21h
      lokistack-index-gateway-0                   1/1     Running   0          21h
      lokistack-ingester-0                        1/1     Running   0          21h
      lokistack-querier-866cd6d57f-w5nmd          1/1     Running   0          21h
      lokistack-query-frontend-5df4fd8dd6-vnb8t   1/1     Running   0          21h
      

      Step3. Check CLF CR.

      # oc get clf -n openshift-logging instance -o yaml
      apiVersion: logging.openshift.io/v1
      kind: ClusterLogForwarder
      metadata:
        annotations:
          kubectl.kubernetes.io/last-applied-configuration: |
            {"apiVersion":"logging.openshift.io/v1","kind":"ClusterLogForwarder","metadata":{"annotations":{},"name":"instance","namespace":"openshift-logging"},"spec":{"pipelines":[{"inputRefs":["infrastructure"],"outputRefs":["default"]},{"inputRefs":["application"],"outputRefs":["default"]},{"inputRefs":["audit"],"outputRefs":["default"]}]}}
        creationTimestamp: "2024-05-16T05:08:38Z"
        generation: 1
        name: instance
        namespace: openshift-logging
        resourceVersion: "1763302236"
        uid: 0fd28aa0-aa30-42c7-8b94-51d1bde5c254
      spec:
        pipelines:
        - inputRefs:
          - infrastructure
          outputRefs:
          - default
        - inputRefs:
          - application
          outputRefs:
          - default
        - inputRefs:
          - audit
          outputRefs:
          - default
      status:
        conditions:
        - lastTransitionTime: "2024-05-16T05:08:38Z"
          reason: ValidationFailure
          status: "False"
          type: Ready
        - lastTransitionTime: "2024-05-16T05:08:38Z"
          message: clusterlogforwarder is not ready
          reason: ValidationFailure
          status: "True"
          type: Validation
        outputs:
          default-loki-apps:
          - lastTransitionTime: "2024-05-16T05:08:38Z"
            status: "True"
            type: Ready
          default-loki-audit:
          - lastTransitionTime: "2024-05-16T05:08:38Z"
            status: "True"
            type: Ready
          default-loki-infra:
          - lastTransitionTime: "2024-05-16T05:08:38Z"
            status: "True"
            type: Ready
        pipelines:
          default_loki_pipeline_0_:
          - lastTransitionTime: "2024-05-16T05:08:38Z"
            status: "True"
            type: Ready
          pipeline_1_:
          - lastTransitionTime: "2024-05-16T05:08:38Z"
            message: duplicate name "default_loki_pipeline_0_"
            reason: Invalid
            status: "False"
            type: Ready
          pipeline_2_:
          - lastTransitionTime: "2024-05-16T05:08:38Z"
            message: duplicate name "default_loki_pipeline_0_"
            reason: Invalid
            status: "False"
            type: Ready
      

      Actual results:

      Status contains condition ValidationFailure.

      Expected results:

      The CLF works without any problems.

      Additional info:

            Unassigned Unassigned
            rojacob@redhat.com Robert Jacob
            Kabir Bharti Kabir Bharti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: