Skip to content

Commit

Permalink
Merge pull request #1853 from bertinatto/efs-volume-metrics
Browse files Browse the repository at this point in the history
STOR-1422: Add field for enabling EFS volume metrics
  • Loading branch information
openshift-merge-bot[bot] authored Aug 7, 2024
2 parents 3cab566 + 942fac4 commit 1ad7d84
Show file tree
Hide file tree
Showing 20 changed files with 2,164 additions and 3 deletions.
1 change: 1 addition & 0 deletions features.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
| MachineAPIOperatorDisableMachineHealthCheckController| | | | | | |
| MultiArchInstallAzure| | | | | | |
| GatewayAPI| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | |
| AWSEFSDriverVolumeMetrics| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| AdditionalRoutingCapabilities| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| AutomatedEtcdBackup| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| BootcNodeManagement| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
Expand Down
7 changes: 7 additions & 0 deletions features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,4 +611,11 @@ var (
productScope(ocpSpecific).
enableIn(configv1.Default, configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()

FeatureGateAWSEFSDriverVolumeMetrics = newFeatureGate("AWSEFSDriverVolumeMetrics").
reportProblemsToJiraComponent("Storage / Kubernetes External Components").
contactPerson("fbertina").
productScope(ocpSpecific).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
mustRegister()
)
79 changes: 79 additions & 0 deletions openapi/generated_openapi/zz_generated.openapi.go

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

46 changes: 46 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -25445,6 +25445,10 @@
"description": "AWSCSIDriverConfigSpec defines properties that can be configured for the AWS CSI driver.",
"type": "object",
"properties": {
"efsVolumeMetrics": {
"description": "efsVolumeMetrics sets the configuration for collecting metrics from EFS volumes used by the EFS CSI Driver.",
"$ref": "#/definitions/com.github.openshift.api.operator.v1.AWSEFSVolumeMetrics"
},
"kmsKeyARN": {
"description": "kmsKeyARN sets the cluster default storage class to encrypt volumes with a user-defined KMS key, rather than the default KMS key used by AWS. The value may be either the ARN or Alias ARN of a KMS key.",
"type": "string"
Expand All @@ -25465,6 +25469,48 @@
}
}
},
"com.github.openshift.api.operator.v1.AWSEFSVolumeMetrics": {
"description": "AWSEFSVolumeMetrics defines the configuration for volume metrics in the EFS CSI Driver.",
"type": "object",
"required": [
"state"
],
"properties": {
"recursiveWalk": {
"description": "recursiveWalk provides additional configuration for collecting volume metrics in the AWS EFS CSI Driver when the state is set to RecursiveWalk.",
"$ref": "#/definitions/com.github.openshift.api.operator.v1.AWSEFSVolumeMetricsRecursiveWalkConfig"
},
"state": {
"description": "state defines the state of metric collection in the AWS EFS CSI Driver. This field is required and must be set to one of the following values: Disabled or RecursiveWalk. Disabled means no metrics collection will be performed. This is the default value. RecursiveWalk means the AWS EFS CSI Driver will recursively scan volumes to collect metrics. This process may result in high CPU and memory usage, depending on the volume size.",
"type": "string",
"default": ""
}
},
"x-kubernetes-unions": [
{
"discriminator": "state",
"fields-to-discriminateBy": {
"recursiveWalk": "RecursiveWalk"
}
}
]
},
"com.github.openshift.api.operator.v1.AWSEFSVolumeMetricsRecursiveWalkConfig": {
"description": "AWSEFSVolumeMetricsRecursiveWalkConfig defines options for volume metrics in the EFS CSI Driver.",
"type": "object",
"properties": {
"fsRateLimit": {
"description": "fsRateLimit defines the rate limit, in goroutines per file system, for processing volume metrics. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is 5. The valid range is from 1 to 100 goroutines.",
"type": "integer",
"format": "int32"
},
"refreshPeriodMinutes": {
"description": "refreshPeriodMinutes specifies the frequency, in minutes, at which volume metrics are refreshed. When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time. The current default is 240. The valid range is from 1 to 43200 minutes (30 days).",
"type": "integer",
"format": "int32"
}
}
},
"com.github.openshift.api.operator.v1.AWSLoadBalancerParameters": {
"description": "AWSLoadBalancerParameters provides configuration settings that are specific to AWS load balancers.",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "ClusterCSIDriver"
crdName: clustercsidrivers.operator.openshift.io
featureGate: AWSEFSDriverVolumeMetrics
tests:
onCreate:
- name: Should be able to create a minimal ClusterCSIDriver
initial: |
apiVersion: operator.openshift.io/v1
kind: ClusterCSIDriver
metadata:
name: efs.csi.aws.com
spec: {} # No spec is required for a ClusterCSIDriver
expected: |
apiVersion: operator.openshift.io/v1
kind: ClusterCSIDriver
metadata:
name: efs.csi.aws.com
spec:
logLevel: Normal
operatorLogLevel: Normal
- name: Should be able to create ClusterCSIDriver with AWS EFS volume metrics disabled
initial: |
apiVersion: operator.openshift.io/v1
kind: ClusterCSIDriver
metadata:
name: efs.csi.aws.com
spec:
driverConfig:
driverType: AWS
aws:
efsVolumeMetrics:
state: Disabled
logLevel: Normal
operatorLogLevel: Normal
expected: |
apiVersion: operator.openshift.io/v1
kind: ClusterCSIDriver
metadata:
name: efs.csi.aws.com
spec:
driverConfig:
driverType: AWS
aws:
efsVolumeMetrics:
state: Disabled
logLevel: Normal
operatorLogLevel: Normal
- name: Should be able to create ClusterCSIDriver with AWS EFS volume metrics enabled as RecursiveWalk
initial: |
apiVersion: operator.openshift.io/v1
kind: ClusterCSIDriver
metadata:
name: efs.csi.aws.com
spec:
driverConfig:
driverType: AWS
aws:
efsVolumeMetrics:
state: RecursiveWalk
logLevel: Normal
operatorLogLevel: Normal
expected: |
apiVersion: operator.openshift.io/v1
kind: ClusterCSIDriver
metadata:
name: efs.csi.aws.com
spec:
driverConfig:
driverType: AWS
aws:
efsVolumeMetrics:
state: RecursiveWalk
logLevel: Normal
operatorLogLevel: Normal
- name: Should be able to create ClusterCSIDriver with AWS EFS volume metrics enabled as RecursiveWalk and custom config
initial: |
apiVersion: operator.openshift.io/v1
kind: ClusterCSIDriver
metadata:
name: efs.csi.aws.com
spec:
driverConfig:
driverType: AWS
aws:
efsVolumeMetrics:
state: RecursiveWalk
recursiveWalk:
refreshPeriodMinutes: 100
fsRateLimit: 10
logLevel: Normal
operatorLogLevel: Normal
expected: |
apiVersion: operator.openshift.io/v1
kind: ClusterCSIDriver
metadata:
name: efs.csi.aws.com
spec:
driverConfig:
driverType: AWS
aws:
efsVolumeMetrics:
state: RecursiveWalk
recursiveWalk:
refreshPeriodMinutes: 100
fsRateLimit: 10
logLevel: Normal
operatorLogLevel: Normal
59 changes: 59 additions & 0 deletions operator/v1/types_csi_cluster_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,65 @@ type AWSCSIDriverConfigSpec struct {
// +kubebuilder:validation:Pattern:=`^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b|aws-iso-e|aws-iso-f):kms:[a-z0-9-]+:[0-9]{12}:(key|alias)\/.*$`
// +optional
KMSKeyARN string `json:"kmsKeyARN,omitempty"`

// efsVolumeMetrics sets the configuration for collecting metrics from EFS volumes used by the EFS CSI Driver.
// +openshift:enable:FeatureGate=AWSEFSDriverVolumeMetrics
// +optional
EFSVolumeMetrics *AWSEFSVolumeMetrics `json:"efsVolumeMetrics,omitempty"`
}

// AWSEFSVolumeMetricsState defines the modes for collecting volume metrics in the AWS EFS CSI Driver.
// This can either enable recursive collection of volume metrics or disable metric collection entirely.
// +kubebuilder:validation:Enum:="RecursiveWalk";"Disabled"
type AWSEFSVolumeMetricsState string

const (
// AWSEFSVolumeMetricsRecursiveWalk indicates that volume metrics collection in the AWS EFS CSI Driver
// is performed by recursively walking through the files in the volume.
AWSEFSVolumeMetricsRecursiveWalk AWSEFSVolumeMetricsState = "RecursiveWalk"

// AWSEFSVolumeMetricsDisabled indicates that volume metrics collection in the AWS EFS CSI Driver is disabled.
AWSEFSVolumeMetricsDisabled AWSEFSVolumeMetricsState = "Disabled"
)

// AWSEFSVolumeMetrics defines the configuration for volume metrics in the EFS CSI Driver.
// +union
type AWSEFSVolumeMetrics struct {
// state defines the state of metric collection in the AWS EFS CSI Driver.
// This field is required and must be set to one of the following values: Disabled or RecursiveWalk.
// Disabled means no metrics collection will be performed. This is the default value.
// RecursiveWalk means the AWS EFS CSI Driver will recursively scan volumes to collect metrics.
// This process may result in high CPU and memory usage, depending on the volume size.
// +unionDiscriminator
// +kubebuilder:validation:Required
State AWSEFSVolumeMetricsState `json:"state"`

// recursiveWalk provides additional configuration for collecting volume metrics in the AWS EFS CSI Driver
// when the state is set to RecursiveWalk.
// +unionMember
// +optional
RecursiveWalk *AWSEFSVolumeMetricsRecursiveWalkConfig `json:"recursiveWalk,omitempty"`
}

// AWSEFSVolumeMetricsRecursiveWalkConfig defines options for volume metrics in the EFS CSI Driver.
type AWSEFSVolumeMetricsRecursiveWalkConfig struct {
// refreshPeriodMinutes specifies the frequency, in minutes, at which volume metrics are refreshed.
// When omitted, this means no opinion and the platform is left to choose a reasonable
// default, which is subject to change over time. The current default is 240.
// The valid range is from 1 to 43200 minutes (30 days).
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=43200
// +optional
RefreshPeriodMinutes int32 `json:"refreshPeriodMinutes,omitempty"`

// fsRateLimit defines the rate limit, in goroutines per file system, for processing volume metrics.
// When omitted, this means no opinion and the platform is left to choose a reasonable
// default, which is subject to change over time. The current default is 5.
// The valid range is from 1 to 100 goroutines.
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=100
// +optional
FSRateLimit int32 `json:"fsRateLimit,omitempty"`
}

// AzureDiskEncryptionSet defines the configuration for a disk encryption set.
Expand Down
Loading

0 comments on commit 1ad7d84

Please sign in to comment.