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:
willxz 2020-07-20 08:18:34 -04:00
parent 68940203db
commit c97c592216
12 changed files with 40 additions and 40 deletions

View File

@ -29,7 +29,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 --cluster.peer={{ .Release.Name }}-$pod_suffix.$DISCOVERY_SVC:$MESH_PORT echo --cluster.peer=prometheus-alertmanager-$pod_suffix.$DISCOVERY_SVC:$MESH_PORT
done done
} }

View File

@ -14,7 +14,7 @@ limitations under the License.
{{- if .Values.manifests.clusterrolebinding }} {{- if .Values.manifests.clusterrolebinding }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $serviceAccountName := printf "%s-%s" .Release.Name "alertmanager" }} {{- $serviceAccountName := printf "%s" "prometheus-alertmanager" }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding

View File

@ -13,6 +13,6 @@ limitations under the License.
*/}} */}}
{{- if and .Values.manifests.ingress .Values.network.alertmanager.ingress.public }} {{- 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" }} {{ $ingressOpts | include "helm-toolkit.manifests.ingress" }}
{{- end }} {{- end }}

View File

@ -13,5 +13,5 @@ limitations under the License.
*/}} */}}
{{- if .Values.manifests.secret_ingress_tls }} {{- 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 }} {{- end }}

View File

@ -18,13 +18,13 @@ limitations under the License.
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: 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: spec:
type: ClusterIP type: ClusterIP
clusterIP: None clusterIP: None
ports: ports:
- name: peer-mesh - 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: 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 }} {{- end }}

View File

@ -13,6 +13,6 @@ limitations under the License.
*/}} */}}
{{- if and .Values.manifests.service_ingress .Values.network.alertmanager.ingress.public }} {{- 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" }} {{ $serviceIngressOpts | include "helm-toolkit.manifests.service_ingress" }}
{{- end }} {{- end }}

View File

@ -18,16 +18,16 @@ limitations under the License.
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: 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: spec:
ports: ports:
- name: alerts-api - name: alerts-api
{{ 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: {{ tuple "alerts" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} port: {{ tuple "alertmanager" "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 "prometheus-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 }}
type: NodePort type: NodePort
{{ end }} {{ end }}

View File

@ -18,45 +18,45 @@ limitations under the License.
{{- $mounts_alertmanager := .Values.pod.mounts.alertmanager.alertmanager }} {{- $mounts_alertmanager := .Values.pod.mounts.alertmanager.alertmanager }}
{{- $mounts_alertmanager_init := .Values.pod.mounts.alertmanager.init_container }} {{- $mounts_alertmanager_init := .Values.pod.mounts.alertmanager.init_container }}
{{- $serviceAccountName := "alertmanager" }} {{- $serviceAccountName := "prometheus-alertmanager" }}
{{ tuple $envAll "alertmanager" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll "prometheus-alertmanager" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
name: alertmanager name: prometheus-alertmanager
annotations: annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
labels: 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: 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" podManagementPolicy: "Parallel"
replicas: {{ .Values.pod.replicas.alertmanager }} replicas: {{ .Values.pod.replicas.alertmanager }}
selector: selector:
matchLabels: 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: template:
metadata: metadata:
labels: 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: annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.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: spec:
{{ dict "envAll" $envAll "application" "server" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} {{ dict "envAll" $envAll "application" "server" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
serviceAccountName: {{ $serviceAccountName }} serviceAccountName: {{ $serviceAccountName }}
affinity: 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: nodeSelector:
{{ .Values.labels.alertmanager.node_selector_key }}: {{ .Values.labels.alertmanager.node_selector_value | quote }} {{ .Values.labels.alertmanager.node_selector_key }}: {{ .Values.labels.alertmanager.node_selector_value | quote }}
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.alertmanager.timeout | default "30" }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.alertmanager.timeout | default "30" }}
initContainers: initContainers:
{{ tuple $envAll "alertmanager" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ tuple $envAll "alertmanager" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
- name: alertmanager-perms - name: prometheus-alertmanager-perms
{{ tuple $envAll "alertmanager" | include "helm-toolkit.snippets.image" | indent 10 }} {{ 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 }} {{ 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 }} {{ dict "envAll" $envAll "application" "server" "container" "alertmanager_perms" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command: command:
@ -70,8 +70,8 @@ spec:
- name: alertmanager-data - name: alertmanager-data
mountPath: /var/lib/alertmanager/data mountPath: /var/lib/alertmanager/data
containers: containers:
- name: alertmanager - name: prometheus-alertmanager
{{ tuple $envAll "alertmanager" | include "helm-toolkit.snippets.image" | indent 10 }} {{ 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 }} {{ 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 }} {{ dict "envAll" $envAll "application" "server" "container" "alertmanager" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command: command:
@ -85,18 +85,18 @@ spec:
- stop - stop
env: env:
- name: DISCOVERY_SVC - 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 - 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: ports:
- name: alerts-api - 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 - 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: readinessProbe:
httpGet: httpGet:
path: /#/status 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 initialDelaySeconds: 30
timeoutSeconds: 30 timeoutSeconds: 30
volumeMounts: volumeMounts:

View File

@ -18,7 +18,7 @@
--- ---
images: images:
tags: 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 dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0
image_repo_sync: docker.io/docker:17.07.0 image_repo_sync: docker.io/docker:17.07.0
pull_policy: IfNotPresent pull_policy: IfNotPresent
@ -101,13 +101,13 @@ endpoints:
port: port:
registry: registry:
node: 5000 node: 5000
alerts: alertmanager:
name: alertmanager name: prometheus-alertmanager
namespace: null namespace: null
hosts: hosts:
default: alerts-engine default: alerts-engine
public: alertmanager public: prometheus-alertmanager
discovery: alertmanager-discovery discovery: prometheus-alertmanager-discovery
host_fqdn_override: host_fqdn_override:
default: null default: null
# NOTE(srwilkers): this chart supports TLS for fqdn over-ridden public # NOTE(srwilkers): this chart supports TLS for fqdn over-ridden public
@ -126,7 +126,7 @@ endpoints:
default: 9093 default: 9093
public: 80 public: 80
mesh: mesh:
default: 6783 default: 9094
dependencies: dependencies:
dynamic: dynamic:
@ -160,7 +160,7 @@ network:
secrets: secrets:
tls: tls:
alerts: alertmanager:
alertmanager: alertmanager:
public: alerts-tls-public public: alerts-tls-public
@ -197,7 +197,7 @@ conf:
storage: storage:
path: /var/lib/alertmanager/data path: /var/lib/alertmanager/data
cluster: cluster:
listen_address: "0.0.0.0:6783" listen_address: "0.0.0.0:9094"
alertmanager: alertmanager:
global: global:
# The smarthost and SMTP sender used for mail notifications. # The smarthost and SMTP sender used for mail notifications.

View File

@ -174,7 +174,7 @@ endpoints:
default: 9093 default: 9093
public: 80 public: 80
mesh: mesh:
default: 6783 default: 9094
ldap: ldap:
hosts: hosts:
default: ldap default: ldap

View File

@ -48,7 +48,7 @@ network_policy:
- protocol: TCP - protocol: TCP
port: 9090 port: 9090
- protocol: TCP - protocol: TCP
port: 6783 port: 9094
- protocol: TCP - protocol: TCP
port: 9108 port: 9108
- protocol: TCP - protocol: TCP

View File

@ -31,7 +31,7 @@ network_policy:
- protocol: TCP - protocol: TCP
port: 9093 port: 9093
- protocol: TCP - protocol: TCP
port: 6783 port: 9094
- protocol: TCP - protocol: TCP
port: 80 port: 80
EOF EOF