Elasticsearch: use endpoints section and lookups to set port

This PS moves elasticsearch to use the endpoints section and
lookups to set the port it serves on.

Change-Id: I4a73893124b6d988cd1f885cfc3dd62abeb4ae8c
This commit is contained in:
Steve Wilkerson 2018-03-05 10:03:48 -06:00
parent d681396412
commit 3f44f4586a
9 changed files with 13 additions and 18 deletions

View File

@ -169,18 +169,18 @@ spec:
- stop
ports:
- name: http
containerPort: {{ .Values.network.client.port }}
containerPort: {{ tuple "elasticsearch" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
- name: transport
containerPort: {{ .Values.network.discovery.port }}
containerPort: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
livenessProbe:
tcpSocket:
port: {{ .Values.network.discovery.port }}
port: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 20
periodSeconds: 10
readinessProbe:
httpGet:
path: /_cluster/health
port: {{ .Values.network.client.port }}
port: {{ tuple "elasticsearch" "internal" "client" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
env:
- name: NAMESPACE
valueFrom:

View File

@ -131,10 +131,10 @@ spec:
- stop
ports:
- name: transport
containerPort: {{ .Values.network.discovery.port }}
containerPort: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
livenessProbe:
tcpSocket:
port: {{ .Values.network.discovery.port }}
port: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 20
periodSeconds: 10
env:

View File

@ -66,7 +66,7 @@ spec:
key: ELASTICSEARCH_URI
ports:
- name: metrics
containerPort: {{ .Values.network.prometheus_elasticsearch_exporter.port }}
containerPort: {{ tuple "prometheus_elasticsearch_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
volumeMounts:
- name: elasticsearch-exporter-bin
mountPath: /tmp/elasticsearch-exporter.sh

View File

@ -31,7 +31,7 @@ metadata:
spec:
ports:
- name: metrics
port: {{ .Values.network.prometheus_elasticsearch_exporter.port }}
port: {{ tuple "prometheus_elasticsearch_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
selector:
{{ tuple $envAll "elasticsearch" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
{{- end }}

View File

@ -24,7 +24,7 @@ metadata:
spec:
ports:
- name: transport
port: {{ .Values.network.data.port }}
port: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- if .Values.network.data.node_port.enabled }}
nodePort: {{ .Values.network.data.node_port.port }}
{{- end }}

View File

@ -24,7 +24,7 @@ metadata:
spec:
ports:
- name: transport
port: {{ .Values.network.discovery.port }}
port: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- if .Values.network.discovery.node_port.enabled }}
nodePort: {{ .Values.network.discovery.node_port.port }}
{{- end }}

View File

@ -24,7 +24,7 @@ metadata:
spec:
ports:
- name: http
port: 80
port: {{ tuple "elasticsearch" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- if .Values.network.client.node_port.enabled }}
nodePort: {{ .Values.network.client.node_port.port }}
{{- end }}

View File

@ -128,10 +128,10 @@ spec:
- stop
ports:
- name: transport
containerPort: {{ .Values.network.data.port }}
containerPort: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
livenessProbe:
tcpSocket:
port: {{ .Values.network.discovery.port }}
port: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 20
periodSeconds: 10
env:

View File

@ -337,22 +337,17 @@ monitoring:
network:
client:
port: 9200
node_port:
enabled: false
port: 30920
discovery:
port: 9300
node_port:
enabled: false
port: 30930
data:
port: 9300
node_port:
enabled: false
port: 30931
prometheus_elasticsearch_exporter:
port: 9108
storage:
elasticsearch: