Skip to content

Commit

Permalink
Added BucketLogging type to enable different types of bucket logging
Browse files Browse the repository at this point in the history
Signed-off-by: Aayush Chouhan <[email protected]>
  • Loading branch information
achouhan09 committed May 27, 2024
1 parent e4864a4 commit cd58b2c
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 1 deletion.
16 changes: 16 additions & 0 deletions deploy/crds/noobaa.io_noobaas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,22 @@ spec:
description: Prometheus namespace that scrap metrics from noobaa
type: string
type: object
bucketLogging:
description: BucketLogging sets the configuration for bucket logging
properties:
bucketLoggingStorageClass:
description: |-
BucketLoggingStorageClass (optional) specifies the type of storage class that will be used to create a
PVC(Persistent Volume Claim) for guaranteed logging, if enabled.
type: string
loggingType:
description: |-
LoggingType specifies the type of logging for the bucket
There are two types available: best-effort and guaranteed logging
- best-effort(default) - less immune to failures but with better performance
- guaranteed - much more reliable but need to provide a storage class that supports RWX PVs
type: string
type: object
cleanupPolicy:
description: CleanupPolicy (optional) Indicates user's policy for
deletion
Expand Down
31 changes: 31 additions & 0 deletions pkg/apis/noobaa/v1alpha1/noobaa_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ type NooBaaSpec struct {
// DenyHTTP (optional) if given will deny access to the NooBaa S3 service using HTTP (only HTTPS)
// +optional
DenyHTTP bool `json:"denyHTTP,omitempty"`

// BucketLogging sets the configuration for bucket logging
// +optional
BucketLogging BucketLoggingSpec `json:"bucketLogging,omitempty"`
}

// AutoscalerSpec defines different actoscaling spec such as autoscaler type and prometheus namespace
Expand All @@ -237,6 +241,21 @@ type AutoscalerSpec struct {
PrometheusNamespace string `json:"prometheusNamespace,omitempty"`
}

// BucketLoggingSpec defines the bucket logging configuration
type BucketLoggingSpec struct {
// LoggingType specifies the type of logging for the bucket
// There are two types available: best-effort and guaranteed logging
// - best-effort(default) - less immune to failures but with better performance
// - guaranteed - much more reliable but need to provide a storage class that supports RWX PVs
// +optional
LoggingType BucketLoggingTypes `json:"loggingType,omitempty"`

// BucketLoggingStorageClass (optional) specifies the type of storage class that will be used to create a
// PVC(Persistent Volume Claim) for guaranteed logging, if enabled.
// +optional
BucketLoggingStorageClass *string `json:"bucketLoggingStorageClass,omitempty"`
}

// LoadBalancerSourceSubnetSpec defines the subnets that will be allowed to access the NooBaa services
type LoadBalancerSourceSubnetSpec struct {
// S3 is a list of subnets that will be allowed to access the Noobaa S3 service
Expand Down Expand Up @@ -539,3 +558,15 @@ const (
// AutoscalerTypeHPAV2 is hpav2
AutoscalerTypeHPAV2 AutoscalerTypes = "hpav2"
)

// BucketLoggingTypes is a string enum type for specifying the types of bucketlogging supported.
type BucketLoggingTypes string

// These are the valid BucketLoggingTypes types:
const (
// BucketLoggingTypeBestEffort is best-effort
BucketLoggingTypeBestEffort BucketLoggingTypes = "best-effort"

// BucketLoggingTypeGuaranteed is guaranteed
BucketLoggingTypeGuaranteed BucketLoggingTypes = "guaranteed"
)
22 changes: 22 additions & 0 deletions pkg/apis/noobaa/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion pkg/bundle/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ spec:
status: {}
`

const Sha256_deploy_crds_noobaa_io_noobaas_yaml = "0c697107c4b9d4781dfff92f8e29a95ed22d26c43b8208f39daea0a6674672df"
const Sha256_deploy_crds_noobaa_io_noobaas_yaml = "9fc4f547417125d6ad6246a27690a88fbbb054ffb7e318ed7cf9e21ca2c707ef"

const File_deploy_crds_noobaa_io_noobaas_yaml = `---
apiVersion: apiextensions.k8s.io/v1
Expand Down Expand Up @@ -2463,6 +2463,22 @@ spec:
description: Prometheus namespace that scrap metrics from noobaa
type: string
type: object
bucketLogging:
description: BucketLogging sets the configuration for bucket logging
properties:
bucketLoggingStorageClass:
description: |-
BucketLoggingStorageClass (optional) specifies the type of storage class that will be used to create a
PVC(Persistent Volume Claim) for guaranteed logging, if enabled.
type: string
loggingType:
description: |-
LoggingType specifies the type of logging for the bucket
There are two types available: best-effort and guaranteed logging
- best-effort(default) - less immune to failures but with better performance
- guaranteed - much more reliable but need to provide a storage class that supports RWX PVs
type: string
type: object
cleanupPolicy:
description: CleanupPolicy (optional) Indicates user's policy for
deletion
Expand Down

0 comments on commit cd58b2c

Please sign in to comment.