Welcome to the Linux Foundation Forum!

Issues with completing Lab 1-C

Running Ubuntu version 18.04, Kubernetes version 1.17

When I go to the part of running the "kubectl apply -f fluent/fluentd-ds.yaml" command. I get an error.

See screenshot for the config and error message.

Note that I have changed the apiVersion: "extensions/v1beta1" to "apiVersion: apps/v1" as well since it was also producing an error.

Need help since I am stuck on this.... Thanks.

Comments

  • ChristianLacsina964
    edited March 2020

    Hi Joel,

    From what I can see, the volumes array under the Daemonset is nested under the container entry. You'll need to correct the spacing and move it back so the volumes array and its nested entries are in line with containers

    Here is a correct spec for your spacing (make sure you create the fluentd-config configmap before applying it):

    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
      name: fluentd-ds
      labels:
        k8s-app: fluentd-logging
        version: v1
    spec:
      selector:
        matchLabels:
          k8s-app: fluentd-logging
      template:
        metadata:
          labels:
            k8s-app: fluentd-logging
            version: v1
        spec:
          tolerations:
          - key: node-role.kubernetes.io/master
            effect: NoSchedule
          terminationGracePeriodSeconds: 30
          containers:
          - name: fluentd-ds
            image: fluent/fluentd:latest
            resources:
              limits:
                memory: 200Mi
            env:
              - name:  FLUENTD_CONF
                value: "fluentd-kube.conf"
            volumeMounts:
            - name: fluentd-conf
              mountPath: /fluentd/etc
          volumes:
          - name: fluentd-conf
            configMap:
              name: fluentd-config
    

    Other corrections/changes include:

    • Changed the apiGroup is set to apps/v1
    • Added the following block to the spec:
      selector:
        matchLabels:
          k8s-app: fluentd-logging
    
    • Changed to the fluent/fluentd:latest image. fluent/fluentd:stable is no longer being updated.

    Thank you for the report!

  • Hi Christian,

    It worked! Thanks! Was able to complete my module.

Categories

Upcoming Training