kube-logging / logging-operator

Logging operator for Kubernetes
https://kube-logging.dev
Apache License 2.0
1.56k stars 331 forks source link

eventTailer: Missing documented EventTailerSpec image (*tailer.ImageSpec, optional) #1654

Closed pbdger closed 7 months ago

pbdger commented 10 months ago

In the latest documentation of the eventtailer (https://kube-logging.dev/docs/configuration/crds/extensions/eventtailer_types/) you find the specs to define image specs.

Expected behaviour:

The CRD of the eventtailer should contain the image specs, e.g.

spec:
  controlNamespace: logging
  image:
    pullPolicy: Always
    repository: myownrepo/kube-logging/eventrouter
    tag: v0.1.0

A concise description of what you expected to happen.

Steps to reproduce the bug:

Add the spec as shown above in the values.yaml of the Helm chart.

Environment details:

Bug: The CRD contains no image spec information.

OverOrion commented 10 months ago

Hey @pbdger, the CRD for the EventTailer seems to contain image specs: https://github.com/kube-logging/logging-operator/blob/e87e3e2df4f422be21f00360de6d45e9ffb29cfa/charts/logging-operator/crds/logging-extensions.banzaicloud.io_eventtailers.yaml#L314

Could you share your yaml config used?

pbdger commented 10 months ago

We set the values for Helm chart via Flux. The code looks like

---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: logging-operator
spec:
  chart:
    spec:
      sourceRef:
        kind: HelmRepository
        name: myhelmrepository
        namespace: mynamespace
      chart: logging-operator
      version: "4.5.1"
      interval: 10m
  values:
    logging:
      enabled: true
      fluentbit:
        image:
          repository: myrepo/fluent/fluent-bit
      eventTailer:
        image:
          repository: my/kube-logging/eventrouter
          tag: "v0.1.0"
          pullPolicy: "Always"
        workloadMetaOverrides:
          labels:
            "gnp.phoenix.local/k8s-api-access": "read-events"

The outcome of the generated CRD contains for EventTailerSpec the workloadMetaOverrides specs but no data for image specs.

The CRD looks like

...
spec:
  controlNamespace: logging
  workloadMetaOverrides:
    labels:
      gnp.phoenix.local/k8s-api-access: read-events

So the image specs are not created via logging operator the the event trailer CRD.

In the example shown above a fluentd image spec is defined, too. This is created for CRD logging-operator as expected.

pepov commented 10 months ago

at the moment you can use

containerOverrides:
  image: "my/kube-logging/eventrouter:v0.1.0"
  pullPolicy: "Always"

but I understand the helm chart is missing the image field, so the issue is valid

pbdger commented 10 months ago

Thx @pepov for the workaround.

I've found a fix in the pipeline (https://github.com/kube-logging/logging-operator/pull/1576). I hope it's coming soon.

pepov commented 10 months ago

@pbdger It would need some testing (I don't have the time for it), but let me know if I can help (for example with a dev release if needed)

pbdger commented 10 months ago

@pepov If you create a dev release, I will be happy to test it.

pepov commented 10 months ago

@pbdger

helm fetch oci://ghcr.io/kube-logging/helm-charts/logging-operator --version 4.6.0-branch.event-tailer-chart-up.0

https://github.com/kube-logging/logging-operator/actions/runs/7716262509

pbdger commented 10 months ago

Great. I'll start the test on tomorrow.

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

genofire commented 5 months ago

it was solved with https://github.com/kube-logging/logging-operator/pull/1674 but additional changes like the same for hostTailer are in: https://github.com/kube-logging/logging-operator/pull/1576