Skip to content

Commit

Permalink
k8s-stack: alertmanager upgrade 0.27.0 and other minor bugfixes and i…
Browse files Browse the repository at this point in the history
…mprovements (#1570)

* k8s-stack: alertmanager upgrade 0.27.0

* added operator resources, lifecycle and termination grace period

* release operator chart

* fail if crd.cleanup.image.tag is not string
  • Loading branch information
AndrewChubatiuk authored Oct 10, 2024
1 parent 563182d commit 34e1fec
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 10 deletions.
1 change: 1 addition & 0 deletions charts/victoria-metrics-k8s-stack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Next release

- Generate VM components tag version from chart app name by default
- Upgraded default Alertmanager tag 0.25.0 -> 0.27.0

## 0.27.0

Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-k8s-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ tls: []
<code class="language-yaml">configSecret: ""
externalURL: ""
image:
tag: v0.25.0
tag: v0.27.0
port: "9093"
routePrefix: /
selectAllByDefault: true
Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-k8s-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ alertmanager:
port: "9093"
selectAllByDefault: true
image:
tag: v0.25.0
tag: v0.27.0
externalURL: ""
routePrefix: /

Expand Down
2 changes: 2 additions & 0 deletions charts/victoria-metrics-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Next release

- upgraded common chart dependency
- added configurable cleanup hook resources. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1571)
- added ability to configure `terminationGracePeriodSeconds` and `lifecycle`. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1563) for details

## 0.35.2

Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ home: https://github.com/VictoriaMetrics/operator
sources:
- https://github.com/VictoriaMetrics/helm-charts
- https://github.com/VictoriaMetrics/operator
version: 0.35.2
version: 0.35.3
icon: https://avatars.githubusercontent.com/u/43720803?s=200&v=4
kubeVersion: '>=1.25.0-0'
keywords:
Expand Down
38 changes: 38 additions & 0 deletions charts/victoria-metrics-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,22 @@ tag: ""
</pre>
</td>
<td><p>Image configuration for CRD cleanup Job</p>
</td>
</tr>
<tr>
<td>crd.cleanup.resources</td>
<td>object</td>
<td><pre class="helm-vars-default-value" language-yaml" lang="plaintext">
<code class="language-yaml">limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 100m
memory: 56Mi
</code>
</pre>
</td>
<td><p>Cleanup hook resources</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -567,6 +583,17 @@ variant: ""
</pre>
</td>
<td><p>Secret to pull images</p>
</td>
</tr>
<tr>
<td>lifecycle</td>
<td>object</td>
<td><pre class="helm-vars-default-value" language-yaml" lang="plaintext">
<code class="language-yaml">{}
</code>
</pre>
</td>
<td><p>Operator lifecycle. See <a href="https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/" target="_blank">this article</a> for details.</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -979,6 +1006,17 @@ tlsConfig: {}
</pre>
</td>
<td><p>Configures monitoring with serviceScrape. VMServiceScrape must be pre-installed</p>
</td>
</tr>
<tr>
<td>terminationGracePeriodSeconds</td>
<td>int</td>
<td><pre class="helm-vars-default-value" language-yaml" lang="">
<code class="language-yaml">30
</code>
</pre>
</td>
<td><p>Graceful pod termination timeout. See <a href="https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution" target="_blank">this article</a> for details.</p>
</td>
</tr>
<tr>
Expand Down
4 changes: 4 additions & 0 deletions charts/victoria-metrics-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ spec:
{{- with .Values.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- with .Values.lifecycle }}
lifecycle: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
10 changes: 3 additions & 7 deletions charts/victoria-metrics-operator/templates/uninstall_hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
{{- if empty ($app.image).tag }}
{{- $tag := (printf "%s.%s" .Capabilities.KubeVersion.Major .Capabilities.KubeVersion.Minor) | replace "+" "" -}}
{{- $_ := set $app.image "tag" $tag }}
{{- else if not (kindIs "string" ($app.image).tag) }}
{{- fail "`crd.cleanup.image.tag` is not string, most probably you need to enquote provided value" -}}
{{- end }}
---
apiVersion: batch/v1
Expand All @@ -32,13 +34,7 @@ spec:
- name: kubectl
image: {{ include "vm.image" (dict "helm" . "app" $app) }}
imagePullPolicy: {{ $app.image.pullPolicy }}
resources:
limits:
cpu: "500m"
memory: "256Mi"
requests:
cpu: "100m"
memory: "56Mi"
resources: {{ toYaml $app.resources | nindent 12 }}
args:
- delete
- {{ (keys .Values.admissionWebhooks.enabledCRDValidation) | sortAlpha | join "," }}
Expand Down
14 changes: 14 additions & 0 deletions charts/victoria-metrics-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ crd:
# use image tag that matches k8s API version by default
tag: ""
pullPolicy: IfNotPresent
# -- Cleanup hook resources
resources:
limits:
cpu: "500m"
memory: "256Mi"
requests:
cpu: "100m"
memory: "56Mi"

# -- Number of operator replicas
replicaCount: 1
Expand Down Expand Up @@ -142,6 +150,12 @@ podDisruptionBudget:
# maxUnavailable: 1
labels: {}

# -- Graceful pod termination timeout. See [this article](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution) for details.
terminationGracePeriodSeconds: 30

# -- Operator lifecycle. See [this article](https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/) for details.
lifecycle: {}

# -- Resource object
resources:
{}
Expand Down

0 comments on commit 34e1fec

Please sign in to comment.