<p>I'm using <strong>AWS EKS 1.21 with Fargate (serverless)</strong>. I'm trying to run Fluentd as a daemonset however the daemonset is not running at all.</p>
<p>All the other objects like role, rolebinding, serviceaccount, configmap are already in place in the cluster.</p>
<pre><code>NAME                 DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
aws-node             0         0         0       0            0           &lt;none&gt;          8d
fluentd-cloudwatch   0         0         0       0            0           &lt;none&gt;          3m36s
kube-proxy           0         0         0       0            0           &lt;none&gt;          8d
</code></pre>
<p>This is my Daemonset:-</p>
<pre><code>apiVersion: apps/v1 #Latest support AWS EKS 1.21
kind: DaemonSet
metadata:
  labels:
    k8s-app: fluentd-cloudwatch
  name: fluentd-cloudwatch
  namespace: kube-system
spec:
  selector:
    matchLabels:
      k8s-app: fluentd-cloudwatch
  template:
    metadata:
      labels:
        k8s-app: fluentd-cloudwatch
    spec:
      containers:
      - env:
        - name: REGION
          value: us-east-1 # Correct AWS EKS region should be verified before running this Daemonset
        - name: CLUSTER_NAME
          value: eks-fargate-alb-demo # AWS EKS Cluster Name should be verified before running this Daemonset
        image: fluent/fluentd-kubernetes-daemonset:v1.1-debian-cloudwatch
        imagePullPolicy: IfNotPresent
        name: fluentd-cloudwatch
        resources:
          limits:
            memory: 200Mi
          requests:
            cpu: 100m
            memory: 200Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /config-volume
          name: config-volume
        - mountPath: /fluentd/etc
          name: fluentdconf
        - mountPath: /var/log
          name: varlog
        - mountPath: /var/lib/docker/containers
          name: varlibdockercontainers
          readOnly: true
        - mountPath: /run/log/journal
          name: runlogjournal
          readOnly: true
      dnsPolicy: ClusterFirst
      initContainers:
      - command:
        - sh
        - -c
        - cp /config-volume/..data/* /fluentd/etc
        image: busybox
        imagePullPolicy: Always
        name: copy-fluentd-config
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /config-volume
          name: config-volume
        - mountPath: /fluentd/etc
          name: fluentdconf
      serviceAccount: fluentd
      serviceAccountName: fluentd
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          name: fluentd-config
        name: config-volume
      - emptyDir: {}
        name: fluentdconf
      - hostPath:
          path: /var/log
          type: &quot;&quot;
        name: varlog
      - hostPath:
          path: /var/lib/docker/containers
          type: &quot;&quot;
        name: varlibdockercontainers
      - hostPath:
          path: /run/log/journal
          type: &quot;&quot;
        name: runlogjournal
</code></pre>
<p>When I describe it, I do not see any events as well. I can run other pods like Nginx etc on this cluster but this is not running at all.</p>
<pre><code>kubectl describe ds fluentd-cloudwatch -n kube-system



Name:           fluentd-cloudwatch
Selector:       k8s-app=fluentd-cloudwatch
Node-Selector:  &lt;none&gt;
Labels:         k8s-app=fluentd-cloudwatch
Annotations:    deprecated.daemonset.template.generation: 1
Desired Number of Nodes Scheduled: 0
Current Number of Nodes Scheduled: 0
Number of Nodes Scheduled with Up-to-date Pods: 0
Number of Nodes Scheduled with Available Pods: 0
Number of Nodes Misscheduled: 0
Pods Status:  0 Running / 0 Waiting / 0 Succeeded / 0 Failed
Pod Template:
  Labels:           k8s-app=fluentd-cloudwatch
  Service Account:  fluentd
  Init Containers:
   copy-fluentd-config:
    Image:      busybox
    Port:       &lt;none&gt;
    Host Port:  &lt;none&gt;
    Command:
      sh
      -c
      cp /config-volume/..data/* /fluentd/etc
    Environment:  &lt;none&gt;
    Mounts:
      /config-volume from config-volume (rw)
      /fluentd/etc from fluentdconf (rw)
  Containers:
   fluentd-cloudwatch:
    Image:      fluent/fluentd-kubernetes-daemonset:v1.1-debian-cloudwatch
    Port:       &lt;none&gt;
    Host Port:  &lt;none&gt;
    Limits:
      memory:  200Mi
    Requests:
      cpu:     100m
      memory:  200Mi
    Environment:
      REGION:        us-east-1
      CLUSTER_NAME:  eks-fargate-alb-demo
    Mounts:
      /config-volume from config-volume (rw)
      /fluentd/etc from fluentdconf (rw)
      /run/log/journal from runlogjournal (ro)
      /var/lib/docker/containers from varlibdockercontainers (ro)
      /var/log from varlog (rw)
  Volumes:
   config-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      fluentd-config
    Optional:  false
   fluentdconf:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
    SizeLimit:  &lt;unset&gt;
   varlog:
    Type:          HostPath (bare host directory volume)
    Path:          /var/log
    HostPathType:
   varlibdockercontainers:
    Type:          HostPath (bare host directory volume)
    Path:          /var/lib/docker/containers
    HostPathType:
   runlogjournal:
    Type:          HostPath (bare host directory volume)
    Path:          /run/log/journal
    HostPathType:
Events:            &lt;none&gt;
</code></pre>
<p>ConfigMap:-</p>
<pre><code>apiVersion: v1
data:
  containers.conf: |
    &lt;source&gt;
      @type tail
      @id in_tail_container_logs
      @label @containers
      path /var/log/containers/*.log
      pos_file /var/log/fluentd-containers.log.pos
      tag *
      read_from_head true
      &lt;parse&gt;
        @type json
        time_format %Y-%m-%dT%H:%M:%S.%NZ
      &lt;/parse&gt;
    &lt;/source&gt;

    &lt;label @containers&gt;
      &lt;filter **&gt;
        @type kubernetes_metadata
        @id filter_kube_metadata
      &lt;/filter&gt;

      &lt;filter **&gt;
        @type record_transformer
        @id filter_containers_stream_transformer
        &lt;record&gt;
          stream_name ${tag_parts[3]}
        &lt;/record&gt;
      &lt;/filter&gt;

      &lt;match **&gt;
        @type cloudwatch_logs
        @id out_cloudwatch_logs_containers
        region &quot;#{ENV.fetch('REGION')}&quot;
        log_group_name &quot;/k8s-nest/#{ENV.fetch('CLUSTER_NAME')}/containers&quot;
        log_stream_name_key stream_name
        remove_log_stream_name_key true
        auto_create_stream true
        &lt;buffer&gt;
          flush_interval 5
          chunk_limit_size 2m
          queued_chunks_limit_size 32
          retry_forever true
        &lt;/buffer&gt;
      &lt;/match&gt;
    &lt;/label&gt;
  fluent.conf: |
    @include containers.conf
    @include systemd.conf

    &lt;match fluent.**&gt;
      @type null
    &lt;/match&gt;
  systemd.conf: |
    &lt;source&gt;
      @type systemd
      @id in_systemd_kubelet
      @label @systemd
      filters [{ &quot;_SYSTEMD_UNIT&quot;: &quot;kubelet.service&quot; }]
      &lt;entry&gt;
        field_map {&quot;MESSAGE&quot;: &quot;message&quot;, &quot;_HOSTNAME&quot;: &quot;hostname&quot;, &quot;_SYSTEMD_UNIT&quot;: &quot;systemd_unit&quot;}
        field_map_strict true
      &lt;/entry&gt;
      path /run/log/journal
      pos_file /var/log/fluentd-journald-kubelet.pos
      read_from_head true
      tag kubelet.service
    &lt;/source&gt;

    &lt;source&gt;
      @type systemd
      @id in_systemd_kubeproxy
      @label @systemd
      filters [{ &quot;_SYSTEMD_UNIT&quot;: &quot;kubeproxy.service&quot; }]
      &lt;entry&gt;
        field_map {&quot;MESSAGE&quot;: &quot;message&quot;, &quot;_HOSTNAME&quot;: &quot;hostname&quot;, &quot;_SYSTEMD_UNIT&quot;: &quot;systemd_unit&quot;}
        field_map_strict true
      &lt;/entry&gt;
      path /run/log/journal
      pos_file /var/log/fluentd-journald-kubeproxy.pos
      read_from_head true
      tag kubeproxy.service
    &lt;/source&gt;

    &lt;source&gt;
      @type systemd
      @id in_systemd_docker
      @label @systemd
      filters [{ &quot;_SYSTEMD_UNIT&quot;: &quot;docker.service&quot; }]
      &lt;entry&gt;
        field_map {&quot;MESSAGE&quot;: &quot;message&quot;, &quot;_HOSTNAME&quot;: &quot;hostname&quot;, &quot;_SYSTEMD_UNIT&quot;: &quot;systemd_unit&quot;}
        field_map_strict true
      &lt;/entry&gt;
      path /run/log/journal
      pos_file /var/log/fluentd-journald-docker.pos
      read_from_head true
      tag docker.service
    &lt;/source&gt;

    &lt;label @systemd&gt;
      &lt;filter **&gt;
        @type record_transformer
        @id filter_systemd_stream_transformer
        &lt;record&gt;
          stream_name ${tag}-${record[&quot;hostname&quot;]}
        &lt;/record&gt;
      &lt;/filter&gt;

      &lt;match **&gt;
        @type cloudwatch_logs
        @id out_cloudwatch_logs_systemd
        region &quot;#{ENV.fetch('REGION')}&quot;
        log_group_name &quot;/k8s-nest/#{ENV.fetch('CLUSTER_NAME')}/systemd&quot;
        log_stream_name_key stream_name
        auto_create_stream true
        remove_log_stream_name_key true
        &lt;buffer&gt;
          flush_interval 5
          chunk_limit_size 2m
          queued_chunks_limit_size 32
          retry_forever true
        &lt;/buffer&gt;
      &lt;/match&gt;
    &lt;/label&gt;
kind: ConfigMap
metadata:
  labels:
    k8s-app: fluentd-cloudwatch
  name: fluentd-config
  namespace: kube-system
</code></pre>
<p>Please let me know where the problem is, thanks</p>

vinod827
<p>As you figured, EKS/Fargate does not support Daemonsets (because there are no [real] nodes). Actually, you don't need to run FluentBit as a sidecar in every pod. EKS/Fargate supports a logging feature called Firelens that allows you to just configure where you want to log (destination) and Fargate will configure a &quot;hide-car&quot; in the back end (not visible to the user) to do that. Please see <a href="https://docs.aws.amazon.com/eks/latest/userguide/fargate-logging.html" rel="nofollow noreferrer">this page of the documentation</a> with the details.</p>
<p>Snippet:</p>
<p><code>Amazon EKS on Fargate offers a built-in log router based on Fluent Bit. This means that you don't explicitly run a Fluent Bit container as a sidecar, but Amazon runs it for you. All that you have to do is configure the log router. The configuration happens through a dedicated ConfigMap....</code></p>
