Alertmanager: use endpoints section and lookups to set port

This PS moves alertmanager to use the endpoints section and
lookups to set the ports it serves on.

Change-Id: I62108ca207f615d10d0b4385da204214b9aeae32
This commit is contained in:
Steve Wilkerson 2018-03-05 10:33:30 -06:00
parent d681396412
commit 657646b1bd
5 changed files with 8 additions and 8 deletions

View File

@ -31,7 +31,7 @@ function generate_peers () {
final_pod_suffix=$(( {{ .Values.pod.replicas.alertmanager }}-1 ))
for pod_suffix in `seq 0 "$final_pod_suffix"`
do
echo -mesh.peer={{ .Release.Name }}-$pod_suffix.$DISCOVERY_SVC:6783
echo -mesh.peer={{ .Release.Name }}-$pod_suffix.$DISCOVERY_SVC:$MESH_PORT
done
}

View File

@ -26,7 +26,7 @@ spec:
clusterIP: None
ports:
- name: peer-mesh
port: {{ .Values.network.alertmanager.mesh_port }}
port: {{ tuple "alerts" "internal" "mesh" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
selector:
{{ tuple $envAll "alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
{{- end }}

View File

@ -27,7 +27,7 @@ spec:
{{ if .Values.network.alertmanager.node_port.enabled }}
nodePort: {{ .Values.network.alertmanager.node_port.port }}
{{ end }}
port: {{ .Values.network.alertmanager.port }}
port: {{ tuple "alerts" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
selector:
{{ tuple $envAll "alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
{{ if .Values.network.alertmanager.node_port.enabled }}

View File

@ -81,15 +81,17 @@ spec:
env:
- name: DISCOVERY_SVC
value: {{ tuple "alerts" "discovery" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
- name: MESH_PORT
value: {{ tuple "alerts" "internal" "mesh" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }}
ports:
- name: alerts-api
containerPort: {{ .Values.network.alertmanager.port }}
containerPort: {{ tuple "alerts" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
- name: peer-mesh
containerPort: {{ .Values.network.alertmanager.mesh_port }}
containerPort: {{ tuple "alerts" "internal" "mesh" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
httpGet:
path: /#/status
port: {{ .Values.network.alertmanager.port }}
port: {{ tuple "alerts" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 30
timeoutSeconds: 30
volumeMounts:

View File

@ -133,8 +133,6 @@ network:
node_port:
enabled: false
port: 30903
port: 9093
mesh_port: 6783
storage:
enabled: true