Skip to content

Fluentd Error-  #100

@shanky1234

Description

@shanky1234

Hi Team,
I wanted to run the fluentd in the form of pod & below is the yaml file for it.

apiVersion: v1
kind: ServiceAccount
metadata:
name: fluentd
namespace: kube-system


apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: fluentd
namespace: kube-system
rules:

  • apiGroups:
    • ""
      resources:
    • pods
    • namespaces
      verbs:
    • get
    • list
    • watch

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: fluentd
roleRef:
kind: ClusterRole
name: fluentd
apiGroup: rbac.authorization.k8s.io
subjects:

  • kind: ServiceAccount
    name: fluentd
    namespace: kube-system

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluentd
namespace: kube-system
labels:
k8s-app: fluentd-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
selector:
matchLabels:
k8s-app: fluentd-logging
template:
metadata:
labels:
k8s-app: fluentd-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
serviceAccount: fluentd
serviceAccountName: fluentd
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: fluentd
image: fluent/fluentd-kubernetes-daemonset:v1.14.6-debian-elasticsearch7-1.0
env:
- name: FLUENT_ELASTICSEARCH_HOST
value: elasticsearch.logging
- name: FLUENT_ELASTICSEARCH_PORT
value: "9200"
- name: FLUENT_ELASTICSEARCH_SCHEME
value: "http"
- name: FLUENT_UID
value: "0"
- name: FLUENT_ELASTICSEARCH_SED_DISABLE
value: "true"
volumeMounts:
- name: varlog
mountPath: /var/log
- name: fluentd-config
mountPath: /fluentd/etc/
readOnly: false
- name: varlibdockercontainers
mountPath: /u01/data/docker/containers
readOnly: true
terminationGracePeriodSeconds: 30
volumes:
- name: varlog
hostPath:
path: /var/log
- name: varlibdockercontainers
hostPath:
path: /u01/data/docker/containers
- name: fluentd-config
configMap:
defaultMode: 0666
name: fluentd-client-conf-config


when i tried to run the above yaml file its getting crashloopbackoff & also I have seen the logs i.e below -
2022-10-29 10:57:04 +0000 [info]: parsing config file is succeeded path="/fluentd/etc/fluent.conf"
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-concat' version '2.5.0'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-dedot_filter' version '1.0.0'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-detect-exceptions' version '0.0.14'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-elasticsearch' version '5.1.5'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-grok-parser' version '2.6.2'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-json-in-json-2' version '1.0.2'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-kubernetes_metadata_filter' version '2.9.5'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-multi-format-parser' version '1.0.0'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-parser-cri' version '0.1.1'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-prometheus' version '2.0.2'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-record-modifier' version '2.1.0'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-rewrite-tag-filter' version '2.4.0'
2022-10-29 10:57:04 +0000 [info]: gem 'fluent-plugin-systemd' version '1.0.5'
2022-10-29 10:57:04 +0000 [info]: gem 'fluentd' version '1.14.6'
2022-10-29 10:57:04 +0000 [error]: config error file="/fluentd/etc/fluent.conf" error_class=Fluent::ConfigError error="Missing '@type' parameter on directive"


can you please tell how to bypass above error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions