The use of a variable in fluented-es -daemonset in kubernetes #4569
Unanswered
Chonghaolong
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What is a problem?
The FLUENT_ELASTICSEARCH_HOST variable accepts only one address or URL. I want to write the addresses of all the es nodes in the cluster. like this - name: FLUENT_ELASTICSEARCH_HOST
value: "192.168.90.xx,192.168.90.xx,192.168.90.xx"
How to do it?
Describe the configuration of Fluentd
apiVersion: v1
kind: ServiceAccount
metadata:
name: fluentd-es8
namespace: kube-system
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: fluentd-es8
rules:
resources:
verbs:
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: fluentd-es8
roleRef:
kind: ClusterRole
name: fluentd-es8
apiGroup: rbac.authorization.k8s.io
subjects:
name: fluentd-es8
namespace: kube-system
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluentd-es8
namespace: kube-system
labels:
k8s-app: fluentd-logging
version: v1
spec:
selector:
matchLabels:
k8s-app: fluentd-logging
version: v1
template:
metadata:
labels:
k8s-app: fluentd-logging
version: v1
spec:
#serviceAccount: fluentd-es8
serviceAccountName: fluentd-es8
#tolerations:
#- key: node-role.kubernetes.io/control-plane
# effect: NoSchedule
#- key: node-role.kubernetes.io/master
# effect: NoSchedule
containers:
- name: fluentd
image: registry.com/library/fluentd/fluentd-kubernetes-daemonset:v1.17.0-debian-elasticsearch8
env:
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: FLUENT_ELASTICSEARCH_HOST
value: "192.168.90.xx"
- name: FLUENT_ELASTICSEARCH_PORT
value: "9200"
- name: FLUENT_ELASTICSEARCH_SCHEME
value: "http"
# Option to configure elasticsearch plugin with self signed certs
# ================================================================
- name: FLUENT_ELASTICSEARCH_SSL_VERIFY
value: "true"
# Option to configure elasticsearch plugin with tls
# ================================================================
- name: FLUENT_ELASTICSEARCH_SSL_VERSION
value: "TLSv1_2"
# X-Pack Authentication
# =====================
- name: FLUENT_ELASTICSEARCH_USER
value: "elastic"
- name: FLUENT_ELASTICSEARCH_PASSWORD
value: "xxxxxxxx"
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: varlog
mountPath: /var/log
# When actual pod logs in /var/lib/docker/containers, the following lines should be used.
- name: dockercontainerlogdirectory
mountPath: /var/lib/docker/containers
readOnly: true
# When actual pod logs in /var/log/pods, the following lines should be used.
#- name: dockercontainerlogdirectory
# mountPath: /var/log/pods
# readOnly: true
terminationGracePeriodSeconds: 30
volumes:
- name: config-volume
configMap:
name: fluentd-es8-config
- name: varlog
hostPath:
path: /var/log
# When actual pod logs in /var/lib/docker/containers, the following lines should be used.
- name: dockercontainerlogdirectory
hostPath:
path: /var/lib/docker/containers
# When actual pod logs in /var/log/pods, the following lines should be used.
#- name: dockercontainerlogdirectory
# hostPath:
# path: /var/log/pods
tolerations:
- key: "roles"
operator: "Exists"
Describe the logs of Fluentd
unexpected error error_class=URI::InvalidURIError error="bad URI(is not URI?): "http://elastic:elastic@192.168.90.xx,192.168.90.xx,192.168.90.xx:9200\""
Environment
Beta Was this translation helpful? Give feedback.
All reactions