From 851df4cda096fb58b2fe6bba413adeed6665cce3 Mon Sep 17 00:00:00 2001 From: Pavol Loffay
Name | +Type | +Description | +Required | +
---|---|---|---|
capabilities | +object | +
+ CapabilitiesSpec defines the observability capabilities. + |
+ false | +
storage | +object | +
+ + |
+ false | +
Name | +Type | +Description | +Required | +
---|---|---|---|
opentelemetry | +object | +
+ + |
+ false | +
tracing | +object | +
+ + |
+ false | +
Name | +Type | +Description | +Required | +
---|---|---|---|
enabled | +boolean | +
+ + |
+ false | +
exporter | +object | +
+ + |
+ false | +
Name | +Type | +Description | +Required | +
---|---|---|---|
endpoint | +string | +
+ + |
+ false | +
Name | +Type | +Description | +Required | +
---|---|---|---|
enabled | +boolean | +
+ + |
+ false | +
Name | +Type | +Description | +Required | +
---|---|---|---|
secret | +object | +
+ + |
+ false | +
Name | +Type | +Description | +Required | +
---|---|---|---|
name | +string | +
+ + |
+ false | +
opentelemetry | object |
- + OpenTelemetry defines the OpenTelemetry capabilities. |
false | ||
tracing | object |
- + Tracing defines the tracing capabilities. |
false |
enabled | boolean |
+ Enabled indicates whether the capability is enabled and it operator should deploy an instance.
+By default, it is set to false. + Default: false |
false | ||
exporter | object |
+ Exporter defines the OpenTelemetry exporter configuration.
+When defined the collector will export telemetry data to the specified endpoint. + |
+ false | +||
olm | +boolean | +
+ OLM indicates whether the operators used by the capability should be deployed via OLM.
+When the capability is enabled, the OLM is set to true, otherwise it is set to false. + Default: false |
false |
endpoint | string |
- + Endpoint is the OTLP endpoint. |
false | @@ -4179,7 +4196,7 @@ CapabilitiesSpec defines the observability capabilities. - +Tracing defines the tracing capabilities.
enabled | boolean |
+ Enabled indicates whether the capability is enabled and it operator should deploy an instance.
+By default, it is set to false. + Default: false + |
+ false | +||
olm | +boolean | +
+ OLM indicates whether the operators used by the capability should be deployed via OLM.
+When the capability is enabled, the OLM is set to true, otherwise it is set to false. + + Default: false |
false |
secret | object |
- + SecretSpec defines the secret for the storage. |
false | @@ -4233,7 +4263,7 @@ CapabilitiesSpec defines the observability capabilities. - +SecretSpec defines the secret for the storage.
name | string |
- + Name is the name of the secret for the storage. |
false | diff --git a/docs/clusterobservability.md b/docs/clusterobservability.md index 104a4138b..ab1852bd3 100644 --- a/docs/clusterobservability.md +++ b/docs/clusterobservability.md @@ -16,9 +16,9 @@ spec: type: s3 capabilities: logging: - enabled: true + deploy: true tracing: - enabled: true + deploy: true ``` Notes: @@ -59,3 +59,48 @@ Notes: * deploys `OpenTelemetryCollector` in the `openshift-opentelemetry` * configures OTLP exporter on the collector to send traces to Dynatrace * configures collector to export trace data to Tempo deployed by the `ClusterObservability` CR + +### Install only operators for a given capability + +```yaml +apiVersion: observability.openshift.io/v1alpha1 +kind: ClusterObservability +metadata: + name: logging-tracing +spec: + storage: + secret: + name: minio + type: s3 + capabilities: + tracing: + enabled: false + olm: true +``` + +Notes: +* The tracing instance is not deployed, but the operators are installed + +### Deploy capability but don't deploy the operators. + +```yaml +apiVersion: observability.openshift.io/v1alpha1 +kind: ClusterObservability +metadata: + name: logging-tracing +spec: + storage: + secret: + name: minio + type: s3 + capabilities: + tracing: + enabled: true + olm: false +``` + +Notes: +* The tracing instance is deployed, but the operators are not installed via COO. +* In this case, the user is responsible for installing the operators + +In this case the COO cannot guarantee that installed operator versions are compatible therefore we could forbit this configuration or show a warning/unmanaged state. diff --git a/pkg/apis/observability/v1alpha1/opentelemetry.go b/pkg/apis/observability/v1alpha1/opentelemetry.go index cd4e7d9d4..9d795e7c8 100644 --- a/pkg/apis/observability/v1alpha1/opentelemetry.go +++ b/pkg/apis/observability/v1alpha1/opentelemetry.go @@ -1,11 +1,16 @@ package v1alpha1 +// OpenTelemetrySpec defines the desired state of OpenTelemetry capability. type OpenTelemetrySpec struct { - Enabled bool `json:"enabled,omitempty"` + CommonCapabilitiesSpec CommonCapabilitiesSpec `json:",inline"` - Exporter OTLPExporter `json:"exporter,omitempty"` + // Exporter defines the OpenTelemetry exporter configuration. + // When defined the collector will export telemetry data to the specified endpoint. + Exporter *OTLPExporter `json:"exporter,omitempty"` } +// OTLPExporter defines the OpenTelemetry Protocol (OTLP) exporter configuration. type OTLPExporter struct { + // Endpoint is the OTLP endpoint. Endpoint string `json:"endpoint,omitempty"` } diff --git a/pkg/apis/observability/v1alpha1/tracing.go b/pkg/apis/observability/v1alpha1/tracing.go index 03cccffa4..57fe54729 100644 --- a/pkg/apis/observability/v1alpha1/tracing.go +++ b/pkg/apis/observability/v1alpha1/tracing.go @@ -1,5 +1,6 @@ package v1alpha1 +// TracingSpec defines the desired state of the tracing capability. type TracingSpec struct { - Enabled bool `json:"enabled,omitempty"` + CommonCapabilitiesSpec CommonCapabilitiesSpec `json:",inline"` } diff --git a/pkg/apis/observability/v1alpha1/types.go b/pkg/apis/observability/v1alpha1/types.go index 82234e73a..0ca0c8d35 100644 --- a/pkg/apis/observability/v1alpha1/types.go +++ b/pkg/apis/observability/v1alpha1/types.go @@ -37,30 +37,54 @@ type ClusterObservabilityList struct { } type ClusterObservabilitySpec struct { + // Storage defines the storage for the capabilities that require a storage. Storage StorageSpec `json:"storage,omitempty"` + // Capabilities defines the observability capabilities. + // Each capability has to be enabled explicitly. Capabilities *CapabilitiesSpec `json:"capabilities,omitempty"` } // ClusterObservabilityStatus defines the observed state of ClusterObservability. type ClusterObservabilityStatus struct{} +// StorageSpec defines the storage. type StorageSpec struct { Secret SecretSpec `json:"secret,omitempty"` } +// SecretSpec defines the secret for the storage. type SecretSpec struct { + // Name is the name of the secret for the storage. Name string `json:"name,omitempty"` } // CapabilitiesSpec defines the observability capabilities. type CapabilitiesSpec struct { + // Tracing defines the tracing capabilities. // +optional // +kubebuilder:validation:Optional Tracing TracingSpec `json:"tracing,omitempty"` + // OpenTelemetry defines the OpenTelemetry capabilities. // +optional // +kubebuilder:validation:Optional OpenTelemetry OpenTelemetrySpec `json:"opentelemetry,omitempty"` } + +// CommonCapabilitiesSpec defines the common capabilities. +type CommonCapabilitiesSpec struct { + // Enabled indicates whether the capability is enabled and it operator should deploy an instance. + // By default, it is set to false. + // +optional + // +kubebuilder:validation:Optional + // +kubebuilder:default=false + Enabled bool `json:"enabled,omitempty"` + // OLM indicates whether the operators used by the capability should be deployed via OLM. + // When the capability is enabled, the OLM is set to true, otherwise it is set to false. + // +optional + // +kubebuilder:validation:Optional + // +kubebuilder:default=false + OLM bool `json:"olm,omitempty"` +} diff --git a/pkg/apis/observability/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/observability/v1alpha1/zz_generated.deepcopy.go index 3f3c412d7..bf5239eed 100644 --- a/pkg/apis/observability/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/observability/v1alpha1/zz_generated.deepcopy.go @@ -28,7 +28,7 @@ import ( func (in *CapabilitiesSpec) DeepCopyInto(out *CapabilitiesSpec) { *out = *in out.Tracing = in.Tracing - out.OpenTelemetry = in.OpenTelemetry + in.OpenTelemetry.DeepCopyInto(&out.OpenTelemetry) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CapabilitiesSpec. @@ -107,7 +107,7 @@ func (in *ClusterObservabilitySpec) DeepCopyInto(out *ClusterObservabilitySpec) if in.Capabilities != nil { in, out := &in.Capabilities, &out.Capabilities *out = new(CapabilitiesSpec) - **out = **in + (*in).DeepCopyInto(*out) } } @@ -136,6 +136,21 @@ func (in *ClusterObservabilityStatus) DeepCopy() *ClusterObservabilityStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CommonCapabilitiesSpec) DeepCopyInto(out *CommonCapabilitiesSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonCapabilitiesSpec. +func (in *CommonCapabilitiesSpec) DeepCopy() *CommonCapabilitiesSpec { + if in == nil { + return nil + } + out := new(CommonCapabilitiesSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OTLPExporter) DeepCopyInto(out *OTLPExporter) { *out = *in @@ -154,7 +169,12 @@ func (in *OTLPExporter) DeepCopy() *OTLPExporter { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OpenTelemetrySpec) DeepCopyInto(out *OpenTelemetrySpec) { *out = *in - out.Exporter = in.Exporter + out.CommonCapabilitiesSpec = in.CommonCapabilitiesSpec + if in.Exporter != nil { + in, out := &in.Exporter, &out.Exporter + *out = new(OTLPExporter) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenTelemetrySpec. @@ -201,6 +221,7 @@ func (in *StorageSpec) DeepCopy() *StorageSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TracingSpec) DeepCopyInto(out *TracingSpec) { *out = *in + out.CommonCapabilitiesSpec = in.CommonCapabilitiesSpec } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TracingSpec. From e82783f60f786f52e2e0abb07e6481f0843bf9aa Mon Sep 17 00:00:00 2001 From: Pavol Loffayfalse | |
olm | -boolean | +operators | +object |
- OLM indicates whether the operators used by the capability should be deployed via OLM.
-When the capability is enabled, the OLM is set to true, otherwise it is set to false. - - Default: false + Operators defines the operators installation for the capability. |
false |
Name | +Type | +Description | +Required | +
---|---|---|---|
install | +boolean | +
+ Install indicates whether the operator(s) used by the capability should be installed via OLM.
+When the capability is enabled, the install is set to true, otherwise it is set to false. + |
+ false | +
Name | +Type | +Description | +Required | +
---|---|---|---|
install | boolean |
- OLM indicates whether the operators used by the capability should be deployed via OLM.
-When the capability is enabled, the OLM is set to true, otherwise it is set to false. - - Default: false + Install indicates whether the operator(s) used by the capability should be installed via OLM. +When the capability is enabled, the install is set to true, otherwise it is set to false. |
false |