Skip to content

Commit 57d1321

Browse files
fix(storage): disable checksum validation when deploying managed storage (#272) (#273)
(cherry picked from commit 62558e8) Co-authored-by: Andrew Azores <[email protected]>
1 parent dfb2157 commit 57d1321

File tree

5 files changed

+45
-0
lines changed

5 files changed

+45
-0
lines changed

charts/cryostat/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ certificate issuance and rotation.
185185
| `storage.image.tag` | Tag for the storage container image | `cryostat-v4.1` |
186186
| `storage.storageSecretName` | Name of the secret containing the object storage secret access key. This secret must contain a STORAGE_ACCESS_KEY secret which is the object storage secret access key. It must not be updated across chart upgrades, or else the connection between Cryostat components and object storage will not be able to initialize. If using an external S3 provider requiring authentication then this **must** be provided. It is recommended that the secret should be marked as immutable to avoid accidental changes to secret's data. More details: [Kubernetes Secrets](https://kubernetes.io/docs/concepts/configuration/secret/#secret-immutable) | `""` |
187187
| `storage.provider.url` | URL to the S3 object storage provider instance. This can be an in-cluster self-hosted instance with a hostname like s3.storage.local, or it can be an external commercial service. This should include scheme, host, and port. User authenication information should be provided using a *Secret* and *storage.storageSecretName*. If this is not specified then a managed [cryostat-storage](https://github.com/cryostatio/cryostat-storage) instance will be automatically deployed and configured. If an unmanaged S3 instance is specified here then other storage configuration settings (such as at-rest encryption, Pod annotations, Service configurations) do not apply. Production installations of Cryostat should not rely on `cryostat-storage` | `""` |
188+
| `storage.provider.useChecksumValidation` | whether PUT object request checksum validations are used. These should normally be enabled, but are known to cause issues with SeaweedFS/cryostat-storage and later S3 SDK versions. This is *true* by default when storage.provider.url is configured, but if not configured and cryostat-storage is deployed then this will be taken as *false*. | `true` |
188189
| `storage.provider.usePathStyleAccess` | whether path-style accesses are used for ex. object buckets. If path style access is not used then DNS subdomain resolution will be used. This is *true* by default for broader compatibility for low-footprint storage container installations, but subdomain resolution generally offers better performance if it is available and may be required for use with commercial storage providers. | `true` |
189190
| `storage.provider.usePresignedRecordingTransfers` | whether object storage presigned GET URLs should be used for transferring files between Cryostat components (ex. for automated analysis report generation). If this is disabled then Cryostat will act as a "network pipe" between other components and handle streaming file contents. This is *true* by default to reduce network utilization and request latency | `true` |
190191
| `storage.provider.usePresignedDownloads` | whether object storage presigned GET URLs should be used for downloading files via the user's browser. If this is disabled then Cryostat will act as a "network pipe" between storage and the user's browser and handle streaming file contents. If the object storage URLs are not accessible from the user's network location then this must be disabled, otherwise enabling it will reduce network utilization and request latency. This is *false* by default | `false` |

charts/cryostat/templates/cryostat_deployment.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ spec:
132132
# if an external provider URL is supplied then a region must also be supplied.
133133
# Otherwise we are deploying a managed storage instance and can set a default value
134134
value: {{ ternary .Values.storage.provider.region "us-east-1" (not (empty .Values.storage.provider.url)) }}
135+
- name: QUARKUS_S3_CHECKSUM_VALIDATION
136+
# if an external provider URL is supplied then use the configuration checksum validation value.
137+
# Otherwise we are deploying a managed storage instance and should override this to false, since it is known to cause issues.
138+
# See https://github.com/cryostatio/cryostat/issues/948
139+
value: {{ ternary (quote .Values.storage.provider.useChecksumValidation) (quote "false") (not (empty .Values.storage.provider.url)) }}
135140
- name: QUARKUS_S3_AWS_CREDENTIALS_TYPE
136141
value: {{ .Values.storage.provider.authentication.credentialsType }}
137142
- name: AWS_ACCESS_KEY_ID

charts/cryostat/tests/cryostat_deployment_test.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ tests:
127127
- equal:
128128
path: spec.template.spec.containers[?(@.name=='cryostat')].env[?(@.name=='QUARKUS_S3_ENDPOINT_OVERRIDE')].value
129129
value: "http://RELEASE-NAME-cryostat-storage:8333"
130+
- equal:
131+
path: spec.template.spec.containers[?(@.name=='cryostat')].env[?(@.name=='QUARKUS_S3_CHECKSUM_VALIDATION')].value
132+
value: "false"
130133
- notExists:
131134
path: spec.template.spec.containers[?(@.name=='cryostat')].env[?(@.name=='QUARKUS_S3_SYNC_CLIENT_TLS_TRUST_MANAGERS_PROVIDER_TYPE')]
132135
- equal:
@@ -208,6 +211,7 @@ tests:
208211
storage:
209212
provider:
210213
url: 'https://s3.example.com:1234'
214+
useChecksumValidation: true
211215
usePathStyleAccess: true
212216
usePresignedRecordingTransfers: false
213217
region: 'a-b1'
@@ -217,6 +221,9 @@ tests:
217221
- equal:
218222
path: spec.template.spec.containers[?(@.name=='cryostat')].env[?(@.name=='QUARKUS_S3_ENDPOINT_OVERRIDE')].value
219223
value: "https://s3.example.com:1234"
224+
- equal:
225+
path: spec.template.spec.containers[?(@.name=='cryostat')].env[?(@.name=='QUARKUS_S3_CHECKSUM_VALIDATION')].value
226+
value: "true"
220227
- equal:
221228
path: spec.template.spec.containers[?(@.name=='cryostat')].env[?(@.name=='QUARKUS_S3_PATH_STYLE_ACCESS')].value
222229
value: "true"
@@ -233,6 +240,31 @@ tests:
233240
path: spec.template.spec.containers[?(@.name=='cryostat')].env[?(@.name=='STORAGE_METADATA_STORAGE_MODE')].value
234241
value: "bucket"
235242

243+
- it: should allow configuration of external object storage provider without checksum validation
244+
set:
245+
storage:
246+
provider:
247+
url: 'https://s3.example.com:6789'
248+
useChecksumValidation: false
249+
asserts:
250+
- equal:
251+
path: spec.template.spec.containers[?(@.name=='cryostat')].env[?(@.name=='QUARKUS_S3_ENDPOINT_OVERRIDE')].value
252+
value: "https://s3.example.com:6789"
253+
- equal:
254+
path: spec.template.spec.containers[?(@.name=='cryostat')].env[?(@.name=='QUARKUS_S3_CHECKSUM_VALIDATION')].value
255+
value: "false"
256+
257+
- it: should not allow configuration of managed object storage provider with checksum validation
258+
set:
259+
storage:
260+
provider:
261+
# no url configured, so a managed instance will be deployed
262+
useChecksumValidation: true
263+
asserts:
264+
- equal:
265+
path: spec.template.spec.containers[?(@.name=='cryostat')].env[?(@.name=='QUARKUS_S3_CHECKSUM_VALIDATION')].value
266+
value: "false"
267+
236268
- it: should allow configuration of presigned downloads separately from presigned transfers
237269
set:
238270
storage:

charts/cryostat/values.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,11 @@
681681
"description": "URL to the S3 object storage provider instance. This can be an in-cluster self-hosted instance with a hostname like s3.storage.local, or it can be an external commercial service. This should include scheme, host, and port. User authenication information should be provided using a *Secret* and *storage.storageSecretName*. If this is not specified then a managed [cryostat-storage](https://github.com/cryostatio/cryostat-storage) instance will be automatically deployed and configured. If an unmanaged S3 instance is specified here then other storage configuration settings (such as at-rest encryption, Pod annotations, Service configurations) do not apply. Production installations of Cryostat should not rely on `cryostat-storage`",
682682
"default": ""
683683
},
684+
"useChecksumValidation": {
685+
"type": "boolean",
686+
"description": "whether PUT object request checksum validations are used. These should normally be enabled, but are known to cause issues with SeaweedFS/cryostat-storage and later S3 SDK versions. This is *true* by default when storage.provider.url is configured, but if not configured and cryostat-storage is deployed then this will be taken as *false*.",
687+
"default": true
688+
},
684689
"usePathStyleAccess": {
685690
"type": "boolean",
686691
"description": "whether path-style accesses are used for ex. object buckets. If path style access is not used then DNS subdomain resolution will be used. This is *true* by default for broader compatibility for low-footprint storage container installations, but subdomain resolution generally offers better performance if it is available and may be required for use with commercial storage providers.",

charts/cryostat/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ storage:
280280
provider:
281281
## @param storage.provider.url URL to the S3 object storage provider instance. This can be an in-cluster self-hosted instance with a hostname like s3.storage.local, or it can be an external commercial service. This should include scheme, host, and port. User authenication information should be provided using a *Secret* and *storage.storageSecretName*. If this is not specified then a managed [cryostat-storage](https://github.com/cryostatio/cryostat-storage) instance will be automatically deployed and configured. If an unmanaged S3 instance is specified here then other storage configuration settings (such as at-rest encryption, Pod annotations, Service configurations) do not apply. Production installations of Cryostat should not rely on `cryostat-storage`
282282
url: ""
283+
## @param storage.provider.useChecksumValidation whether PUT object request checksum validations are used. These should normally be enabled, but are known to cause issues with SeaweedFS/cryostat-storage and later S3 SDK versions. This is *true* by default when storage.provider.url is configured, but if not configured and cryostat-storage is deployed then this will be taken as *false*.
284+
useChecksumValidation: true
283285
## @param storage.provider.usePathStyleAccess whether path-style accesses are used for ex. object buckets. If path style access is not used then DNS subdomain resolution will be used. This is *true* by default for broader compatibility for low-footprint storage container installations, but subdomain resolution generally offers better performance if it is available and may be required for use with commercial storage providers.
284286
usePathStyleAccess: true
285287
## @param storage.provider.usePresignedRecordingTransfers whether object storage presigned GET URLs should be used for transferring files between Cryostat components (ex. for automated analysis report generation). If this is disabled then Cryostat will act as a "network pipe" between other components and handle streaming file contents. This is *true* by default to reduce network utilization and request latency

0 commit comments

Comments
 (0)