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 - stop
ports: ports:
- name: http - name: http
containerPort: {{ .Values.network.client.port }} containerPort: {{ tuple "elasticsearch" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
- name: transport - name: transport
containerPort: {{ .Values.network.discovery.port }} containerPort: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
livenessProbe: livenessProbe:
tcpSocket: tcpSocket:
port: {{ .Values.network.discovery.port }} port: {{ tuple "elasticsearch" "internal" "discovery" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 20 initialDelaySeconds: 20
periodSeconds: 10 periodSeconds: 10
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /_cluster/health path: /_cluster/health
port: {{ .Values.network.client.port }} port: {{ tuple "elasticsearch" "internal" "client" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
env: env:
- name: NAMESPACE - name: NAMESPACE
valueFrom: valueFrom:

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ metadata:
spec: spec:
ports: ports:
- name: transport - 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 }} {{- if .Values.network.data.node_port.enabled }}
nodePort: {{ .Values.network.data.node_port.port }} nodePort: {{ .Values.network.data.node_port.port }}
{{- end }} {{- end }}

View File

@ -24,7 +24,7 @@ metadata:
spec: spec:
ports: ports:
- name: transport - 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 }} {{- if .Values.network.discovery.node_port.enabled }}
nodePort: {{ .Values.network.discovery.node_port.port }} nodePort: {{ .Values.network.discovery.node_port.port }}
{{- end }} {{- end }}

View File

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

View File

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

View File

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