Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/netdata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ The following table lists the configurable parameters of the netdata chart and t
| `APIKEY` | The key shared between the parent and the child netdata for streaming | `11111111-2222-3333-4444-555555555555` |
| `restarter.enabled` | Install CronJob to update Netdata Pods | `false` |
| `restarter.schedule` | The schedule in Cron format | `00 06 * * *` |
| `restarter.image.repository` | Container image repo | `bitnami/kubectl` |
| `restarter.image.tag` | Container image tag | `1.25` |
| `restarter.image.repository` | Container image repo | `rancher/kubectl` |
| `restarter.image.tag` | Container image tag if `.auto`, the image tag version of `rancher/kubectl` will reflect the Kubernetes cluster version | `.auto` |
| `restarter.image.pullPolicy` | Container image pull policy | `Always` |
| `restarter.image.restartPolicy` | Container restart policy | `Never` |
| `restarter.image.resources` | Container resources | `{}` |
Expand Down
24 changes: 11 additions & 13 deletions charts/netdata/templates/restarter/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{- if include "netdata.restarter.enabled" . }}
---
{{- $cmdList := list }}
{{- $cmd := printf "kubectl rollout restart deployment %s-parent" (include "netdata.name" .) }}
{{- $cmdList = append $cmdList (ternary $cmd "" .Values.parent.enabled) }}
{{- $cmd = printf "kubectl rollout restart daemonset %s-child" (include "netdata.name" .) }}
{{- $cmdList = append $cmdList (ternary $cmd "" .Values.child.enabled) }}
{{- $cmd = printf "kubectl rollout restart deployment %s-k8s-state" (include "netdata.name" .) }}
{{- $cmdList = append $cmdList (ternary $cmd "" .Values.k8sState.enabled) }}
{{- $cmdList = compact $cmdList }}
{{- $argsList := list }}
{{- $args := printf "deployment/%s-parent" (include "netdata.name" .) }}
{{- $argsList = append $argsList (ternary $args "" .Values.parent.enabled) }}
{{- $args = printf "daemonset/%s-child" (include "netdata.name" .) }}
{{- $argsList = append $argsList (ternary $args "" .Values.child.enabled) }}
{{- $args = printf "deployment/%s-k8s-state" (include "netdata.name" .) }}
{{- $argsList = append $argsList (ternary $args "" .Values.k8sState.enabled) }}
{{- $argsList = compact $argsList }}
apiVersion: batch/v1
kind: CronJob
metadata:
Expand All @@ -31,12 +31,10 @@ spec:
{{- end }}
containers:
- name: netdata-restarter
image: {{ .Values.restarter.image.repository }}:{{ .Values.restarter.image.tag }}
image: {{ .Values.restarter.image.repository }}:{{ ternary (printf "v%s.%s.0" .Capabilities.KubeVersion.Major .Capabilities.KubeVersion.Minor) .Values.restarter.image.tag (eq (.Values.restarter.image.tag | toString) ".auto") }}
Comment thread
ilyam8 marked this conversation as resolved.
imagePullPolicy: {{ .Values.restarter.image.pullPolicy }}
resources:
{{ toYaml .Values.restarter.resources | indent 16 }}
Comment thread
ilyam8 marked this conversation as resolved.
command:
- "/bin/bash"
- "-c"
- {{ $cmdList | join " && " }}
args:
{{ toYaml (concat (list "rollout" "restart") $argsList) | indent 16 }}
{{- end }}
Comment thread
ilyam8 marked this conversation as resolved.
5 changes: 3 additions & 2 deletions charts/netdata/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ restarter:
enabled: false
schedule: "00 06 * * *"
image:
repository: bitnami/kubectl
tag: 1.25
repository: rancher/kubectl
# if `.auto`, the image tag version of the rancher/kubectl will reflect the Kubernetes cluster version
tag: .auto
pullPolicy: Always
restartPolicy: Never
resources: {}
Expand Down