【发布时间】:2019-04-08 06:44:27
【问题描述】:
我将 Elastic Search 和 Fluentd 部署在同一命名空间 test 中,并在下面编写配置以确保 Fluentd 可以访问 Elastic serach:
livenessProbe:
failureThreshold: 5
httpGet:
host: elasticsearch-logging
path: /
port: 9200
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
这不起作用,所以我使用了整个 DNS 名称,但仍然失败:
Readiness probe failed: Get http://elasticsearch-logging.test.svc.cluster.local:9200/: dial tcp: lookup elasticsearch-logging.test.svc.cluster.local: no such host
我删除了 liveness 部分并在 Fluentd pod 中使用 curl,这很有效:
root@fluentd-es-2dvmf:/# curl http://elasticsearch-logging:9200/
{
"name" : "elasticsearch-logging-0",
"cluster_name" : "skydiscovery-es-cluster",
"cluster_uuid" : "fr3oSzpHT_qP9HQJ1WygnA",
"version" : {
"number" : "6.2.4",
"build_hash" : "ccec39f",
"build_date" : "2018-04-12T20:37:28.497551Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
为什么他们的行为不同?
有什么办法吗?
【问题讨论】:
标签: networking kubernetes kube-dns