Skip to content

Commit

Permalink
Merge pull request #890 from nheinemans-asml/cleanup-image-values
Browse files Browse the repository at this point in the history
fix: Add values to overwrite cleanup image
  • Loading branch information
Kidswiss authored Sep 27, 2023
2 parents 7029d1c + 978ddf3 commit ba9fb58
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/k8up/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ keywords:
- backup
- operator
- restic
version: 4.4.1
version: 4.4.2
sources:
- https://github.com/k8up-io/k8up
maintainers:
Expand Down
8 changes: 6 additions & 2 deletions charts/k8up/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# k8up

![Version: 4.4.1](https://img.shields.io/badge/Version-4.4.1-informational?style=flat-square)
![Version: 4.4.2](https://img.shields.io/badge/Version-4.4.2-informational?style=flat-square)

Kubernetes and OpenShift Backup Operator based on restic

Expand All @@ -13,7 +13,7 @@ helm repo add k8up-io https://k8up-io.github.io/k8up
helm install k8up k8up-io/k8up
```
```bash
kubectl apply -f https://github.com/k8up-io/k8up/releases/download/k8up-4.4.1/k8up-crd.yaml
kubectl apply -f https://github.com/k8up-io/k8up/releases/download/k8up-4.4.2/k8up-crd.yaml
```

<!---
Expand Down Expand Up @@ -41,6 +41,10 @@ Document your changes in values.yaml and let `make docs:helm` generate this sect
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| cleanup.pullPolicy | string | `"IfNotPresent"` | Cleanup-job image pull policy |
| cleanup.registry | string | `"docker.io"` | Cleanup-job image registry |
| cleanup.repository | string | `"bitnami/kubectl"` | Cleanup-job image repository |
| cleanup.tag | string | `"latest"` | Cleanup-job image tag (version) |
| image.pullPolicy | string | `"IfNotPresent"` | Operator image pull policy |
| image.registry | string | `"ghcr.io"` | Operator image registry |
| image.repository | string | `"k8up-io/k8up"` | Operator image repository |
Expand Down
9 changes: 9 additions & 0 deletions charts/k8up/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,12 @@ Backup Image
{{ if .k8up.backupImage.repository }}{{ .k8up.backupImage.repository }}{{ else }}{{ .image.registry}}/{{ .image.repository }}{{ end }}:{{ if .k8up.backupImage.tag }}{{ .k8up.backupImage.tag }}{{ else }}{{ .image.tag }}{{ end }}
{{- end -}}
{{- end -}}

{{/*
Cleanup Image
*/}}
{{- define "cleanupImage" -}}
{{- with .Values -}}
{{ if .cleanup.registry }}{{ .cleanup.registry }}/{{ end }}{{ .cleanup.repository }}:{{ .cleanup.tag }}
{{- end -}}
{{- end -}}
3 changes: 2 additions & 1 deletion charts/k8up/templates/cleanup-hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ spec:
serviceAccountName: cleanup-service-account
containers:
- name: "{{ .Release.Name }}-cleanup"
image: "bitnami/kubectl:latest"
image: "{{ include "cleanupImage" . }}"
imagePullPolicy: {{ .Values.cleanup.pullPolicy }}
command:
- sh
- -c
Expand Down
11 changes: 11 additions & 0 deletions charts/k8up/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,14 @@ resources:
cpu: 20m
# -- Memory request of K8up operator. See [supported units][resource-units].
memory: 128Mi

cleanup:
# -- Cleanup-job image pull policy
pullPolicy: IfNotPresent
# -- Cleanup-job image registry
registry: docker.io
# -- Cleanup-job image repository
repository: bitnami/kubectl
# -- Cleanup-job image tag (version)
tag: latest

0 comments on commit ba9fb58

Please sign in to comment.