AliyunContainerService / kube-eventer

kube-eventer emit kubernetes events to sinks
Apache License 2.0
1.01k stars 278 forks source link

可否考虑将es7 中 mapping 的type 从 `events` 改成默认 `_doc` 或者 去除 type #166

Open liyongjian5179 opened 3 years ago

liyongjian5179 commented 3 years ago

https://github.com/AliyunContainerService/kube-eventer/blob/509eaa03b1/sinks/elasticsearch/driver.go#L31

可否考虑将es7 中 mapping 的type 从 events 改成默认 _doc 或者根据下面的链接,去除掉 type

https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html#_schedule_for_removal_of_mapping_types

ringtail commented 3 years ago

The maintainer of es is @rralcala. You can contact with @rralcala about the change of mapping type.

ringtail commented 3 years ago

@rralcala Hey, Bro. Could you help to check this issue?

rralcala commented 3 years ago

I'll take a look, and set the default to _doc if needed, just need to ensure we don't break existing users, because I think that if you were using es < 7 and upgraded then this is not enforced, so, we could potentially cause problems for those people.

liyongjian5179 commented 3 years ago

Thank you for your answer, our company is now ES =7, and the use of '_doc' is mandatory, and the index is created through the index template, not through kube-Eventer.

My solution now is to change the typeName in the code

kube-eventer/common/elasticsearch/mapping.go:192            "_doc": {
kube-eventer/sinks/elasticsearch/driver.go:31          typeName = "_doc"

And compile the code and rebuild the container image Now the alias is index-xxxx-_doc

Will support es=8 be considered in the future? Because in 8, 'mappingTypes' will be removed

I think kube-Eventer should do some feature adaptation for different ES versions. What do you think?