Skip to content

Commit dfd6776

Browse files
committed
Ensure that the garage instance remains disabled when users previously
had minio disabled Signed-off-by: Jannik Hollenbach <jannik.hollenbach@iteratec.com>
1 parent f941921 commit dfd6776

10 files changed

Lines changed: 64 additions & 9 deletions

File tree

‎documentation/docs/getting-started/installation.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ The included [Garage](https://garagehq.deuxfleurs.fr/) instance is intended **on
3636
This provides better reliability, scalability, and security compared to the embedded single-node Garage instance.
3737
:::
3838

39+
:::note Upgrading from MinIO
40+
As of release 5.9.0, the bundled storage backend was migrated from `minio` to `garage`. This was necessary because MinIO stopped publishing their own Docker image, and the migration had to happen outside of a major release.
41+
:::
42+
3943
The default secureCodeBox Operator includes a [Garage](https://garagehq.deuxfleurs.fr/) instance, which acts as a local S3 filestorage API used by the secureCodeBox to store the results files of its scans. You can switch it out with a S3 compatible API provided by most cloud providers.
4044

4145
Garage doesn't ship a web UI, so you access it with any S3-compatible client (e.g. the [`mc`](https://garagehq.deuxfleurs.fr/documentation/connect/cli/) CLI or `aws s3`) after port forwarding its S3 API:
@@ -61,6 +65,10 @@ For production environments, it is **strongly recommended** to replace the defau
6165

6266
To change out the default Garage instance with a S3 Bucket from a cloud provider you can update the helm values to connect the operator with you S3 bucket.
6367

68+
:::note Upgrading from MinIO
69+
As of release 5.9.0, the bundled storage backend was migrated from `minio` to `garage`. This was necessary because MinIO stopped publishing their own Docker image, and the migration had to happen outside of a major release. If you already disabled the bundled instance via `minio.enabled: false` together with your own `s3:` configuration, that value is still honored, so no changes are required. New installs and any values files that still reference other `minio.*` keys should switch to the `garage.*` equivalents described below.
70+
:::
71+
6472
#### AWS S3 Buckets
6573

6674
```yaml

‎operator/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ helm install securecodebox-operator oci://ghcr.io/securecodebox/helm/operator
7474
| customCACertificate.existingCertificate | string | `nil` | name of the configMap holding the ca certificate(s), needs to be the same across all namespaces |
7575
| extraVolumeMounts | list | `[]` | Additional volume mounts to be mounted to the operator deployment |
7676
| extraVolumes | list | `[]` | Additional volumes to be mounted to the operator deployment |
77-
| garage | object | `{"auth":{"accessKey":"","adminToken":"","existingSecret":"","rpcSecret":"","secretKey":""},"defaultBucket":"securecodebox","enabled":true,"image":{"pullPolicy":"IfNotPresent","repository":"docker.io/dxflrs/garage","tag":"v2.3.0"},"persistence":{"size":"10Gi","storageClass":""},"podSecurityContext":{"fsGroup":1000,"runAsGroup":1000,"runAsUser":1000},"resources":{"limits":{"cpu":"500m","ephemeral-storage":"1Gi","memory":"512Mi"},"requests":{"cpu":"100m","memory":"256Mi"}},"securityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000,"seccompProfile":{"type":"RuntimeDefault"}}}` | Garage configuration for direct deployment (S3-compatible quickstart storage backend) |
77+
| garage | object | `{"auth":{"accessKey":"","adminToken":"","existingSecret":"","rpcSecret":"","secretKey":""},"defaultBucket":"securecodebox","enabled":true,"image":{"pullPolicy":"IfNotPresent","repository":"docker.io/dxflrs/garage","tag":"v2.3.0"},"persistence":{"size":"10Gi","storageClass":""},"podSecurityContext":{"fsGroup":1000,"runAsGroup":1000,"runAsUser":1000},"resources":{"limits":{"cpu":"500m","ephemeral-storage":"1Gi","memory":"512Mi"},"requests":{"cpu":"100m","memory":"256Mi"}},"securityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000,"seccompProfile":{"type":"RuntimeDefault"}}}` | Garage configuration for direct deployment (S3-compatible quickstart storage backend). This replaces the previous `minio` configuration section; if your values file still sets `minio.enabled: false`, it will still be honored and disable Garage as well. |
7878
| garage.auth | object | `{"accessKey":"","adminToken":"","existingSecret":"","rpcSecret":"","secretKey":""}` | Authentication configuration |
7979
| garage.auth.accessKey | string | `""` | Default access key (leave empty to generate a secure random one) |
8080
| garage.auth.adminToken | string | `""` | Garage admin API token (leave empty to generate a secure random one). Not used for anything outside the pod on a single-node deployment. |
8181
| garage.auth.existingSecret | string | `""` | Name of existing secret containing garage credentials (if set, auth.accessKey, auth.secretKey, auth.rpcSecret and auth.adminToken are ignored) |
82-
| garage.auth.rpcSecret | string | `""` | Garage inter-node RPC secret (leave empty to generate a secure random one). Not used for anything outside the pod on a single-node deployment. |
82+
| garage.auth.rpcSecret | string | `""` | Garage inter-node RPC secret, must be exactly 64 hex characters (leave empty to generate a secure random one). Not used for anything outside the pod on a single-node deployment. |
8383
| garage.auth.secretKey | string | `""` | Default secret key (leave empty to generate a secure random one) |
8484
| garage.defaultBucket | string | `"securecodebox"` | Default bucket to create on startup |
8585
| garage.enabled | bool | `true` | Enable this to use Garage as storage backend instead of a cloud bucket provider like AWS S3, Google Cloud Storage, DigitalOcean Spaces etc. |

‎operator/docs/README.ArtifactHub.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ helm install securecodebox-operator oci://ghcr.io/securecodebox/helm/operator
7979
| customCACertificate.existingCertificate | string | `nil` | name of the configMap holding the ca certificate(s), needs to be the same across all namespaces |
8080
| extraVolumeMounts | list | `[]` | Additional volume mounts to be mounted to the operator deployment |
8181
| extraVolumes | list | `[]` | Additional volumes to be mounted to the operator deployment |
82-
| garage | object | `{"auth":{"accessKey":"","adminToken":"","existingSecret":"","rpcSecret":"","secretKey":""},"defaultBucket":"securecodebox","enabled":true,"image":{"pullPolicy":"IfNotPresent","repository":"docker.io/dxflrs/garage","tag":"v2.3.0"},"persistence":{"size":"10Gi","storageClass":""},"podSecurityContext":{"fsGroup":1000,"runAsGroup":1000,"runAsUser":1000},"resources":{"limits":{"cpu":"500m","ephemeral-storage":"1Gi","memory":"512Mi"},"requests":{"cpu":"100m","memory":"256Mi"}},"securityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000,"seccompProfile":{"type":"RuntimeDefault"}}}` | Garage configuration for direct deployment (S3-compatible quickstart storage backend) |
82+
| garage | object | `{"auth":{"accessKey":"","adminToken":"","existingSecret":"","rpcSecret":"","secretKey":""},"defaultBucket":"securecodebox","enabled":true,"image":{"pullPolicy":"IfNotPresent","repository":"docker.io/dxflrs/garage","tag":"v2.3.0"},"persistence":{"size":"10Gi","storageClass":""},"podSecurityContext":{"fsGroup":1000,"runAsGroup":1000,"runAsUser":1000},"resources":{"limits":{"cpu":"500m","ephemeral-storage":"1Gi","memory":"512Mi"},"requests":{"cpu":"100m","memory":"256Mi"}},"securityContext":{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000,"seccompProfile":{"type":"RuntimeDefault"}}}` | Garage configuration for direct deployment (S3-compatible quickstart storage backend). This replaces the previous `minio` configuration section; if your values file still sets `minio.enabled: false`, it will still be honored and disable Garage as well. |
8383
| garage.auth | object | `{"accessKey":"","adminToken":"","existingSecret":"","rpcSecret":"","secretKey":""}` | Authentication configuration |
8484
| garage.auth.accessKey | string | `""` | Default access key (leave empty to generate a secure random one) |
8585
| garage.auth.adminToken | string | `""` | Garage admin API token (leave empty to generate a secure random one). Not used for anything outside the pod on a single-node deployment. |
8686
| garage.auth.existingSecret | string | `""` | Name of existing secret containing garage credentials (if set, auth.accessKey, auth.secretKey, auth.rpcSecret and auth.adminToken are ignored) |
87-
| garage.auth.rpcSecret | string | `""` | Garage inter-node RPC secret (leave empty to generate a secure random one). Not used for anything outside the pod on a single-node deployment. |
87+
| garage.auth.rpcSecret | string | `""` | Garage inter-node RPC secret, must be exactly 64 hex characters (leave empty to generate a secure random one). Not used for anything outside the pod on a single-node deployment. |
8888
| garage.auth.secretKey | string | `""` | Default secret key (leave empty to generate a secure random one) |
8989
| garage.defaultBucket | string | `"securecodebox"` | Default bucket to create on startup |
9090
| garage.enabled | bool | `true` | Enable this to use Garage as storage backend instead of a cloud bucket provider like AWS S3, Google Cloud Storage, DigitalOcean Spaces etc. |

‎operator/templates/_helpers.tpl‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,18 @@ Selector labels
5454
{{- define "operator.selectorLabels" -}}
5555
app.kubernetes.io/name: {{ include "operator.name" . }}
5656
app.kubernetes.io/instance: {{ .Release.Name }}
57+
{{- end }}
58+
59+
{{/*
60+
Whether the bundled Garage instance should be deployed.
61+
Falls back to the legacy `minio.enabled` value (renamed to `garage.enabled`) so
62+
values files that still set `minio.enabled: false` to disable the bundled
63+
storage backend in favor of an external S3 bucket keep working unchanged.
64+
*/}}
65+
{{- define "operator.garageEnabled" -}}
66+
{{- if and .Values.minio (hasKey .Values.minio "enabled") -}}
67+
{{- .Values.minio.enabled -}}
68+
{{- else -}}
69+
{{- .Values.garage.enabled -}}
70+
{{- end -}}
5771
{{- end }}

‎operator/templates/garage/secret.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
{{- if .Values.garage.enabled }}
5+
{{- if eq (include "operator.garageEnabled" .) "true" }}
66
{{- if not .Values.garage.auth.existingSecret }}
77
{{- $garageSecretName := printf "%s-garage" (include "operator.fullname" .) }}
88
{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace $garageSecretName }}

‎operator/templates/garage/service.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
{{- if .Values.garage.enabled }}
5+
{{- if eq (include "operator.garageEnabled" .) "true" }}
66
apiVersion: v1
77
kind: Service
88
metadata:

‎operator/templates/garage/statefulset.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
{{- if .Values.garage.enabled }}
5+
{{- if eq (include "operator.garageEnabled" .) "true" }}
66
apiVersion: apps/v1
77
kind: StatefulSet
88
metadata:

‎operator/templates/manager/manager.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ spec:
6868
env:
6969
- name: VERSION
7070
value: {{ .Chart.Version | quote }}
71-
{{- if .Values.garage.enabled }}
71+
{{- if eq (include "operator.garageEnabled" .) "true" }}
7272
- name: S3_USE_SSL
7373
value: "false"
7474
- name: S3_ENDPOINT

‎operator/tests/operator_test.yaml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,39 @@ tests:
7979
asserts:
8080
- hasDocuments:
8181
count: 0
82+
- it: does not render garage resources when legacy minio.enabled is false
83+
templates:
84+
- garage/secret.yaml
85+
- garage/service.yaml
86+
- garage/statefulset.yaml
87+
chart:
88+
version: 0.0.0
89+
appVersion: 0.0.0
90+
set:
91+
minio:
92+
enabled: false
93+
asserts:
94+
- hasDocuments:
95+
count: 0
96+
- it: uses external s3 config when legacy minio.enabled is false
97+
templates:
98+
- manager/manager.yaml
99+
chart:
100+
version: 0.0.0
101+
appVersion: 0.0.0
102+
set:
103+
minio:
104+
enabled: false
105+
s3:
106+
enabled: true
107+
endpoint: my-bucket.s3.amazonaws.com
108+
bucket: my-bucket
109+
authType: access-secret-key
110+
keySecret: my-secret
111+
asserts:
112+
- equal:
113+
path: spec.template.spec.containers[0].env[?(@.name=="S3_ENDPOINT")].value
114+
value: "my-bucket.s3.amazonaws.com"
82115
- it: configures manager deployment for garage
83116
templates:
84117
- manager/manager.yaml

‎operator/values.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ lurker:
120120
# -- Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
121121
pullPolicy: IfNotPresent
122122

123-
# -- Garage configuration for direct deployment (S3-compatible quickstart storage backend)
123+
# -- Garage configuration for direct deployment (S3-compatible quickstart storage backend). This replaces the previous `minio` configuration section; if your values file still sets `minio.enabled: false`, it will still be honored and disable Garage as well.
124124
garage:
125125
# -- Enable this to use Garage as storage backend instead of a cloud bucket provider like AWS S3, Google Cloud Storage, DigitalOcean Spaces etc.
126126
enabled: true

0 commit comments

Comments
 (0)