-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Disable service links to prevent very long startup times #542
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
This is becoming a blocker for us, it would be very nice to have it merged soon. What would be needed to move forward? |
Hi @floretan, thanks for your PR.
This PR should update the README requirements and we need to discuss it internally. |
Hi @floretan, After some internal discussion, we would prefer not breaking the current behavior or compatibility with older K8S versions with Elasticsearch chart default values. Can you create an |
@@ -22,6 +22,7 @@ spec: | |||
podManagementPolicy: {{ .Values.podManagementPolicy }} | |||
updateStrategy: | |||
type: {{ .Values.updateStrategy }} | |||
enableServiceLinks: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableServiceLinks: false | |
enableServiceLinks: {{ .Values.enableServiceLinks }} |
with enableServiceLinks
set to true by default in values.yaml
Thank you for taking a closer look at this issue. I hadn't considered the conflict with older kubernetes versions, and I'm glad such attention to details is put into these reviews. One issue is that
Which option would you prefer? |
Yep, sorry I didn't think about that, when I reviewed it this morning.
We are using helm-charts/elasticsearch/templates/_helpers.tpl Lines 71 to 72 in 7624ed3
This is working fine with Helm 2 but we didn't really tested it with Helm 3 yet. I just saw that it was no more in Helm 3 doc and is flagged as deprecated in Helm 3 code. Note that we officially still don't support Helm 3 so staying with
I'm also totally fine with using an
This wouldn't change the current behavior and we would only need to mention that setting this value false is only with K8S >= 1.13 in the README config description which could avoid adding using |
Prevents very long startup times when the namespace contains many services. Only valid for kubernetes versions >1.13
After taking a closer look at the usage in other charts, I found that This gives us the performance improvement out of the box (as mentioned in the original description, there are no side effects), and prevents adding an unnecessary configuration option. |
@@ -143,6 +143,9 @@ spec: | |||
{{- if .Values.imagePullSecrets }} | |||
imagePullSecrets: | |||
{{ toYaml .Values.imagePullSecrets | indent 8 }} | |||
{{- end }} | |||
{{- if semverCompare ">1.13" .Capabilities.KubeVersion.GitVersion }} | |||
enableServiceLinks: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that we still want it to be configurable and enabled by default in values.yaml
in addition of the K8S version check:
enableServiceLinks: false | |
enableServiceLinks: {{ .Values.enableServiceLinks }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I made the value configurable and updated both values.yaml and README.md.
jenkins test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM⛴
The build failure seems to be caused by issues when downloading |
Yep I'm fine with merging 😄 |
…mes (#542) Prevents very long startup times when the namespace contains many services. Only valid for kubernetes versions >1.13
…mes (#542) Prevents very long startup times when the namespace contains many services. Only valid for kubernetes versions >1.13
…mes (#542) Prevents very long startup times when the namespace contains many services. Only valid for kubernetes versions >1.13
backported to |
The Elasticsearch docker image uses environment variables to set Elasticsearch configuration options. Kubernetes automatically adds environment variables for all services in the current namespace.
When trying to debug why Elasticsearch was taking a particularly long time (over 10 minutes) to boot in one of our projects, we noticed that this behavior was dependent on the namespace, even though no quotas or other limitations were in place. The slow start was also accompanied by a high cpu usage for a few minutes, even though Elasticsearch had no indices at that point. We recently had another issue where the massive number of environment variables was causing an issue, and when we disabled the service links with
enableServiceLinks: false
, the startup behavior went back to normal.The service links are there to facilitate connecting to other services, but Elasticsearch doesn't usually connect to anything else, so there should be no side effects (when a node connects to another node in the cluster, it uses explicitly declared services, not the automatically generated environment variables).
I'm not sure if this small static configuration changes needs tests, but I'm happy to add them if needed.
${CHART}/tests/*.py
${CHART}/examples/*/test/goss.yaml