Skip to content

Commit

Permalink
fixed alertmanager ipv6 compatibility (#1440)
Browse files Browse the repository at this point in the history
* fixed alertmanager ipv6 compatibility

* updated formatting

* updated readme
  • Loading branch information
AndrewChubatiuk authored Sep 5, 2024
1 parent 7a26669 commit 4bd8bf2
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 36 deletions.
1 change: 1 addition & 0 deletions charts/victoria-metrics-alert/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Next release

- Added ability to override deployment namespace using `namespaceOverride` and `global.namespaceOverride` variables
- updated alertmanager args for IPv6 compatibility. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/856)

## 0.11.0

Expand Down
10 changes: 10 additions & 0 deletions charts/victoria-metrics-alert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,16 @@ Prefix
</td>
<td></td>
</tr>
<tr>
<td>alertmanager.initContainers</td>
<td>list</td>
<td><pre lang="plaintext">
[]
</pre>
</td>
<td><p>Additional initContainers to initialize the pod</p>
</td>
</tr>
<tr>
<td>alertmanager.listenAddress</td>
<td>string</td>
Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-alert/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ http://{{- include "vmalert.alertmanager.fullname" . -}}:9093{{ .Values.alertman
{{- $_ := set $args "storage.path" (ternary $app.persistentVolume.mountPath "/data" $app.persistentVolume.enabled) -}}
{{- $_ := set $args "data.retention" $app.retention -}}
{{- $_ := set $args "web.listen-address" $app.listenAddress -}}
{{- $_ := set $args "cluster.advertise-address" "$(POD_IP):6783" -}}
{{- $_ := set $args "cluster.advertise-address" "[$(POD_IP)]:6783" -}}
{{- with $app.baseURL -}}
{{- $_ := set $args "web.external-url" $app.baseURL -}}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ kind: ConfigMap
metadata:
name: {{ include "vmalert.alertmanager.configname" .}}
namespace: {{include "vm.namespace" .}}
labels: {{- include "vmalert.alertmanager.labels" . | nindent 4}}
labels: {{ include "vmalert.alertmanager.labels" . | nindent 4 }}
data:
alertmanager.yaml: |
{{ toYaml .Values.alertmanager.config | nindent 4 }}
{{- range $key, $value := .Values.alertmanager.templates }}
{{ $key }}: |-
{{- $value | nindent 4 }}
alertmanager.yaml: |{{ toYaml .Values.alertmanager.config | nindent 4 }}
{{- range $key, $value := .Values.alertmanager.templates }}
{{ $key }}: |{{ $value | nindent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ spec:
{{- with ($app.imagePullSecrets | default .Values.global.imagePullSecrets) }}
imagePullSecrets: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with $app.initContainers }}
initContainers: {{ toYaml . | nindent 8 }}
{{- end }}
containers:
- name: alertmanager
{{- if $app.securityContext.enabled }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ kind: Service
metadata:
namespace: {{ include "vm.namespace" . }}
{{- with $app.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
{{- $ctx := merge (deepCopy .) (dict "extraLabels" $app.service.labels) }}
labels: {{ include "vmalert.alertmanager.labels" $ctx | nindent 4 }}
Expand Down
16 changes: 7 additions & 9 deletions charts/victoria-metrics-alert/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "vmalert.server.fullname" . }}-clusterrolebinding
namespace: {{ include "vm.namespace" . }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.rbac.extraLabels }}
{{ toYaml . | indent 4}}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
labels: {{ include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.rbac.extraLabels }}
{{- toYaml . | nindent 4}}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
subjects:
- kind: ServiceAccount
name: {{ include "vmalert.serviceAccountName" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ spec:
imagePullSecrets: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with $app.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
initContainers: {{ toYaml . | nindent 8 }}
{{- end }}
containers:
- name: vmalert
Expand Down
6 changes: 2 additions & 4 deletions charts/victoria-metrics-alert/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ kind: ServiceAccount
metadata:
name: {{ include "vmalert.serviceAccountName" . }}
namespace: {{ include "vm.namespace" . }}
labels:
{{- include "vmalert.common.metaLabels" . | nindent 4 }}
labels: {{ include "vmalert.common.metaLabels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
17 changes: 6 additions & 11 deletions charts/victoria-metrics-alert/templates/vpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,17 @@ metadata:
name: {{ include "vmalert.server.fullname" . }}
namespace: {{ include "vm.namespace" . }}
spec:
{{- if .Values.server.verticalPodAutoscaler.recommenders }}
recommenders:
{{- range .Values.server.verticalPodAutoscaler.recommenders }}
- name: {{ .name }}
{{- end }}
{{- with .Values.server.verticalPodAutoscaler.recommenders }}
recommenders: {{ toYaml . | nindent 4 }}
{{- end }}
targetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "vmalert.server.fullname" . }}
{{- if .Values.server.verticalPodAutoscaler.updatePolicy }}
updatePolicy:
{{- toYaml .Values.server.verticalPodAutoscaler.updatePolicy | nindent 4 }}
{{- with .Values.server.verticalPodAutoscaler.updatePolicy }}
updatePolicy: {{ toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.server.verticalPodAutoscaler.resourcePolicy }}
resourcePolicy:
{{- toYaml .Values.server.verticalPodAutoscaler.resourcePolicy | nindent 4 }}
{{- with .Values.server.verticalPodAutoscaler.resourcePolicy }}
resourcePolicy: {{ toYaml . | nindent 4 }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/victoria-metrics-alert/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ alertmanager:
#- name: config-reloader
# image: reloader-image

# -- Additional initContainers to initialize the pod
initContainers: []

# -- Add extra specs dynamically to this chart
extraObjects: []

Expand Down

0 comments on commit 4bd8bf2

Please sign in to comment.