Skip to content

Commit 549b0f7

Browse files
andrewazoresebaron
andauthored
feat(storage): add configuration for external object storage provider (#1146)
Co-authored-by: Elliott Baron <[email protected]>
1 parent f964242 commit 549b0f7

File tree

14 files changed

+888
-132
lines changed

14 files changed

+888
-132
lines changed

api/v1beta2/cryostat_types.go

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ type CryostatSpec struct {
100100
// +optional
101101
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Database Options"
102102
DatabaseOptions *DatabaseOptions `json:"databaseOptions,omitempty"`
103+
// Options to configure the Cryostat application's object storage. If not provided, a managed instance will be automatically provisioned.
104+
// +optional
105+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Object Storage Options"
106+
ObjectStorageOptions *ObjectStorageOptions `json:"objectStorageOptions,omitempty"`
103107
// Options to configure the Cryostat deployments and pods metadata
104108
// +optional
105109
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Operand metadata"
@@ -762,6 +766,83 @@ type DatabaseOptions struct {
762766
SecretName *string `json:"secretName,omitempty"`
763767
}
764768

769+
// ObjectStorageOptions provides configuration options to the Cryostat application's object storage.
770+
type ObjectStorageOptions struct {
771+
// Name of the secret containing the object storage secret access key. This secret must contain a
772+
// ACCESS_KEY secret which is the object storage access key ID, and a SECRET_KEY secret which is the object storage secret access key.
773+
// If using an external S3 provider requiring authentication then this must be provided.
774+
// It is recommended that the secret should be marked as immutable to avoid accidental changes to secret's data.
775+
// More details: [Kubernetes Secrets](https://kubernetes.io/docs/concepts/configuration/secret/#secret-immutable)
776+
// +optional
777+
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:io.kubernetes:Secret"}
778+
SecretName *string `json:"secretName,omitempty"`
779+
// Configuration for external object storage providers.
780+
// +optional
781+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Object Storage Provider Options"
782+
Provider *ObjectStorageProviderOptions `json:"provider,omitempty"`
783+
// Configuration for object storage buckets. Only applies when external storage is configured, ie. .spec.ObjectStorageProviderOptions is non-nil.
784+
// +optional
785+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Storage Bucket Names"
786+
StorageBucketNameOptions *StorageBucketNameOptions `json:"storageBucketNameOptions,omitempty"`
787+
}
788+
789+
// ObjectStorageProviderOptions provides configuration options to the Cryostat application's external object storage.
790+
type ObjectStorageProviderOptions struct {
791+
// The complete URL (not including authentication information) to the external object storage provider.
792+
// +operator-sdk:csv:customresourcedefinitions:type=spec
793+
URL *string `json:"url,omitempty"`
794+
// Whether virtual host subdomain access should be used, as opposed to path-style access. Defaults to false for compatibility.
795+
// +optional
796+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Use Virtual Host Subdomain Access",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
797+
UseVirtualHostAccess *bool `json:"useVirtualHostAccess,omitempty"`
798+
// The object storage provider region.
799+
// +operator-sdk:csv:customresourcedefinitions:type=spec
800+
Region *string `json:"region,omitempty"`
801+
// Whether Cryostat should trust all TLS certificates presented by the external object storage provider. Defaults to false.
802+
// +optional
803+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="TLS Trust All",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
804+
TLSTrustAll *bool `json:"tlsTrustAll,omitempty"`
805+
// The strategy Cryostat will use for storing files' metadata. The default 'tagging' strategy stores all metadata as object Tags.
806+
// The 'metadata' strategy stores metadata as object Metadata, which is immutable but allows for more entries than Tags.
807+
// The 'bucket' strategy stores metadata as separate files (ex. JSON object maps) in a dedicated bucket,
808+
// with prefixes to differentiate the kind of object the metadata belongs to.
809+
// +optional
810+
// +kubebuilder:validation:Enum=tagging;metadata;bucket
811+
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:select:tagging","urn:alm:descriptor:com.tectonic.ui:select:metadata","urn:alm:descriptor:com.tectonic.ui:select:bucket"}
812+
MetadataMode *string `json:"metadataMode,omitempty"`
813+
}
814+
815+
type StorageBucketNameOptions struct {
816+
// The name of the bucket used to store Archived JFR files.
817+
// +optional
818+
// +operator-sdk:csv:customresourcedefinitions:type=spec
819+
ArchivedRecordings *string `json:"archivedRecordings,omitempty"`
820+
// The name of the bucket used to store a cache of Automated Analysis reports attached to Archived JFR files.
821+
// +optional
822+
// +operator-sdk:csv:customresourcedefinitions:type=spec
823+
ArchivedReports *string `json:"archivedReports,omitempty"`
824+
// The name of the bucket used to store custom Event Templates.
825+
// +optional
826+
// +operator-sdk:csv:customresourcedefinitions:type=spec
827+
EventTemplates *string `json:"eventTemplates,omitempty"`
828+
// The name of the bucket used to store JMC Agent Probe templates.
829+
// +optional
830+
// +operator-sdk:csv:customresourcedefinitions:type=spec
831+
JMCAgentProbeTemplates *string `json:"jmcAgentProbeTemplates,omitempty"`
832+
// The name of the bucket used to store JVM heap dumps.
833+
// +optional
834+
// +operator-sdk:csv:customresourcedefinitions:type=spec
835+
HeapDumps *string `json:"heapDumps,omitempty"`
836+
// The name of the bucket used to storage JVM thread dumps.
837+
// +optional
838+
// +operator-sdk:csv:customresourcedefinitions:type=spec
839+
ThreadDumps *string `json:"threadDumps,omitempty"`
840+
// The name of the bucket used to storage metadata for other objects (ex. archived recordings). This is only used if the .spec.objectStorageOptions.provider.metadataMode is set to 'bucket'.
841+
// +optional
842+
// +operator-sdk:csv:customresourcedefinitions:type=spec
843+
Metadata *string `json:"metadata,omitempty"`
844+
}
845+
765846
// AgentOptions provides customization for how the operator configures Cryostat Agents.
766847
type AgentOptions struct {
767848
// Disables hostname verification when Cryostat connects to Agents over TLS.

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 125 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/manifests/cryostat-operator.clusterserviceversion.yaml

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ metadata:
2424
capabilities: Seamless Upgrades
2525
categories: Monitoring, Developer Tools
2626
containerImage: quay.io/cryostat/cryostat-operator:4.1.0-dev
27-
createdAt: "2025-09-22T20:35:39Z"
27+
createdAt: "2025-10-08T20:21:35Z"
2828
description: JVM monitoring and profiling tool
2929
operatorframework.io/initialization-resource: |-
3030
{
@@ -243,6 +243,64 @@ spec:
243243
path: networkPolicies.storageConfig.ingressDisabled
244244
x-descriptors:
245245
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
246+
- description: Options to configure the Cryostat application's object storage. If not provided, a managed instance will be automatically provisioned.
247+
displayName: Object Storage Options
248+
path: objectStorageOptions
249+
- description: Configuration for external object storage providers.
250+
displayName: Object Storage Provider Options
251+
path: objectStorageOptions.provider
252+
- description: The strategy Cryostat will use for storing files' metadata. The default 'tagging' strategy stores all metadata as object Tags. The 'metadata' strategy stores metadata as object Metadata, which is immutable but allows for more entries than Tags. The 'bucket' strategy stores metadata as separate files (ex. JSON object maps) in a dedicated bucket, with prefixes to differentiate the kind of object the metadata belongs to.
253+
displayName: Metadata Mode
254+
path: objectStorageOptions.provider.metadataMode
255+
x-descriptors:
256+
- urn:alm:descriptor:com.tectonic.ui:select:tagging
257+
- urn:alm:descriptor:com.tectonic.ui:select:metadata
258+
- urn:alm:descriptor:com.tectonic.ui:select:bucket
259+
- description: The object storage provider region.
260+
displayName: Region
261+
path: objectStorageOptions.provider.region
262+
- description: Whether Cryostat should trust all TLS certificates presented by the external object storage provider. Defaults to false.
263+
displayName: TLS Trust All
264+
path: objectStorageOptions.provider.tlsTrustAll
265+
x-descriptors:
266+
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
267+
- description: The complete URL (not including authentication information) to the external object storage provider.
268+
displayName: URL
269+
path: objectStorageOptions.provider.url
270+
- description: Whether virtual host subdomain access should be used, as opposed to path-style access. Defaults to false for compatibility.
271+
displayName: Use Virtual Host Subdomain Access
272+
path: objectStorageOptions.provider.useVirtualHostAccess
273+
x-descriptors:
274+
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
275+
- description: 'Name of the secret containing the object storage secret access key. This secret must contain a ACCESS_KEY secret which is the object storage access key ID, and a SECRET_KEY secret which is the object storage secret access key. 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)'
276+
displayName: Secret Name
277+
path: objectStorageOptions.secretName
278+
x-descriptors:
279+
- urn:alm:descriptor:io.kubernetes:Secret
280+
- description: Configuration for object storage buckets. Only applies when external storage is configured, ie. .spec.ObjectStorageProviderOptions is non-nil.
281+
displayName: Storage Bucket Names
282+
path: objectStorageOptions.storageBucketNameOptions
283+
- description: The name of the bucket used to store Archived JFR files.
284+
displayName: Archived Recordings
285+
path: objectStorageOptions.storageBucketNameOptions.archivedRecordings
286+
- description: The name of the bucket used to store a cache of Automated Analysis reports attached to Archived JFR files.
287+
displayName: Archived Reports
288+
path: objectStorageOptions.storageBucketNameOptions.archivedReports
289+
- description: The name of the bucket used to store custom Event Templates.
290+
displayName: Event Templates
291+
path: objectStorageOptions.storageBucketNameOptions.eventTemplates
292+
- description: The name of the bucket used to store JVM heap dumps.
293+
displayName: Heap Dumps
294+
path: objectStorageOptions.storageBucketNameOptions.heapDumps
295+
- description: The name of the bucket used to store JMC Agent Probe templates.
296+
displayName: JMCAgent Probe Templates
297+
path: objectStorageOptions.storageBucketNameOptions.jmcAgentProbeTemplates
298+
- description: The name of the bucket used to storage metadata for other objects (ex. archived recordings). This is only used if the .spec.objectStorageOptions.provider.metadataMode is set to 'bucket'.
299+
displayName: Metadata
300+
path: objectStorageOptions.storageBucketNameOptions.metadata
301+
- description: The name of the bucket used to storage JVM thread dumps.
302+
displayName: Thread Dumps
303+
path: objectStorageOptions.storageBucketNameOptions.threadDumps
246304
- description: Options to configure the Cryostat deployments and pods metadata
247305
displayName: Operand metadata
248306
path: operandMetadata

0 commit comments

Comments
 (0)