我有一个本地kubernetes集群,其中我使用预配置的elasticsearch镜像(fluent/fluentd-kubernetes-daemonset:elasticsearch).添加了一个Fluentd Daemonsetthis article的第2步。我还有一个弹性集群在云中运行。您可以将一些环境变量传递给fluentd-elasticsearch镜像进行配置。它看起来非常简单,但在运行fluentd Pod时,我总是收到错误:
"Fluent::ElasticsearchOutput::ConnectionFailure" error="Can not reach Elasticsearch cluster ({:host=>\"fa0acce34bf64db9bc9e46f98743c185.westeurope.azure.elastic-cloud.com\", :port=>9243, :scheme=>\"https\", :user=>\"username\", :password=>\"obfuscated\"})!" plugin_id="out_es"
当我尝试使用# wget https://fa0acce34bf64db9bc9e46f98743c185.westeurope.azure.elastic-cloud.com:9243/从pod中到达弹性集群时,我得到了一个401未授权(因为我在这里没有提交用户/通行证),但它至少表明该地址是可到达的。
为什么它无法连接?我已经将FLUENT_ELASTICSEARCH_SSL_VERSION设置为'TLSv1_2',我看到这解决了其他人的一些问题。
后台配置:
kind: DaemonSet
metadata:
name: fluentd
namespace: kube-logging
labels:
app: fluentd
k8s-app: fluentd-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
selector:
matchLabels:
app: fluentd
template:
metadata:
labels:
app: fluentd
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:elasticsearch
env:
- name: FLUENT_ELASTICSEARCH_HOST
value: "fa0acce34bf64db9bc9e46f98743c185.westeurope.azure.elastic-cloud.com"
- name: FLUENT_ELASTICSEARCH_PORT
value: "9243"
- name: FLUENT_ELASTICSEARCH_SCHEME
value: "https"
- name: FLUENT_UID
value: "0"
- name: FLUENT_ELASTICSEARCH_SSL_VERIFY
value: "false"
- name: FLUENT_ELASTICSEARCH_SSL_VERSION
value: "TLSv1_2"
- name: FLUENT_ELASTICSEARCH_USER
value: "<user>"
- name: FLUENT_ELASTICSEARCH_PASSWORD
value: "<password>"
resources:
limits:
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
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发布于 2020-04-01 16:23:20
对于遇到此问题的任何其他人:
我遵循了一个使用' image : fluent/fluentd-kubernetes-daemonset:elasticsearch‘图像的教程。当你检查他们的DockerHub (https://hub.docker.com/r/fluent/fluentd-kubernetes-daemonset)时,你可以看到:elaticsearch标签已经有一年的历史了,可能已经过时了。
我将DaemonSet的图像更改为更新、更稳定的标签'fluent/fluentd-kubernetes-daemonset:v1-debian-elasticsearch‘,现在它可以工作了。
https://stackoverflow.com/questions/60951905
复制相似问题