huanggze 是k8s集群外的地址,之前这个是不对的方式,请忽略。
后来我加了svc,挂了endpoint,可是问题还存在。
svc:
kubectl -n kubesphere-logging-system describe svc sa-ext-es
Name: sa-ext-es
Namespace: kubesphere-logging-system
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"sa-ext-es","namespace":"kubesphere-logging-system"},"spec":{"port...
Selector: <none>
Type: ClusterIP
IP: 172.43.158.240
Port: <unset> 80/TCP
TargetPort: 9200/TCP
Endpoints: 10.0.32.41:9200
Session Affinity: None
Events: <none>
logging-fluentbit-operator的pod是可以exec进去的,我进去ping了一下,能正常解析出来
/ $ ping sa-ext-es
PING sa-ext-es (172.43.158.240): 56 data bytes
ping: permission denied (are you root?)
但是在fluent-bit里面还是解析不了
[2019/11/07 09:20:15] [ warn] net_tcp_fd_connect: getaddrinfo(host='http://sa-ext-es'): Name or service not known
[2019/11/07 09:20:25] [ warn] net_tcp_fd_connect: getaddrinfo(host='http://sa-ext-es'): Name or service not known
[2019/11/07 09:20:32] [ warn] net_tcp_fd_connect: getaddrinfo(host='http://sa-ext-es'): Name or service not known
[2019/11/07 09:20:35] [ warn] net_tcp_fd_connect: getaddrinfo(host='http://sa-ext-es'): Name or service not known
[2019/11/07 09:20:40] [ warn] net_tcp_fd_connect: getaddrinfo(host='http://sa-ext-es'): Name or service not known
[2019/11/07 09:20:42] [ warn] net_tcp_fd_connect: getaddrinfo(host='http://sa-ext-es'): Name or service not known
[2019/11/07 09:20:50] [ warn] net_tcp_fd_connect: getaddrinfo(host='http://sa-ext-es'): Name or service not known