diff --git a/elasticsearch/README.md b/elasticsearch/README.md index 2870a8a4e..c234def4b 100644 --- a/elasticsearch/README.md +++ b/elasticsearch/README.md @@ -128,6 +128,7 @@ support multiple versions with minimal changes. | `antiAffinity` | Setting this to hard enforces the [anti-affinity][] rules. If it is set to soft it will be done "best effort". Other values will be ignored | `hard` | | `clusterHealthCheckParams` | The [Elasticsearch cluster health status params][] that will be used by readiness [probe][] command | `wait_for_status=green&timeout=1s` | | `clusterName` | This will be used as the Elasticsearch [cluster.name][] and should be unique per cluster in the namespace | `elasticsearch` | +| `enableServiceLinks` | Set to false to disabling service links, which can cause slow pod startup times when there are many services in the current namespace. | `true` | | `envFrom` | Templatable string to be passed to the [environment from variables][] which will be appended to the `envFrom:` definition for the container | `[]` | | `esConfig` | Allows you to add any config files in `/usr/share/elasticsearch/config/` such as `elasticsearch.yml` and `log4j2.properties`. See [values.yaml][] for an example of the formatting | `{}` | | `esJavaOpts` | [Java options][] for Elasticsearch. This is where you should configure the [jvm heap size][] | `-Xmx1g -Xms1g` | diff --git a/elasticsearch/templates/statefulset.yaml b/elasticsearch/templates/statefulset.yaml index acb1afbc8..f79b8f48f 100644 --- a/elasticsearch/templates/statefulset.yaml +++ b/elasticsearch/templates/statefulset.yaml @@ -143,6 +143,9 @@ spec: {{- if .Values.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.imagePullSecrets | indent 8 }} + {{- end }} + {{- if semverCompare ">1.13" .Capabilities.KubeVersion.GitVersion }} + enableServiceLinks: {{ .Values.enableServiceLinks }} {{- end }} initContainers: {{- if .Values.sysctlInitContainer.enabled }} diff --git a/elasticsearch/values.yaml b/elasticsearch/values.yaml index f5a162b99..b8a2742ce 100755 --- a/elasticsearch/values.yaml +++ b/elasticsearch/values.yaml @@ -159,6 +159,11 @@ nodeAffinity: {} # the same time when bootstrapping the cluster podManagementPolicy: "Parallel" +# The environment variables injected by service links are not used, but can lead to slow Elasticsearch boot times when +# there are many services in the current namespace. +# If you experience slow pod startups you probably want to set this to `false`. +enableServiceLinks: true + protocol: http httpPort: 9200 transportPort: 9300