fluent-operator icon indicating copy to clipboard operation
fluent-operator copied to clipboard

Fluent Bit CR doesn't report error when the ClusterFluentBitConfig object defined in spec.fluentBitConfigName is not present

Open lseshan opened this issue 3 years ago • 2 comments

Describe the bug

Deployed a FluentBit CR with a fluentBitConfigName field set. However the corresponding, "ClusterFluentBitConfig" object is not deployed.FluentBit pod did not get deployed.

  • No Error message in FluentBit CR.

To Reproduce

Apply Below and will not see fluentBit pod deployed. And no status indicating error in the config. cat <<EOF | kubectl apply -f - apiVersion: fluentbit.fluent.io/v1alpha2 kind: FluentBit metadata: name: fluent-bit namespace: fluent labels: app.kubernetes.io/name: fluent-bit spec: image: kubesphere/fluent-bit:v1.8.11 positionDB: hostPath: path: /var/lib/fluent-bit/ resources: requests: cpu: 10m memory: 25Mi limits: cpu: 500m memory: 200Mi fluentBitConfigName: fluent-bit-config tolerations: - operator: Exists EOF

Expected behavior

Expect error to be set in Status field of FluentBit CR indicating why fluentBit pods are not deployed.

Your Environment

- Fluent Operator version:v1.0.0
- Container Runtime: Docker
- Operating system: MacOS (Darwin)
- Kernel version: Darwin 21.1.0
Using kind cluster as define here:https://github.com/kubesphere-sigs/fluent-operator-walkthrough/blob/master/create-kind-cluster.sh

How did you install fluent operator?

https://github.com/kubesphere-sigs/fluent-operator-walkthrough/blob/master/deploy-fluent-operator.sh

What happened?

No response

Your Error Log

Operator Logs:
2022-04-01T17:42:58.480Z        INFO    controller-runtime.metrics      metrics server is starting to listen    {"addr": ":8080"}
2022-04-01T17:42:58.481Z        INFO    setup   starting manager
2022-04-01T17:42:58.682Z        INFO    controller-runtime.manager      starting metrics server {"path": "/metrics"}
2022-04-01T17:42:58.682Z        INFO    controller-runtime.manager.controller.fluentbit Starting EventSource    {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "FluentBit", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.682Z        INFO    controller-runtime.manager.controller.clusterfluentbitconfig    Starting EventSource    {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "ClusterFluentBitConfig", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentbit Starting EventSource    {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "FluentBit", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.clusterfluentbitconfig    Starting EventSource    {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "ClusterFluentBitConfig", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.clusterfluentbitconfig    Starting EventSource    {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "ClusterFluentBitConfig", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentbit Starting EventSource    {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "FluentBit", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.clusterfluentbitconfig    Starting EventSource    {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "ClusterFluentBitConfig", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentbit Starting Controller     {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "FluentBit"}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.clusterfluentbitconfig    Starting EventSource    {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "ClusterFluentBitConfig", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.clusterfluentbitconfig    Starting EventSource    {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "ClusterFluentBitConfig", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.clusterfluentbitconfig    Starting Controller     {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "ClusterFluentBitConfig"}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.682Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting Controller     {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd"}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting EventSource    {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "source": "kind source: /, Kind="}
2022-04-01T17:42:58.683Z        INFO    controller-runtime.manager.controller.fluentd   Starting Controller     {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd"}
2022-04-01T17:42:59.880Z        INFO    controller-runtime.manager.controller.fluentbit Starting workers        {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "FluentBit", "worker count": 1}
2022-04-01T17:42:59.882Z        INFO    controller-runtime.manager.controller.clusterfluentbitconfig    Starting workers        {"reconciler group": "fluentbit.fluent.io", "reconciler kind": "ClusterFluentBitConfig", "worker count": 1}
2022-04-01T17:42:59.882Z        INFO    controller-runtime.manager.controller.fluentd   Starting workers        {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "worker count": 1}
2022-04-01T17:42:59.882Z        INFO    controller-runtime.manager.controller.fluentd   Starting workers        {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "worker count": 1}
2022-04-01T18:59:57.552Z        ERROR   controller-runtime.manager.controller.fluentd   Reconciler error        {"reconciler group": "fluentd.fluent.io", "reconciler kind": "Fluentd", "name": "fluentd", "namespace": "fluent", "error": "Operation cannot be fulfilled on fluentds.fluentd.fluent.io \"fluentd\": the object has been modified; please apply your changes to the latest version and try again"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:253
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
        /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:214
2022-04-01T18:59:57.599Z        INFO    controllers.FluentdConfig       Fluentd main configuration has updated  {"logging-control-plane": "fluent", "fd": "fluentd", "secret": "fluentd-config"}
2022-04-01T18:59:57.608Z        INFO    controllers.FluentdConfig       Fluentd main configuration has updated  {"logging-control-plane": "fluent", "fd": "fluentd", "secret": "fluentd-config"}
2022-04-01T19:54:11.315Z        INFO    controllers.FluentdConfig       Combine resources failed        {"config": "cluster-fluentd-config", "err": "no filter plugins or output plugins matched"}
2022-04-01T19:54:11.337Z        INFO    controllers.FluentdConfig       Fluentd main configuration has updated  {"logging-control-plane": "fluent", "fd": "fluentd", "secret": "fluentd-config"}
2022-04-01T19:54:11.378Z        INFO    controllers.FluentdConfig       Fluentd main configuration has updated  {"logging-control-plane": "fluent", "fd": "fluentd", "secret": "fluentd-config"}
2022-04-01T19:54:11.457Z        INFO    controllers.FluentdConfig       Fluentd main configuration has updated  {"logging-control-plane": "fluent", "fd": "fluentd", "secret": "fluentd-config"}
2022-04-01T19:54:11.468Z        INFO    controllers.FluentdConfig       Fluentd main configuration has updated  {"logging-control-plane": "fluent", "fd": "fluentd", "secret": "fluentd-config"}
2022-04-01T22:14:42.407Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-01T22:14:42.412Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-01T22:14:42.412Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-01T22:14:42.423Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-01T22:14:42.423Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-01T22:17:22.696Z        INFO    controllers.FluentdConfig       Fluentd main configuration has updated  {"logging-control-plane": "fluent", "fd": "fluentd", "secret": "fluentd-config"}
2022-04-01T22:44:56.175Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-01T22:46:40.007Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-01T22:52:43.199Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-01T22:52:43.200Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-01T22:53:34.963Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-01T22:53:34.963Z        INFO    controllers.FluentBitConfig     Fluent Bit main configuration has updated       {"logging-control-plane": "fluent", "fluentbitconfig": "fluent-bit-config", "secret": "fluent-bit-config"}
2022-04-02T04:27:44.480Z        INFO    controllers.FluentdConfig       Fluentd main configuration has updated  {"logging-control-plane": "fluent", "fd": "fluentd", "secret": "fluentd-config"}

Additional context

No response

lseshan avatar Apr 02 '22 05:04 lseshan

We might need to update FluentBit CRD status for case like this @wenchajun @wanjunlei

benjaminhuo avatar Apr 02 '22 06:04 benjaminhuo

Yes, but generally speaking you need to configure fluentbit with fluentbitconifg to deploy the fluentbit pod.

wenchajun avatar Apr 06 '22 08:04 wenchajun