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

[Vector] Basic auth credentials are not added to the generated Vector config

XMLWordPrintable

      Description of the problem:

      When a ClusterLogForwarder to forward logs to external elasticsearch is created with a secret containing basic auth creds, the creds are not added to the generated Vector config.

      Steps to reproduce the issue:

      1 Create a ClusterLogging instance with Vector as the collector.

      2 Create a secret with basic auth.

      oc create secret generic pipelinesecret --from-literal=username=redhat --from-literal=password=redhat
      
      oc get secrets pipelinesecret -o yaml
      apiVersion: v1
      data:
        password: cmVkaGF0
        username: cmVkaGF0
      kind: Secret
      metadata:
        creationTimestamp: "2021-12-17T07:49:07Z"
        name: pipelinesecret
        namespace: openshift-logging
        resourceVersion: "104959"
        uid: 9ad89b6b-a002-4e77-b1bd-a8274ad01811
      type: Opaque

      3 Create a ClusterLogForwarder instance to forward logs to an external elasticsearch instance and containing the basic auth secret.

      apiVersion: logging.openshift.io/v1
      kind: ClusterLogForwarder
      metadata:
        name: instance
        namespace: openshift-logging
      spec:
        outputs:
        - name: es-created-by-user
          type: elasticsearch
          url: 'http://elasticsearch-server.openshift-logging.svc:9200'
          secret:
            name: pipelinesecret
        pipelines:
        - name: forward-to-external-es
          inputRefs:
          - infrastructure
          - application
          - audit
          outputRefs:
          - es-created-by-user
      

      4 Extract and check the generated Vector config.

      oc extract cm/collector
      
      [sinks.es_created_by_user]
      type = "elasticsearch"
      inputs = ["elasticsearch_preprocess"]
      endpoint = "http://elasticsearch-server.openshift-logging.svc:9200"
      index = "{{ log_type }}-write"
      request.timeout_secs = 2147483648
      bulk_action = "create"
      id_key = "_id"
      # Basic Auth Config
      [sinks.es_created_by_user.auth]
      strategy = "basic"
      user = ""
      password = "" 

        1. cr_fwd_2076.yaml
          0.4 kB
        2. cr_2076.yaml
          0.7 kB

              aguptaredhat Ajay Gupta (Inactive)
              rhn-support-ikanse Ishwar Kanse
              Ishwar Kanse Ishwar Kanse
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: