# Configuration Drift Between Elastic Versions

**URL:** <https://discuss.elastic.co/t/configuration-drift-between-elastic-versions/232992>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [May 17, 2020, 1:40pm UTC](https://discuss.elastic.co/t/configuration-drift-between-elastic-versions/232992 "2020-05-17T13:40:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyle\_White](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kyle_white/32/68517_2.png) [@Kyle\_White](https://discuss.elastic.co/u/Kyle_White)\
**Post date:** [May 17, 2020, 1:40pm UTC](https://discuss.elastic.co/t/configuration-drift-between-elastic-versions/232992/1 "2020-05-17T13:40:45Z")

</div>

Hi there,  
How does the operator deal with configuration changes in different elastic versions (ie. added/renamed env vars, etc)

---

<div class="post-metadata">

**Author:** ![sebgl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebgl/32/48702_2.png) [@sebgl](https://discuss.elastic.co/u/sebgl)\
**Post date:** [May 18, 2020, 9:41am UTC](https://discuss.elastic.co/t/configuration-drift-between-elastic-versions/232992/2 "2020-05-18T09:41:54Z")

</div>

Hey @Kyle_White,

ECK is aware of the stack version based on the `version` field you provide in the spec.  
Any setting entirely managed by ECK (ie. the ones you don't see that ECK applies behind the scenes) is handled correctly.

Any setting you apply yourself (ie. through `config:` in the spec or `podTemplate:`) isn't checked by ECK and is "your responsibility".  
If some of those settings are incompatible with a newer version of Elasticsearch, it is likely that Elasticsearch will fail to start. Since configuration changes are applied through a rolling upgrade, you would notice that the upgrade is stuck since the first upgraded node cannot start properly. ECK will not move on with upgrading the other nodes with the wrong configuration. At this point you can edit the spec again to apply the correct configuration settings, so ECK can restart the invalid Pod again.

Let me know if that makes sense to you!

---

<div class="post-metadata">

**Author:** ![Kyle\_White](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kyle_white/32/68517_2.png) [@Kyle\_White](https://discuss.elastic.co/u/Kyle_White)\
**Post date:** [June 3, 2020, 10:13pm UTC](https://discuss.elastic.co/t/configuration-drift-between-elastic-versions/232992/3 "2020-06-03T22:13:34Z")

</div>

Thanks for the quick reply! (and apologies for my very slow one!)

I'm curious how ECK is managing this behind the scenes. Ie. Does the operator hard code each the elastic config at each version and use that to determine what to use? Or is there something more abstract.

It [looks](https://github.com/elastic/cloud-on-k8s/blob/459d005f53eb500a11d237f262c1e891560f7e90/pkg/controller/elasticsearch/version/zen1/minimum_masters.go) like the hard coded route, but I was wondering if you had or were planning abstractions for this

---

<div class="post-metadata">

**Author:** ![sebgl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebgl/32/48702_2.png) [@sebgl](https://discuss.elastic.co/u/sebgl)\
**Post date:** [June 4, 2020, 8:20am UTC](https://discuss.elastic.co/t/configuration-drift-between-elastic-versions/232992/4 "2020-06-04T08:20:38Z")

</div>

> [@Kyle\_White](#):
>
> 'm curious how ECK is managing this behind the scenes. Ie. Does the operator hard code each the elastic config at each version and use that to determine what to use? Or is there something more abstract.

Yeah we basically need to keep track of per-version settings. Eg. don't apply v6.x setting on v7.x, etc. So far those differences can easily be handled with a switch/condition on the version where we build the config pieces: [https://github.com/elastic/cloud-on-k8s/blob/25bcb4a0d131debbbff003e6c83e7c5eccd9e269/pkg/controller/elasticsearch/settings/merged\_config.go#L102-L112](https://github.com/elastic/cloud-on-k8s/blob/25bcb4a0d131debbbff003e6c83e7c5eccd9e269/pkg/controller/elasticsearch/settings/merged_config.go#L102-L112)  
So we did not feel the need for a smarter abstraction here (keep things simple if possible!).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 7:58am UTC](https://discuss.elastic.co/t/configuration-drift-between-elastic-versions/232992/5 "2022-11-04T07:58:34Z")

</div>


