Change for alertmanager v0.20
- Update alertmanger and prometheus discovery port from 6783 to 9094 - Update to support fqdn for discovery hostname - Add one test alert to Prometheus to test alert pipeline - update container name from alertmanger to prometheus-alertmanager Change-Id: Iec5e758e4b576dff01e84591a2440d030d5ff3c4
This commit is contained in:
parent
68940203db
commit
c97c592216
@ -29,7 +29,7 @@ function generate_peers () {
|
||||
final_pod_suffix=$(( {{ .Values.pod.replicas.alertmanager }}-1 ))
|
||||
for pod_suffix in `seq 0 "$final_pod_suffix"`
|
||||
do
|
||||
echo --cluster.peer={{ .Release.Name }}-$pod_suffix.$DISCOVERY_SVC:$MESH_PORT
|
||||
echo --cluster.peer=prometheus-alertmanager-$pod_suffix.$DISCOVERY_SVC:$MESH_PORT
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ limitations under the License.
|
||||
|
||||
{{- if .Values.manifests.clusterrolebinding }}
|
||||
{{- $envAll := . }}
|
||||
{{- $serviceAccountName := printf "%s-%s" .Release.Name "alertmanager" }}
|
||||
{{- $serviceAccountName := printf "%s" "prometheus-alertmanager" }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
|
@ -13,6 +13,6 @@ limitations under the License.
|
||||
*/}}
|
||||
|
||||
{{- if and .Values.manifests.ingress .Values.network.alertmanager.ingress.public }}
|
||||
{{- $ingressOpts := dict "envAll" . "backendService" "alertmanager" "backendServiceType" "alerts" "backendPort" "alerts-api" -}}
|
||||
{{- $ingressOpts := dict "envAll" . "backendService" "alertmanager" "backendServiceType" "alertmanager" "backendPort" "alerts-api" -}}
|
||||
{{ $ingressOpts | include "helm-toolkit.manifests.ingress" }}
|
||||
{{- end }}
|
||||
|
@ -13,5 +13,5 @@ limitations under the License.
|
||||
*/}}
|
||||
|
||||
{{- if .Values.manifests.secret_ingress_tls }}
|
||||
{{- include "helm-toolkit.manifests.secret_ingress_tls" ( dict "envAll" . "backendServiceType" "alerts" "backendService" "alertmanager") }}
|
||||
{{- include "helm-toolkit.manifests.secret_ingress_tls" ( dict "envAll" . "backendServiceType" "alertmanager" "backendService" "alertmanager") }}
|
||||
{{- end }}
|
||||
|
@ -18,13 +18,13 @@ limitations under the License.
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ tuple "alerts" "discovery" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||
name: {{ tuple "alertmanager" "discovery" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: peer-mesh
|
||||
port: {{ tuple "alerts" "internal" "mesh" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||
port: {{ tuple "alertmanager" "internal" "mesh" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||
selector:
|
||||
{{ tuple $envAll "alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||
{{ tuple $envAll "prometheus-alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||
{{- end }}
|
||||
|
@ -13,6 +13,6 @@ limitations under the License.
|
||||
*/}}
|
||||
|
||||
{{- if and .Values.manifests.service_ingress .Values.network.alertmanager.ingress.public }}
|
||||
{{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "alerts" -}}
|
||||
{{- $serviceIngressOpts := dict "envAll" . "backendServiceType" "alertmanager" -}}
|
||||
{{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
|
||||
{{- end }}
|
||||
|
@ -18,16 +18,16 @@ limitations under the License.
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ tuple "alerts" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||
name: {{ tuple "alertmanager" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||
spec:
|
||||
ports:
|
||||
- name: alerts-api
|
||||
{{ if .Values.network.alertmanager.node_port.enabled }}
|
||||
nodePort: {{ .Values.network.alertmanager.node_port.port }}
|
||||
{{ end }}
|
||||
port: {{ tuple "alerts" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||
port: {{ tuple "alertmanager" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||
selector:
|
||||
{{ tuple $envAll "alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||
{{ tuple $envAll "prometheus-alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||
{{ if .Values.network.alertmanager.node_port.enabled }}
|
||||
type: NodePort
|
||||
{{ end }}
|
||||
|
@ -18,45 +18,45 @@ limitations under the License.
|
||||
{{- $mounts_alertmanager := .Values.pod.mounts.alertmanager.alertmanager }}
|
||||
{{- $mounts_alertmanager_init := .Values.pod.mounts.alertmanager.init_container }}
|
||||
|
||||
{{- $serviceAccountName := "alertmanager" }}
|
||||
{{ tuple $envAll "alertmanager" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
||||
{{- $serviceAccountName := "prometheus-alertmanager" }}
|
||||
{{ tuple $envAll "prometheus-alertmanager" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: alertmanager
|
||||
name: prometheus-alertmanager
|
||||
annotations:
|
||||
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
|
||||
labels:
|
||||
{{ tuple $envAll "alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||
{{ tuple $envAll "prometheus-alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||
spec:
|
||||
serviceName: {{ tuple "alerts" "discovery" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||
serviceName: {{ tuple "alertmanager" "discovery" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||
podManagementPolicy: "Parallel"
|
||||
replicas: {{ .Values.pod.replicas.alertmanager }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{ tuple $envAll "alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
|
||||
{{ tuple $envAll "prometheus-alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{ tuple $envAll "alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
||||
{{ tuple $envAll "prometheus-alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
||||
annotations:
|
||||
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
|
||||
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
|
||||
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
|
||||
{{ dict "envAll" $envAll "podName" "alertmanager" "containerNames" (list "alertmanager" "alertmanager-perms" "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
|
||||
{{ dict "envAll" $envAll "podName" "alertmanager" "containerNames" (list "alertmanager" "alertmanager_perms" "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
|
||||
spec:
|
||||
{{ dict "envAll" $envAll "application" "server" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
|
||||
serviceAccountName: {{ $serviceAccountName }}
|
||||
affinity:
|
||||
{{ tuple $envAll "alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
|
||||
{{ tuple $envAll "prometheus-alertmanager" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
|
||||
nodeSelector:
|
||||
{{ .Values.labels.alertmanager.node_selector_key }}: {{ .Values.labels.alertmanager.node_selector_value | quote }}
|
||||
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.alertmanager.timeout | default "30" }}
|
||||
initContainers:
|
||||
{{ tuple $envAll "alertmanager" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
||||
- name: alertmanager-perms
|
||||
{{ tuple $envAll "alertmanager" | include "helm-toolkit.snippets.image" | indent 10 }}
|
||||
- name: prometheus-alertmanager-perms
|
||||
{{ tuple $envAll "prometheus-alertmanager" | include "helm-toolkit.snippets.image" | indent 10 }}
|
||||
{{ tuple $envAll $envAll.Values.pod.resources.alertmanager | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
||||
{{ dict "envAll" $envAll "application" "server" "container" "alertmanager_perms" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
|
||||
command:
|
||||
@ -70,8 +70,8 @@ spec:
|
||||
- name: alertmanager-data
|
||||
mountPath: /var/lib/alertmanager/data
|
||||
containers:
|
||||
- name: alertmanager
|
||||
{{ tuple $envAll "alertmanager" | include "helm-toolkit.snippets.image" | indent 10 }}
|
||||
- name: prometheus-alertmanager
|
||||
{{ tuple $envAll "prometheus-alertmanager" | include "helm-toolkit.snippets.image" | indent 10 }}
|
||||
{{ tuple $envAll $envAll.Values.pod.resources.alertmanager | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
||||
{{ dict "envAll" $envAll "application" "server" "container" "alertmanager" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
|
||||
command:
|
||||
@ -85,18 +85,18 @@ spec:
|
||||
- stop
|
||||
env:
|
||||
- name: DISCOVERY_SVC
|
||||
value: {{ tuple "alerts" "discovery" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||
value: {{ tuple "alertmanager" "discovery" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}
|
||||
- name: MESH_PORT
|
||||
value: {{ tuple "alerts" "internal" "mesh" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }}
|
||||
value: {{ tuple "alertmanager" "internal" "mesh" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }}
|
||||
ports:
|
||||
- name: alerts-api
|
||||
containerPort: {{ tuple "alerts" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||
containerPort: {{ tuple "alertmanager" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||
- name: peer-mesh
|
||||
containerPort: {{ tuple "alerts" "internal" "mesh" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||
containerPort: {{ tuple "alertmanager" "internal" "mesh" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /#/status
|
||||
port: {{ tuple "alerts" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||
port: {{ tuple "alertmanager" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||
initialDelaySeconds: 30
|
||||
timeoutSeconds: 30
|
||||
volumeMounts:
|
||||
|
@ -18,7 +18,7 @@
|
||||
---
|
||||
images:
|
||||
tags:
|
||||
alertmanager: docker.io/prom/alertmanager:v0.20.0
|
||||
prometheus-alertmanager: docker.io/prom/alertmanager:v0.20.0
|
||||
dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0
|
||||
image_repo_sync: docker.io/docker:17.07.0
|
||||
pull_policy: IfNotPresent
|
||||
@ -101,13 +101,13 @@ endpoints:
|
||||
port:
|
||||
registry:
|
||||
node: 5000
|
||||
alerts:
|
||||
name: alertmanager
|
||||
alertmanager:
|
||||
name: prometheus-alertmanager
|
||||
namespace: null
|
||||
hosts:
|
||||
default: alerts-engine
|
||||
public: alertmanager
|
||||
discovery: alertmanager-discovery
|
||||
public: prometheus-alertmanager
|
||||
discovery: prometheus-alertmanager-discovery
|
||||
host_fqdn_override:
|
||||
default: null
|
||||
# NOTE(srwilkers): this chart supports TLS for fqdn over-ridden public
|
||||
@ -126,7 +126,7 @@ endpoints:
|
||||
default: 9093
|
||||
public: 80
|
||||
mesh:
|
||||
default: 6783
|
||||
default: 9094
|
||||
|
||||
dependencies:
|
||||
dynamic:
|
||||
@ -160,7 +160,7 @@ network:
|
||||
|
||||
secrets:
|
||||
tls:
|
||||
alerts:
|
||||
alertmanager:
|
||||
alertmanager:
|
||||
public: alerts-tls-public
|
||||
|
||||
@ -197,7 +197,7 @@ conf:
|
||||
storage:
|
||||
path: /var/lib/alertmanager/data
|
||||
cluster:
|
||||
listen_address: "0.0.0.0:6783"
|
||||
listen_address: "0.0.0.0:9094"
|
||||
alertmanager:
|
||||
global:
|
||||
# The smarthost and SMTP sender used for mail notifications.
|
||||
|
@ -174,7 +174,7 @@ endpoints:
|
||||
default: 9093
|
||||
public: 80
|
||||
mesh:
|
||||
default: 6783
|
||||
default: 9094
|
||||
ldap:
|
||||
hosts:
|
||||
default: ldap
|
||||
|
@ -48,7 +48,7 @@ network_policy:
|
||||
- protocol: TCP
|
||||
port: 9090
|
||||
- protocol: TCP
|
||||
port: 6783
|
||||
port: 9094
|
||||
- protocol: TCP
|
||||
port: 9108
|
||||
- protocol: TCP
|
||||
|
@ -31,7 +31,7 @@ network_policy:
|
||||
- protocol: TCP
|
||||
port: 9093
|
||||
- protocol: TCP
|
||||
port: 6783
|
||||
port: 9094
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
EOF
|
||||
|
Loading…
Reference in New Issue
Block a user