Skip to content

Commit 08fde88

Browse files
authored
Merge pull request #786 from k8up-io/pin-chart-tag
Pin K8up image tag in chart
2 parents 45813fa + 5aeccd7 commit 08fde88

File tree

8 files changed

+49
-26
lines changed

8 files changed

+49
-26
lines changed

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ deploy: kind-load-image install ## Deploy controller in the configured Kubernete
7474
--set image.registry=$(E2E_REGISTRY) \
7575
--set image.repository=$(E2E_REPO) \
7676
--set image.tag=$(E2E_TAG) \
77-
--set k8up.backupImage.repository=$(E2E_REGISTRY)/$(E2E_REPO) \
78-
--set k8up.backupImage.tag=$(E2E_TAG) \
7977
--wait $(deploy_args)
8078

8179
.PHONY: generate

charts/k8up/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ keywords:
66
- backup
77
- operator
88
- restic
9-
version: 3.0.2
9+
version: 4.0.0
1010
sources:
1111
- https://github.com/k8up-io/k8up
1212
maintainers:

charts/k8up/README.gotmpl.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Document your changes in values.yaml and let `make docs:helm` generate this sect
2323
-->
2424
{{ template "chart.valuesSection" . }}
2525

26-
## Upgrading from Charts 0.x to 1.x
26+
## Upgrading from Charts v0 to v1
2727

2828
* In `image.repository` the registry domain was moved into its own parameter `image.registry`.
2929
* K8up 1.x features leader election, this enables rolling updates and multiple replicas.
@@ -32,15 +32,15 @@ Document your changes in values.yaml and let `make docs:helm` generate this sect
3232
* Note: Deployment strategy type has changed from `Recreate` to `RollingUpdate`.
3333
* CRDs need to be installed separately, they are no longer included in this chart.
3434

35-
## Upgrading from Charts 1.x to 2.x
35+
## Upgrading from Charts v1 to v2
3636

3737
* Note: `image.repository` changed from `vshn/k8up` to `k8up-io/k8up`.
3838
* Note: `image.registry` changed from `quay.io` to `ghcr.io`.
3939
* Note: `image.tag` changed from `v1.x` to `v2.x`. Please see the [full changelog](https://github.com/k8up-io/k8up/releases/tag/v2.0.0).
4040
* `metrics.prometheusRule.legacyRules` has been removed (no support for OpenShift 3.11 anymore).
4141
* Note: `k8up.backupImage.repository` changed from `quay.io/vshn/wrestic` to `ghcr.io/k8up-io/k8up` (`wrestic` is not needed anymore in K8up v2).
4242

43-
## Upgrading from Charts 2.x to 3.x
43+
## Upgrading from Charts v2 to v3
4444

4545
Due to the migration of the chart from [APPUiO](https://github.com/appuio/charts/tree/master/appuio/k8up) to this repo, we decided to make a breaking change for the chart.
4646
Only chart archives from version 3.x can be downloaded from the https://k8up-io.github.io/k8up index.
@@ -59,3 +59,12 @@ In most cases this shouldn't be an issue and Helm should be able to cleanup the
5959
* Note: ClusterRoleBinding `${release-name}-leader-election-rolebinding` removed (not needed anymore).
6060
* Note: Renamed ClusterRole `${release-name}-k8up-view` to `${release-name}-view`.
6161
* Note: Renamed ClusterRole `${release-name}-k8up-edit` to `${release-name}-edit`.
62+
63+
## Upgrading from Charts v3 to v4
64+
65+
The image tag is now pinned again and not using a floating tag.
66+
67+
* Parameter changed: `image.tag` now defaults to a pinned version. Each new K8up version now requires also a new chart version.
68+
* Parameter changed: `image.pullPolicy` now defaults to `IfNotPresent` instead of `Always`.
69+
* Parameter changed: `k8up.backupImage.repository` is now unset, which defaults to the same image as defined in `image.{registry/repository}`.
70+
* Parameter changed: `k8up.backupImage.tag` is now unset, which defaults to the same image tag as defined in `image.tag`.

charts/k8up/README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# k8up
22

3-
![Version: 3.0.2](https://img.shields.io/badge/Version-3.0.2-informational?style=flat-square)
3+
![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square)
44

55
Kubernetes and OpenShift Backup Operator based on restic
66

@@ -13,7 +13,7 @@ helm repo add k8up-io https://k8up-io.github.io/k8up
1313
helm install k8up k8up-io/k8up
1414
```
1515
```bash
16-
kubectl apply -f https://github.com/k8up-io/k8up/releases/download/k8up-3.0.2/k8up-crd.yaml
16+
kubectl apply -f https://github.com/k8up-io/k8up/releases/download/k8up-4.0.0/k8up-crd.yaml
1717
```
1818

1919
<!---
@@ -41,13 +41,13 @@ Document your changes in values.yaml and let `make docs:helm` generate this sect
4141
| Key | Type | Default | Description |
4242
|-----|------|---------|-------------|
4343
| affinity | object | `{}` | |
44-
| image.pullPolicy | string | `"Always"` | Operator image pull policy |
44+
| image.pullPolicy | string | `"IfNotPresent"` | Operator image pull policy |
4545
| image.registry | string | `"ghcr.io"` | Operator image registry |
4646
| image.repository | string | `"k8up-io/k8up"` | Operator image repository |
47-
| image.tag | string | `"v2"` | Operator image tag (version) |
47+
| image.tag | string | `"v2.5.2"` | Operator image tag (version) |
4848
| imagePullSecrets | list | `[]` | |
49-
| k8up.backupImage.repository | string | `"ghcr.io/k8up-io/k8up"` | The backup runner image repository |
50-
| k8up.backupImage.tag | string | `"v2"` | The backup runner image tag |
49+
| k8up.backupImage.repository | string | `""` | The backup runner image repository. Defaults to `{image.registry}/{image.repository}`. Specify an image repository including registry, e.g. `example.com/repo/image` |
50+
| k8up.backupImage.tag | string | `""` | The backup runner image tag Defaults to `{image.tag}` |
5151
| k8up.enableLeaderElection | bool | `true` | Specifies whether leader election should be enabled. |
5252
| k8up.envVars | list | `[]` | envVars allows the specification of additional environment variables. See [values.yaml](values.yaml) how to specify See documentation which variables are supported. |
5353
| k8up.globalResources | object | empty values | Specify the resource requests and limits that the Pods should have when they are scheduled by K8up. You are still able to override those via K8up resources, but this gives cluster administrators custom defaults. |
@@ -84,7 +84,7 @@ Document your changes in values.yaml and let `make docs:helm` generate this sect
8484
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
8585
| tolerations | list | `[]` | |
8686

87-
## Upgrading from Charts 0.x to 1.x
87+
## Upgrading from Charts v0 to v1
8888

8989
* In `image.repository` the registry domain was moved into its own parameter `image.registry`.
9090
* K8up 1.x features leader election, this enables rolling updates and multiple replicas.
@@ -93,15 +93,15 @@ Document your changes in values.yaml and let `make docs:helm` generate this sect
9393
* Note: Deployment strategy type has changed from `Recreate` to `RollingUpdate`.
9494
* CRDs need to be installed separately, they are no longer included in this chart.
9595

96-
## Upgrading from Charts 1.x to 2.x
96+
## Upgrading from Charts v1 to v2
9797

9898
* Note: `image.repository` changed from `vshn/k8up` to `k8up-io/k8up`.
9999
* Note: `image.registry` changed from `quay.io` to `ghcr.io`.
100100
* Note: `image.tag` changed from `v1.x` to `v2.x`. Please see the [full changelog](https://github.com/k8up-io/k8up/releases/tag/v2.0.0).
101101
* `metrics.prometheusRule.legacyRules` has been removed (no support for OpenShift 3.11 anymore).
102102
* Note: `k8up.backupImage.repository` changed from `quay.io/vshn/wrestic` to `ghcr.io/k8up-io/k8up` (`wrestic` is not needed anymore in K8up v2).
103103

104-
## Upgrading from Charts 2.x to 3.x
104+
## Upgrading from Charts v2 to v3
105105

106106
Due to the migration of the chart from [APPUiO](https://github.com/appuio/charts/tree/master/appuio/k8up) to this repo, we decided to make a breaking change for the chart.
107107
Only chart archives from version 3.x can be downloaded from the https://k8up-io.github.io/k8up index.
@@ -121,6 +121,15 @@ In most cases this shouldn't be an issue and Helm should be able to cleanup the
121121
* Note: Renamed ClusterRole `${release-name}-k8up-view` to `${release-name}-view`.
122122
* Note: Renamed ClusterRole `${release-name}-k8up-edit` to `${release-name}-edit`.
123123

124+
## Upgrading from Charts v3 to v4
125+
126+
The image tag is now pinned again and not using a floating tag.
127+
128+
* Parameter changed: `image.tag` now defaults to a pinned version. Each new K8up version now requires also a new chart version.
129+
* Parameter changed: `image.pullPolicy` now defaults to `IfNotPresent` instead of `Always`.
130+
* Parameter changed: `k8up.backupImage.repository` is now unset, which defaults to the same image as defined in `image.{registry/repository}`.
131+
* Parameter changed: `k8up.backupImage.tag` is now unset, which defaults to the same image tag as defined in `image.tag`.
132+
124133
## Source Code
125134

126135
* <https://github.com/k8up-io/k8up>

charts/k8up/templates/_helpers.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,12 @@ Create the name of the service account to use
7171
{{ default "default" .Values.serviceAccount.name }}
7272
{{- end -}}
7373
{{- end -}}
74+
75+
{{/*
76+
Backup Image
77+
*/}}
78+
{{- define "k8up.backupImage" -}}
79+
{{- with .Values -}}
80+
{{ if .k8up.backupImage.repository }}{{ .k8up.backupImage.repository }}{{ else }}{{ .image.registry}}/{{ .image.repository }}{{ end }}:{{ if .k8up.backupImage.tag }}{{ .k8up.backupImage.tag }}{{ else }}{{ .image.tag }}{{ end }}
81+
{{- end -}}
82+
{{- end -}}

charts/k8up/templates/deployment.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ spec:
3030
imagePullPolicy: {{ .Values.image.pullPolicy }}
3131
args: [ operator ]
3232
env:
33-
{{- with .Values.k8up.backupImage }}
3433
- name: BACKUP_IMAGE
35-
value: "{{ .repository}}:{{ .tag }}"
36-
{{- end }}
34+
value: "{{ include "k8up.backupImage" . }}"
3735
{{- with .Values.k8up.timezone }}
3836
- name: TZ
3937
value: {{ . }}

charts/k8up/values.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
replicaCount: 1
55
image:
66
# -- Operator image pull policy
7-
pullPolicy: Always
7+
pullPolicy: IfNotPresent
88
# -- Operator image registry
99
registry: ghcr.io
1010
# -- Operator image repository
1111
repository: k8up-io/k8up
1212
# -- Operator image tag (version)
13-
tag: v2
13+
tag: v2.5.2
1414

1515
imagePullSecrets: []
1616
serviceAccount:
@@ -32,10 +32,13 @@ k8up:
3232
# key: access-key-id
3333

3434
backupImage:
35-
# -- The backup runner image repository
36-
repository: ghcr.io/k8up-io/k8up
35+
# -- The backup runner image repository.
36+
# Defaults to `{image.registry}/{image.repository}`.
37+
# Specify an image repository including registry, e.g. `example.com/repo/image`
38+
repository: ""
3739
# -- The backup runner image tag
38-
tag: v2
40+
# Defaults to `{image.tag}`
41+
tag: ""
3942

4043
# -- Specifies the timezone K8up is using for scheduling.
4144
# Empty value defaults to the timezone in which Kubernetes is deployed.

e2e/definitions/operator/values.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ image:
66
repository: $E2E_REPO
77
tag: $E2E_TAG
88
k8up:
9-
backupImage:
10-
repository: $E2E_REGISTRY/$E2E_REPO
11-
tag: $E2E_TAG
129
env:
1310
- name: K8UP_DEBUG
1411
value: "true"

0 commit comments

Comments
 (0)