Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCXDEV-14850: insights add storage spec #2200

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: address review
Signed-off-by: Ondrej Pokorny <[email protected]>
opokornyy committed Mar 5, 2025
commit c65ff8d8961120b2bd65fc127504a5f6458ecfc3
31 changes: 14 additions & 17 deletions config/v1alpha1/types_insights.go
Original file line number Diff line number Diff line change
@@ -32,8 +32,7 @@ type InsightsDataGather struct {
}

type InsightsDataGatherSpec struct {
// gatherConfig spec attribute includes all the configuration options related to
// gathering of the Insights data and its uploading to the ingress.
// gatherConfig spec attribute includes all the configuration options related to gathering of the Insights data and its uploading to the ingress.
// +optional
GatherConfig GatherConfig `json:"gatherConfig,omitempty"`
}
@@ -42,8 +41,8 @@ type InsightsDataGatherStatus struct{}

// gatherConfig provides data gathering configuration options.
type GatherConfig struct {
// dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain
// in the Insights archive data. Valid values are "None" and "ObfuscateNetworking".
// dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data.
// Valid values are "None" and "ObfuscateNetworking".
// When set to None the data is not obfuscated.
// When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated.
// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
@@ -61,8 +60,7 @@ type GatherConfig struct {
// +kubebuilder:validation:MaxItems=100
// +optional
DisabledGatherers []DisabledGatherer `json:"disabledGatherers"`
// storage is an optional field that allows user to define persistent storage for on-demand gathering
// jobs to store the Insights data archive.
// storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive.
// If omitted, the gathering job will use ephemeral storage.
// +optional
StorageSpec *Storage `json:"storage,omitempty"`
@@ -73,16 +71,15 @@ type GatherConfig struct {
// +kubebuilder:validation:XValidation:rule=`self.matches("^[a-z]+[_a-z]*[a-z]([/a-z][_a-z]*)?[a-z]$")`,message=`disabledGatherer must be in the format of {gatherer}/{function} where the gatherer and function are lowercase letters only that may include underscores (_) and are separated by a forward slash (/) if the function is provided`
type DisabledGatherer string

// storage provides persistent storage configuration options for on-demand gathering jobs.
// storage provides persistent storage configuration options for gathering jobs.
// If the type is set to PersistentVolume, then the PersistentVolume must be defined.
// If the type is set to Ephemeral, then the PersistentVolume must not be defined.
// +kubebuilder:validation:XValidation:rule="has(self.type) && self.type == 'PersistentVolume' ? has(self.persistentVolume) : !has(self.persistentVolume)",message="persistentVolume is required when type is PersistentVolume, and forbidden otherwise"
type Storage struct {
// type is a required field that specifies the type of storage that will be used to store the Insights data archive.
// Valid values are "PersistentVolume" and "Ephemeral".
// When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job.
// When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is
// defined by the persistentVolume field.
// When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is defined by the persistentVolume field.
// +required
Type StorageType `json:"type"`
// persistentVolume is an optional field that specifies the PersistentVolume that will be used to store the Insights data archive.
@@ -104,13 +101,14 @@ const (

// persistentVolumeConfig provides configuration options for PersistentVolume storage.
type PersistentVolumeConfig struct {
// claim is a required field that specifies the configuration of the PersistentVolumeClaim that will
// be used to store the Insights data archive. The PersistentVolumeClaim must be created in the openshift-insights namespace.
// claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive.
// The PersistentVolumeClaim must be created in the openshift-insights namespace.
// +required
PersistentVolumeClaim PersistentVolumeClaimReference `json:"claim"`
// mountPath is an optional field specifying the directory where the PVC will be mounted inside the
// Insights data gathering Pod. If omitted, the path that is used to store the Insights data archive by Insights
// operator will be used instead. The path cannot exceed 1024 characters and must not contain a colon.
Claim PersistentVolumeClaimReference `json:"claim"`
// mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod.
// 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 mount path is /var/lib/insights-operator
// The path may not exceed 1024 characters and must not contain a colon.
// +kubebuilder:validation:MaxLength=1024
// +kubebuilder:validation:XValidation:rule="!self.contains(':')",message="mountPath must not contain a colon"
// +optional
@@ -120,8 +118,7 @@ type PersistentVolumeConfig struct {
// persistentVolumeClaimReference is a reference to a PersistentVolumeClaim.
type PersistentVolumeClaimReference struct {
// name is a string that follows the DNS1123 subdomain format.
// It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters,
// '-' and '.', and must start and end with an alphanumeric character.
// It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character.
// +kubebuilder:validation:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character."
// +kubebuilder:validation:MaxLength:=253
// +required
Original file line number Diff line number Diff line change
@@ -46,14 +46,14 @@ spec:
description: spec holds user settable values for configuration
properties:
gatherConfig:
description: |-
gatherConfig spec attribute includes all the configuration options related to
gathering of the Insights data and its uploading to the ingress.
description: gatherConfig spec attribute includes all the configuration
options related to gathering of the Insights data and its uploading
to the ingress.
properties:
dataPolicy:
description: |-
dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain
in the Insights archive data. Valid values are "None" and "ObfuscateNetworking".
dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data.
Valid values are "None" and "ObfuscateNetworking".
When set to None the data is not obfuscated.
When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated.
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
@@ -88,8 +88,7 @@ spec:
type: array
storage:
description: |-
storage is an optional field that allows user to define persistent storage for on-demand gathering
jobs to store the Insights data archive.
storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive.
If omitted, the gathering job will use ephemeral storage.
properties:
persistentVolume:
@@ -99,14 +98,13 @@ spec:
properties:
claim:
description: |-
claim is a required field that specifies the configuration of the PersistentVolumeClaim that will
be used to store the Insights data archive. The PersistentVolumeClaim must be created in the openshift-insights namespace.
claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive.
The PersistentVolumeClaim must be created in the openshift-insights namespace.
properties:
name:
description: |-
name is a string that follows the DNS1123 subdomain format.
It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters,
'-' and '.', and must start and end with an alphanumeric character.
It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character.
maxLength: 253
type: string
x-kubernetes-validations:
@@ -120,9 +118,10 @@ spec:
type: object
mountPath:
description: |-
mountPath is an optional field specifying the directory where the PVC will be mounted inside the
Insights data gathering Pod. If omitted, the path that is used to store the Insights data archive by Insights
operator will be used instead. The path cannot exceed 1024 characters and must not contain a colon.
mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod.
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 mount path is /var/lib/insights-operator
The path may not exceed 1024 characters and must not contain a colon.
maxLength: 1024
type: string
x-kubernetes-validations:
@@ -136,8 +135,7 @@ spec:
type is a required field that specifies the type of storage that will be used to store the Insights data archive.
Valid values are "PersistentVolume" and "Ephemeral".
When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job.
When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is
defined by the persistentVolume field.
When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is defined by the persistentVolume field.
enum:
- PersistentVolume
- Ephemeral
Original file line number Diff line number Diff line change
@@ -46,14 +46,14 @@ spec:
description: spec holds user settable values for configuration
properties:
gatherConfig:
description: |-
gatherConfig spec attribute includes all the configuration options related to
gathering of the Insights data and its uploading to the ingress.
description: gatherConfig spec attribute includes all the configuration
options related to gathering of the Insights data and its uploading
to the ingress.
properties:
dataPolicy:
description: |-
dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain
in the Insights archive data. Valid values are "None" and "ObfuscateNetworking".
dataPolicy allows user to enable additional global obfuscation of the IP addresses and base domain in the Insights archive data.
Valid values are "None" and "ObfuscateNetworking".
When set to None the data is not obfuscated.
When set to ObfuscateNetworking the IP addresses and the cluster domain name are obfuscated.
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
@@ -88,8 +88,7 @@ spec:
type: array
storage:
description: |-
storage is an optional field that allows user to define persistent storage for on-demand gathering
jobs to store the Insights data archive.
storage is an optional field that allows user to define persistent storage for gathering jobs to store the Insights data archive.
If omitted, the gathering job will use ephemeral storage.
properties:
persistentVolume:
@@ -99,14 +98,13 @@ spec:
properties:
claim:
description: |-
claim is a required field that specifies the configuration of the PersistentVolumeClaim that will
be used to store the Insights data archive. The PersistentVolumeClaim must be created in the openshift-insights namespace.
claim is a required field that specifies the configuration of the PersistentVolumeClaim that will be used to store the Insights data archive.
The PersistentVolumeClaim must be created in the openshift-insights namespace.
properties:
name:
description: |-
name is a string that follows the DNS1123 subdomain format.
It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters,
'-' and '.', and must start and end with an alphanumeric character.
It must be at most 253 characters in length, and must consist only of lower case alphanumeric characters, '-' and '.', and must start and end with an alphanumeric character.
maxLength: 253
type: string
x-kubernetes-validations:
@@ -120,9 +118,10 @@ spec:
type: object
mountPath:
description: |-
mountPath is an optional field specifying the directory where the PVC will be mounted inside the
Insights data gathering Pod. If omitted, the path that is used to store the Insights data archive by Insights
operator will be used instead. The path cannot exceed 1024 characters and must not contain a colon.
mountPath is an optional field specifying the directory where the PVC will be mounted inside the Insights data gathering Pod.
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 mount path is /var/lib/insights-operator
The path may not exceed 1024 characters and must not contain a colon.
maxLength: 1024
type: string
x-kubernetes-validations:
@@ -136,8 +135,7 @@ spec:
type is a required field that specifies the type of storage that will be used to store the Insights data archive.
Valid values are "PersistentVolume" and "Ephemeral".
When set to Ephemeral, the Insights data archive is stored in the ephemeral storage of the gathering job.
When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is
defined by the persistentVolume field.
When set to PersistentVolume, the Insights data archive is stored in the PersistentVolume that is defined by the persistentVolume field.
enum:
- PersistentVolume
- Ephemeral
Loading