「fluentd-daemonset.yaml」

  CREATED BY JENKINSBOT
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: fluentd
  namespace: kube-system
  labels:
    k8s-app: fluentd-logging
    version: v1
    kubernetes.io/cluster-service: "true"
spec:
  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.3-debian-elasticsearch
        env:
          - name:  FLUENT_ELASTICSEARCH_HOST
            value: "logcluster.kube-system.svc.cluster.local"
          - name:  FLUENT_ELASTICSEARCH_PORT
            value: "9200"
          - name: FLUENT_ELASTICSEARCH_SCHEME
            value: "http"
          - name: FLUENT_UID
            value: "0"
        resources:
          limits:
            memory: 200Mi
          requests:
            cpu: 100m
            memory: 200Mi
        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
      terminationGracePeriodSeconds: 30
      volumes:
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers

镜像信息

DockerHub: fluent/fluentd-kubernetes-daemonset:v1.3-debian-elasticsearch
GitHub: fluent/fluentd-kubernetes-daemonset

根据 fluentd-kubernetes-daemonset/docker-image/v1.3/debian-elasticsearch/conf/fluent.conf 文件,镜像 fluentd-kubernetes-daemonset:v1.3-debian-elasticsearch 不支持指定多个 Elasticsearch 集群。

同时我们查看从 v1.3 到 v1.10 版本,都没有 hosts 参数,因此无法从这里指定多个 Elasticsearch 节点以达到负载均衡的目的。