<p>I am using fluentbit as a pod deployment where I am creating many fluentbit pods which are attached to azure blob containers. Since multiple pods exist I tried adding tolerations as I did on daemonset deployment but it did not work and failed. Also every time I delete and start the pods reinvests all the the again. Please advise on fixing these issues.</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: deployment 
spec:
  volumes:
    - name: config_map_name
      configMap:
        name: config_map_name
    - name: pvc_name
      persistentVolumeClaim:
        claimName: pvc_name       
  containers:
    - name: fluentbit-logger
      image: fluent/fluent-bit:2.1.3
      env:
        - name: FLUENTBIT_USER
          valueFrom:
            secretKeyRef:
              name: fluentbit-secret
              key: user
        - name: FLUENTBIT_PWD
          valueFrom:
            secretKeyRef:
              name: fluentbit-secret
              key: pwd              
      resources:
        requests:
          memory: &quot;32Mi&quot;
          cpu: &quot;50m&quot;
        limits:
          memory: &quot;64Mi&quot;
          cpu: &quot;100m&quot;
      securityContext:
        runAsUser: 0
        privileged: true
      volumeMounts:
        - name: config_map_name
          mountPath: &quot;/fluent-bit/etc&quot;
        - name: pvc_name
          mountPath: mount_path  
      tolerations: 
      - key: &quot;dedicated&quot;
        operator: &quot;Equal&quot;
        value: &quot;sgelk&quot;
        effect: &quot;NoSchedule&quot;

      - key: &quot;dedicated&quot;
        operator: &quot;Equal&quot;
        value: &quot;kafka&quot;
        effect: &quot;NoSchedule&quot;               
</code></pre>
<p>Getting the error as below</p>
<pre><code>error: error validating &quot;/tmp/fluentbit-deploy.yaml&quot;: error validating data: ValidationError(Pod.spec.containers[0]): unknown field &quot;tolerations&quot; in io.k8s.api.core.v1.Container; if you choose to ignore these errors, turn validation off with --validate=false
</code></pre>

yasin mohammed
<p>The <code>tolerations</code> attribute needs to be set on the pod, but you are attempting to set it on a container (that's why you see the error &quot;unknown field &quot;tolerations&quot; in io.k8s.api.core.v1.Container&quot;). You would need to write:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: deployment
spec:
  volumes:
    - name: config_map_name
      configMap:
        name: config_map_name
    - name: pvc_name
      persistentVolumeClaim:
        claimName: pvc_name
  containers:
    - name: fluentbit-logger
      image: fluent/fluent-bit:2.1.3
      env:
        - name: FLUENTBIT_USER
          valueFrom:
            secretKeyRef:
              name: fluentbit-secret
              key: user
        - name: FLUENTBIT_PWD
          valueFrom:
            secretKeyRef:
              name: fluentbit-secret
              key: pwd
      resources:
        requests:
          memory: &quot;32Mi&quot;
          cpu: &quot;50m&quot;
        limits:
          memory: &quot;64Mi&quot;
          cpu: &quot;100m&quot;
      securityContext:
        runAsUser: 0
        privileged: true
      volumeMounts:
        - name: config_map_name
          mountPath: &quot;/fluent-bit/etc&quot;
        - name: pvc_name
          mountPath: mount_path
  tolerations:
  - key: &quot;dedicated&quot;
    operator: &quot;Equal&quot;
    value: &quot;sgelk&quot;
    effect: &quot;NoSchedule&quot;

  - key: &quot;dedicated&quot;
    operator: &quot;Equal&quot;
    value: &quot;kafka&quot;
    effect: &quot;NoSchedule&quot;
</code></pre>
