Merge "Alertmanager: use endpoints section and lookups to set port"

This commit is contained in:
Zuul 2018-03-09 18:46:47 +00:00 committed by Gerrit Code Review
commit 988c9d97e5
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 )) final_pod_suffix=$(( {{ .Values.pod.replicas.alertmanager }}-1 ))
for pod_suffix in `seq 0 "$final_pod_suffix"` for pod_suffix in `seq 0 "$final_pod_suffix"`
do do
echo -mesh.peer={{ .Release.Name }}-$pod_suffix.$DISCOVERY_SVC:6783 echo -mesh.peer={{ .Release.Name }}-$pod_suffix.$DISCOVERY_SVC:$MESH_PORT
done done
} }

View File

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

View File

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

View File

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

View File

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