diff --git a/apis/telemetry/v1alpha1/logpipeline_types.go b/apis/telemetry/v1alpha1/logpipeline_types.go index 34cf666c2..d6556ebfd 100644 --- a/apis/telemetry/v1alpha1/logpipeline_types.go +++ b/apis/telemetry/v1alpha1/logpipeline_types.go @@ -81,16 +81,6 @@ type Filter struct { Custom string `json:"custom,omitempty"` } -// LokiOutput configures an output to the Kyma-internal Loki instance. -type LokiOutput struct { - // Grafana Loki URL. - URL ValueType `json:"url,omitempty"` - // Labels to set for each log record. - Labels map[string]string `json:"labels,omitempty"` - // Attributes to be removed from a log record. - RemoveKeys []string `json:"removeKeys,omitempty"` -} - // HTTPOutput configures an HTTP-based output compatible with the Fluent Bit HTTP output plugin. type HTTPOutput struct { // Defines the host of the HTTP receiver. @@ -133,8 +123,6 @@ type Output struct { Custom string `json:"custom,omitempty"` // Configures an HTTP-based output compatible with the Fluent Bit HTTP output plugin. HTTP *HTTPOutput `json:"http,omitempty"` - // The grafana-loki output is not supported anymore. For integration with a custom Loki installation, use the `custom` output and follow [Installing a custom Loki stack in Kyma](https://kyma-project.io/#/telemetry-manager/user/integration/loki/README ). - Loki *LokiOutput `json:"grafana-loki,omitempty"` } func (i *Input) IsDefined() bool { @@ -149,10 +137,6 @@ func (o *Output) IsHTTPDefined() bool { return o.HTTP != nil && o.HTTP.Host.IsDefined() } -func (o *Output) IsLokiDefined() bool { - return o.Loki != nil && o.Loki.URL.IsDefined() -} - func (o *Output) IsAnyDefined() bool { return o.pluginCount() > 0 } @@ -169,9 +153,6 @@ func (o *Output) pluginCount() int { if o.IsHTTPDefined() { plugins++ } - if o.IsLokiDefined() { - plugins++ - } return plugins } diff --git a/apis/telemetry/v1alpha1/logpipeline_types_test.go b/apis/telemetry/v1alpha1/logpipeline_types_test.go index c3046f41d..08b64520b 100644 --- a/apis/telemetry/v1alpha1/logpipeline_types_test.go +++ b/apis/telemetry/v1alpha1/logpipeline_types_test.go @@ -30,34 +30,18 @@ func TestLogPipelineOutput(t *testing.T) { expectedAny: true, expectedSingle: true, }, - { - name: "loki", - given: Output{Loki: &LokiOutput{URL: ValueType{Value: "localhost"}}}, - expectedLoki: true, - expectedAny: true, - expectedSingle: true, - }, { name: "invalid: none defined", given: Output{}, expectedAny: false, expectedSingle: false, }, - { - name: "invalid: multiple defined", - given: Output{Custom: "name: null", Loki: &LokiOutput{URL: ValueType{Value: "localhost"}}}, - expectedCustom: true, - expectedLoki: true, - expectedAny: true, - expectedSingle: false, - }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { require.Equal(t, test.expectedCustom, test.given.IsCustomDefined()) require.Equal(t, test.expectedHTTP, test.given.IsHTTPDefined()) - require.Equal(t, test.expectedLoki, test.given.IsLokiDefined()) require.Equal(t, test.expectedAny, test.given.IsAnyDefined()) }) } diff --git a/apis/telemetry/v1alpha1/logpipeline_validation.go b/apis/telemetry/v1alpha1/logpipeline_validation.go index 7bfd6a7a7..6119c2815 100644 --- a/apis/telemetry/v1alpha1/logpipeline_validation.go +++ b/apis/telemetry/v1alpha1/logpipeline_validation.go @@ -2,7 +2,6 @@ package v1alpha1 import ( "fmt" - "net/url" "regexp" "strings" @@ -31,12 +30,6 @@ func (lp *LogPipeline) validateOutput(deniedOutputPlugins []string) error { } } - if output.IsLokiDefined() { - if err := validateLokiOutput(output.Loki); err != nil { - return err - } - } - return validateCustomOutput(deniedOutputPlugins, output.Custom) } @@ -50,20 +43,6 @@ func checkSingleOutputPlugin(output Output) error { return nil } -func validateLokiOutput(lokiOutput *LokiOutput) error { - if lokiOutput.URL.Value != "" && !validURL(lokiOutput.URL.Value) { - return fmt.Errorf("invalid hostname '%s'", lokiOutput.URL.Value) - } - if !lokiOutput.URL.IsDefined() && (len(lokiOutput.Labels) != 0 || len(lokiOutput.RemoveKeys) != 0) { - return fmt.Errorf("loki output must have a URL configured") - } - if secretRefAndValueIsPresent(lokiOutput.URL) { - return fmt.Errorf("loki output URL must have either a value or secret key reference") - } - return nil - -} - func validateHTTPOutput(httpOutput *HTTPOutput) error { isValidHostname, err := validHostname(httpOutput.Host.Value) @@ -89,21 +68,6 @@ func validateHTTPOutput(httpOutput *HTTPOutput) error { return nil } -func validURL(host string) bool { - host = strings.Trim(host, " ") - - _, err := url.ParseRequestURI(host) - if err != nil { - return false - } - - u, err := url.Parse(host) - if err != nil || u.Scheme == "" || u.Host == "" { - return false - } - return true -} - func validHostname(host string) (bool, error) { host = strings.Trim(host, " ") re, err := regexp.Compile(`^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$`) diff --git a/apis/telemetry/v1alpha1/secret_refs.go b/apis/telemetry/v1alpha1/secret_refs.go index 2f5bfc244..bf2a3d5ad 100644 --- a/apis/telemetry/v1alpha1/secret_refs.go +++ b/apis/telemetry/v1alpha1/secret_refs.go @@ -25,10 +25,6 @@ func (lp *LogPipeline) GetEnvSecretRefs() []SecretKeyRef { refs = appendIfSecretRef(refs, output.HTTP.User) refs = appendIfSecretRef(refs, output.HTTP.Password) } - if output.IsLokiDefined() { - refs = appendIfSecretRef(refs, output.Loki.URL) - } - return refs } diff --git a/apis/telemetry/v1alpha1/secret_refs_test.go b/apis/telemetry/v1alpha1/secret_refs_test.go index 5814ecb95..d82dc2f7c 100644 --- a/apis/telemetry/v1alpha1/secret_refs_test.go +++ b/apis/telemetry/v1alpha1/secret_refs_test.go @@ -79,70 +79,6 @@ func TestLogPipeline_GetSecretRefs(t *testing.T) { {Name: "creds", Namespace: "default", Key: "password"}, }, }, - { - name: "loki output secret refs", - given: LogPipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "loki", - }, - Spec: LogPipelineSpec{ - Output: Output{ - Loki: &LokiOutput{ - URL: ValueType{ - ValueFrom: &ValueFromSource{ - SecretKeyRef: &SecretKeyRef{ - Name: "creds", Namespace: "default", Key: "url", - }, - }, - }, - }, - }, - }, - }, - expected: []SecretKeyRef{ - {Name: "creds", Namespace: "default", Key: "url"}, - }, - }, - { - name: "output secret refs and variables", - given: LogPipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "loki", - }, - Spec: LogPipelineSpec{ - Output: Output{ - Loki: &LokiOutput{ - URL: ValueType{ - ValueFrom: &ValueFromSource{ - SecretKeyRef: &SecretKeyRef{ - Name: "creds", Namespace: "default", Key: "url", - }, - }, - }, - }, - }, - Variables: []VariableRef{ - { - Name: "password-1", - ValueFrom: ValueFromSource{ - SecretKeyRef: &SecretKeyRef{Name: "secret-1", Key: "password"}, - }, - }, - { - Name: "password-2", - ValueFrom: ValueFromSource{ - SecretKeyRef: &SecretKeyRef{Name: "secret-2", Key: "password"}, - }, - }, - }, - }, - }, - expected: []SecretKeyRef{ - {Name: "creds", Namespace: "default", Key: "url"}, - {Name: "secret-1", Key: "password"}, - {Name: "secret-2", Key: "password"}, - }, - }, } for _, test := range tests { diff --git a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go index e3ced1705..176974a60 100644 --- a/apis/telemetry/v1alpha1/zz_generated.deepcopy.go +++ b/apis/telemetry/v1alpha1/zz_generated.deepcopy.go @@ -471,34 +471,6 @@ func (in *LogPipelineValidationConfig) DeepCopy() *LogPipelineValidationConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LokiOutput) DeepCopyInto(out *LokiOutput) { - *out = *in - in.URL.DeepCopyInto(&out.URL) - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.RemoveKeys != nil { - in, out := &in.RemoveKeys, &out.RemoveKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LokiOutput. -func (in *LokiOutput) DeepCopy() *LokiOutput { - if in == nil { - return nil - } - out := new(LokiOutput) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MetricPipeline) DeepCopyInto(out *MetricPipeline) { *out = *in @@ -888,11 +860,6 @@ func (in *Output) DeepCopyInto(out *Output) { *out = new(HTTPOutput) (*in).DeepCopyInto(*out) } - if in.Loki != nil { - in, out := &in.Loki, &out.Loki - *out = new(LokiOutput) - (*in).DeepCopyInto(*out) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Output. diff --git a/apis/telemetry/v1beta1/logpipeline_types.go b/apis/telemetry/v1beta1/logpipeline_types.go index a314d9e21..6c1e5b51c 100644 --- a/apis/telemetry/v1beta1/logpipeline_types.go +++ b/apis/telemetry/v1beta1/logpipeline_types.go @@ -108,8 +108,6 @@ type Output struct { Custom string `json:"custom,omitempty"` // Configures an HTTP-based output compatible with the Fluent Bit HTTP output plugin. HTTP *HTTPOutput `json:"http,omitempty"` - // The grafana-loki output is not supported anymore. For integration with a custom Loki installation, use the `custom` output and follow [Installing a custom Loki stack in Kyma](https://kyma-project.io/#/telemetry-manager/user/integration/loki/README ). - Loki *LokiOutput `json:"grafana-loki,omitempty"` } // HTTPOutput configures an HTTP-based output compatible with the Fluent Bit HTTP output plugin. @@ -134,16 +132,6 @@ type HTTPOutput struct { Dedot bool `json:"dedot,omitempty"` } -// LokiOutput configures an output to the Kyma-internal Loki instance. -type LokiOutput struct { - // Grafana Loki URL. - URL ValueType `json:"url,omitempty"` - // Labels to set for each log record. - Labels map[string]string `json:"labels,omitempty"` - // Attributes to be removed from a log record. - RemoveKeys []string `json:"removeKeys,omitempty"` -} - // +kubebuilder:validation:XValidation:rule="has(self.cert) == has(self.key)", message="Can define either both 'cert' and 'key', or neither" type TLSConfig struct { // Indicates if TLS is disabled or enabled. Default is `false`. @@ -204,10 +192,6 @@ func (o *Output) IsHTTPDefined() bool { return o.HTTP != nil && o.HTTP.Host.IsDefined() } -func (o *Output) IsLokiDefined() bool { - return o.Loki != nil && o.Loki.URL.IsDefined() -} - func (o *Output) IsAnyDefined() bool { return o.pluginCount() > 0 } @@ -224,9 +208,6 @@ func (o *Output) pluginCount() int { if o.IsHTTPDefined() { plugins++ } - if o.IsLokiDefined() { - plugins++ - } return plugins } diff --git a/apis/telemetry/v1beta1/logpipeline_types_test.go b/apis/telemetry/v1beta1/logpipeline_types_test.go index 156e1c953..fff2a2940 100644 --- a/apis/telemetry/v1beta1/logpipeline_types_test.go +++ b/apis/telemetry/v1beta1/logpipeline_types_test.go @@ -30,34 +30,18 @@ func TestLogPipelineOutput(t *testing.T) { expectedAny: true, expectedSingle: true, }, - { - name: "loki", - given: Output{Loki: &LokiOutput{URL: ValueType{Value: "localhost"}}}, - expectedLoki: true, - expectedAny: true, - expectedSingle: true, - }, { name: "invalid: none defined", given: Output{}, expectedAny: false, expectedSingle: false, }, - { - name: "invalid: multiple defined", - given: Output{Custom: "name: null", Loki: &LokiOutput{URL: ValueType{Value: "localhost"}}}, - expectedCustom: true, - expectedLoki: true, - expectedAny: true, - expectedSingle: false, - }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { require.Equal(t, test.expectedCustom, test.given.IsCustomDefined()) require.Equal(t, test.expectedHTTP, test.given.IsHTTPDefined()) - require.Equal(t, test.expectedLoki, test.given.IsLokiDefined()) require.Equal(t, test.expectedAny, test.given.IsAnyDefined()) }) } diff --git a/apis/telemetry/v1beta1/logpipeline_validation.go b/apis/telemetry/v1beta1/logpipeline_validation.go index 890b23b2b..bef63fcb9 100644 --- a/apis/telemetry/v1beta1/logpipeline_validation.go +++ b/apis/telemetry/v1beta1/logpipeline_validation.go @@ -2,7 +2,6 @@ package v1beta1 import ( "fmt" - "net/url" "regexp" "strings" @@ -31,12 +30,6 @@ func (lp *LogPipeline) validateOutput(deniedOutputPlugins []string) error { } } - if output.IsLokiDefined() { - if err := validateLokiOutput(output.Loki); err != nil { - return err - } - } - return validateCustomOutput(deniedOutputPlugins, output.Custom) } @@ -50,20 +43,6 @@ func checkSingleOutputPlugin(output Output) error { return nil } -func validateLokiOutput(lokiOutput *LokiOutput) error { - if lokiOutput.URL.Value != "" && !validURL(lokiOutput.URL.Value) { - return fmt.Errorf("invalid hostname '%s'", lokiOutput.URL.Value) - } - if !lokiOutput.URL.IsDefined() && (len(lokiOutput.Labels) != 0 || len(lokiOutput.RemoveKeys) != 0) { - return fmt.Errorf("loki output must have a URL configured") - } - if secretRefAndValueIsPresent(lokiOutput.URL) { - return fmt.Errorf("loki output URL must have either a value or secret key reference") - } - return nil - -} - func validateHTTPOutput(httpOutput *HTTPOutput) error { isValidHostname, err := validHostname(httpOutput.Host.Value) @@ -89,21 +68,6 @@ func validateHTTPOutput(httpOutput *HTTPOutput) error { return nil } -func validURL(host string) bool { - host = strings.Trim(host, " ") - - _, err := url.ParseRequestURI(host) - if err != nil { - return false - } - - u, err := url.Parse(host) - if err != nil || u.Scheme == "" || u.Host == "" { - return false - } - return true -} - func validHostname(host string) (bool, error) { host = strings.Trim(host, " ") re, err := regexp.Compile(`^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$`) diff --git a/apis/telemetry/v1beta1/secret_refs.go b/apis/telemetry/v1beta1/secret_refs.go index 2f56d303f..ccffb4c5c 100644 --- a/apis/telemetry/v1beta1/secret_refs.go +++ b/apis/telemetry/v1beta1/secret_refs.go @@ -25,9 +25,6 @@ func (lp *LogPipeline) GetEnvSecretRefs() []SecretKeyRef { refs = appendIfSecretRef(refs, output.HTTP.User) refs = appendIfSecretRef(refs, output.HTTP.Password) } - if output.IsLokiDefined() { - refs = appendIfSecretRef(refs, output.Loki.URL) - } return refs } diff --git a/apis/telemetry/v1beta1/secret_refs_test.go b/apis/telemetry/v1beta1/secret_refs_test.go index 3ee4b9b0a..3228f628b 100644 --- a/apis/telemetry/v1beta1/secret_refs_test.go +++ b/apis/telemetry/v1beta1/secret_refs_test.go @@ -79,70 +79,6 @@ func TestLogPipeline_GetSecretRefs(t *testing.T) { {Name: "creds", Namespace: "default", Key: "password"}, }, }, - { - name: "loki output secret refs", - given: LogPipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "loki", - }, - Spec: LogPipelineSpec{ - Output: Output{ - Loki: &LokiOutput{ - URL: ValueType{ - ValueFrom: &ValueFromSource{ - SecretKeyRef: &SecretKeyRef{ - Name: "creds", Namespace: "default", Key: "url", - }, - }, - }, - }, - }, - }, - }, - expected: []SecretKeyRef{ - {Name: "creds", Namespace: "default", Key: "url"}, - }, - }, - { - name: "output secret refs and variables", - given: LogPipeline{ - ObjectMeta: metav1.ObjectMeta{ - Name: "loki", - }, - Spec: LogPipelineSpec{ - Output: Output{ - Loki: &LokiOutput{ - URL: ValueType{ - ValueFrom: &ValueFromSource{ - SecretKeyRef: &SecretKeyRef{ - Name: "creds", Namespace: "default", Key: "url", - }, - }, - }, - }, - }, - Variables: []VariableRef{ - { - Name: "password-1", - ValueFrom: ValueFromSource{ - SecretKeyRef: &SecretKeyRef{Name: "secret-1", Key: "password"}, - }, - }, - { - Name: "password-2", - ValueFrom: ValueFromSource{ - SecretKeyRef: &SecretKeyRef{Name: "secret-2", Key: "password"}, - }, - }, - }, - }, - }, - expected: []SecretKeyRef{ - {Name: "creds", Namespace: "default", Key: "url"}, - {Name: "secret-1", Key: "password"}, - {Name: "secret-2", Key: "password"}, - }, - }, } for _, test := range tests { diff --git a/apis/telemetry/v1beta1/zz_generated.deepcopy.go b/apis/telemetry/v1beta1/zz_generated.deepcopy.go index 6b339ebdc..3407f84db 100644 --- a/apis/telemetry/v1beta1/zz_generated.deepcopy.go +++ b/apis/telemetry/v1beta1/zz_generated.deepcopy.go @@ -375,34 +375,6 @@ func (in *LogPipelineValidationConfig) DeepCopy() *LogPipelineValidationConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LokiOutput) DeepCopyInto(out *LokiOutput) { - *out = *in - in.URL.DeepCopyInto(&out.URL) - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.RemoveKeys != nil { - in, out := &in.RemoveKeys, &out.RemoveKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LokiOutput. -func (in *LokiOutput) DeepCopy() *LokiOutput { - if in == nil { - return nil - } - out := new(LokiOutput) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MetricPipeline) DeepCopyInto(out *MetricPipeline) { *out = *in @@ -792,11 +764,6 @@ func (in *Output) DeepCopyInto(out *Output) { *out = new(HTTPOutput) (*in).DeepCopyInto(*out) } - if in.Loki != nil { - in, out := &in.Loki, &out.Loki - *out = new(LokiOutput) - (*in).DeepCopyInto(*out) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Output. diff --git a/config/busola/logpipeline_busola_extension_cm.yaml b/config/busola/logpipeline_busola_extension_cm.yaml index f5c649616..31b9c66b3 100644 --- a/config/busola/logpipeline_busola_extension_cm.yaml +++ b/config/busola/logpipeline_busola_extension_cm.yaml @@ -92,19 +92,6 @@ data: language: '''plaintext''' source: spec.output.custom visibility: $exists(spec.output.custom) - - name: Grafana-Loki - widget: Panel - visibility: $not($exists(spec.output.custom) or $exists(spec.output.http)) - children: - - name: URL - source: spec.output.`grafana-loki`.url.value - - name: Labels - widget: Labels - source: spec.output.`grafana-loki`.labels - - name: Remove keys - widget: JoinedArray - separator: ',' - source: spec.output.`grafana-loki`.removeKeys - name: HTTP widget: Panel visibility: $exists(spec.output.http) diff --git a/config/crd/bases/telemetry.kyma-project.io_logpipelines.yaml b/config/crd/bases/telemetry.kyma-project.io_logpipelines.yaml index d25530490..aae4c90ea 100644 --- a/config/crd/bases/telemetry.kyma-project.io_logpipelines.yaml +++ b/config/crd/bases/telemetry.kyma-project.io_logpipelines.yaml @@ -153,52 +153,6 @@ spec: Note: If you use a `custom` output, you put the LogPipeline in unsupported mode.' type: string - grafana-loki: - description: The grafana-loki output is not supported anymore. - For integration with a custom Loki installation, use the `custom` - output and follow [Installing a custom Loki stack in Kyma](https://kyma-project.io/#/telemetry-manager/user/integration/loki/README - ). - properties: - labels: - additionalProperties: - type: string - description: Labels to set for each log record. - type: object - removeKeys: - description: Attributes to be removed from a log record. - items: - type: string - type: array - url: - description: Grafana Loki URL. - properties: - value: - description: The value as plain text. - type: string - valueFrom: - description: The value as a reference to a resource. - properties: - secretKeyRef: - description: Refers to the value of a specific key - in a Secret. You must provide `name` and `namespace` - of the Secret, as well as the name of the `key`. - properties: - key: - description: The name of the attribute of the - Secret holding the referenced value. - type: string - name: - description: The name of the Secret containing - the referenced value - type: string - namespace: - description: The name of the Namespace containing - the Secret with the referenced value. - type: string - type: object - type: object - type: object - type: object http: description: Configures an HTTP-based output compatible with the Fluent Bit HTTP output plugin. diff --git a/config/development/crd/bases/telemetry.kyma-project.io_logpipelines.yaml b/config/development/crd/bases/telemetry.kyma-project.io_logpipelines.yaml index c5809a51b..c93b5d72b 100644 --- a/config/development/crd/bases/telemetry.kyma-project.io_logpipelines.yaml +++ b/config/development/crd/bases/telemetry.kyma-project.io_logpipelines.yaml @@ -153,52 +153,6 @@ spec: Note: If you use a `custom` output, you put the LogPipeline in unsupported mode.' type: string - grafana-loki: - description: The grafana-loki output is not supported anymore. - For integration with a custom Loki installation, use the `custom` - output and follow [Installing a custom Loki stack in Kyma](https://kyma-project.io/#/telemetry-manager/user/integration/loki/README - ). - properties: - labels: - additionalProperties: - type: string - description: Labels to set for each log record. - type: object - removeKeys: - description: Attributes to be removed from a log record. - items: - type: string - type: array - url: - description: Grafana Loki URL. - properties: - value: - description: The value as plain text. - type: string - valueFrom: - description: The value as a reference to a resource. - properties: - secretKeyRef: - description: Refers to the value of a specific key - in a Secret. You must provide `name` and `namespace` - of the Secret, as well as the name of the `key`. - properties: - key: - description: The name of the attribute of the - Secret holding the referenced value. - type: string - name: - description: The name of the Secret containing - the referenced value - type: string - namespace: - description: The name of the Namespace containing - the Secret with the referenced value. - type: string - type: object - type: object - type: object - type: object http: description: Configures an HTTP-based output compatible with the Fluent Bit HTTP output plugin. @@ -664,52 +618,6 @@ spec: Note: If you use a `custom` output, you put the LogPipeline in unsupported mode.' type: string - grafana-loki: - description: The grafana-loki output is not supported anymore. - For integration with a custom Loki installation, use the `custom` - output and follow [Installing a custom Loki stack in Kyma](https://kyma-project.io/#/telemetry-manager/user/integration/loki/README - ). - properties: - labels: - additionalProperties: - type: string - description: Labels to set for each log record. - type: object - removeKeys: - description: Attributes to be removed from a log record. - items: - type: string - type: array - url: - description: Grafana Loki URL. - properties: - value: - description: The value as plain text. - type: string - valueFrom: - description: The value as a reference to a resource. - properties: - secretKeyRef: - description: Refers to the value of a specific key - in a Secret. You must provide `name` and `namespace` - of the Secret, as well as the name of the `key`. - properties: - key: - description: The name of the attribute of the - Secret holding the referenced value. - type: string - name: - description: The name of the Secret containing - the referenced value - type: string - namespace: - description: The name of the Namespace containing - the Secret with the referenced value. - type: string - type: object - type: object - type: object - type: object http: description: Configures an HTTP-based output compatible with the Fluent Bit HTTP output plugin. diff --git a/docs/user/resources/01-telemetry.md b/docs/user/resources/01-telemetry.md index 53b3b1875..8f7dab634 100644 --- a/docs/user/resources/01-telemetry.md +++ b/docs/user/resources/01-telemetry.md @@ -129,7 +129,6 @@ The state of the log components is determined by the status condition of type `L | False | ResourceBlocksDeletion | The deletion of the module is blocked. To unblock the deletion, delete the following resources: LogPipelines (resource-1, resource-2,...), LogParsers (resource-1, resource-2,...) | | False | TLSCertificateExpired | TLS (CA) certificate expired on YYYY-MM-DD | | False | TLSConfigurationInvalid | TLS configuration invalid | -| False | UnsupportedLokiOutput | The grafana-loki output is not supported anymore. For integration with a custom Loki installation, use the `custom` output and follow [Installing a custom Loki stack in Kyma](https://kyma-project.io/#/telemetry-manager/user/integration/loki/README). | | False | ValidationFailed | Pipeline validation failed due to an error from the Kubernetes API server | | False | AllDataDropped | Backend is not reachable or rejecting logs. All logs are dropped. See troubleshooting: [No Logs Arrive at the Backend](https://kyma-project.io/#/telemetry-manager/user/02-logs?id=no-logs-arrive-at-the-backend) | | False | BufferFillingUp | Buffer nearing capacity. Incoming log rate exceeds export rate. See troubleshooting: [Agent Buffer Filling Up](https://kyma-project.io/#/telemetry-manager/user/02-logs?id=agent-buffer-filling-up) | diff --git a/docs/user/resources/02-logpipeline.md b/docs/user/resources/02-logpipeline.md index ecc8baa82..9e04dd83f 100644 --- a/docs/user/resources/02-logpipeline.md +++ b/docs/user/resources/02-logpipeline.md @@ -98,16 +98,6 @@ For details, see the [LogPipeline specification file](https://github.com/kyma-pr | **input.​application.​namespaces.​system** | boolean | Set to `true` if collecting from all Namespaces must also include the system Namespaces like kube-system, istio-system, and kyma-system. | | **output** | object | [Fluent Bit output](https://docs.fluentbit.io/manual/pipeline/outputs) where you want to push the logs. Only one output can be specified. | | **output.​custom** | string | Defines a custom output in the Fluent Bit syntax. Note: If you use a `custom` output, you put the LogPipeline in unsupported mode. | -| **output.​grafana-loki** | object | The grafana-loki output is not supported anymore. For integration with a custom Loki installation, use the `custom` output and follow [Installing a custom Loki stack in Kyma](https://kyma-project.io/#/telemetry-manager/user/integration/loki/README ). | -| **output.​grafana-loki.​labels** | map\[string\]string | Labels to set for each log record. | -| **output.​grafana-loki.​removeKeys** | \[\]string | Attributes to be removed from a log record. | -| **output.​grafana-loki.​url** | object | Grafana Loki URL. | -| **output.​grafana-loki.​url.​value** | string | The value as plain text. | -| **output.​grafana-loki.​url.​valueFrom** | object | The value as a reference to a resource. | -| **output.​grafana-loki.​url.​valueFrom.​secretKeyRef** | object | Refers to the value of a specific key in a Secret. You must provide `name` and `namespace` of the Secret, as well as the name of the `key`. | -| **output.​grafana-loki.​url.​valueFrom.​secretKeyRef.​key** | string | The name of the attribute of the Secret holding the referenced value. | -| **output.​grafana-loki.​url.​valueFrom.​secretKeyRef.​name** | string | The name of the Secret containing the referenced value | -| **output.​grafana-loki.​url.​valueFrom.​secretKeyRef.​namespace** | string | The name of the Namespace containing the Secret with the referenced value. | | **output.​http** | object | Configures an HTTP-based output compatible with the Fluent Bit HTTP output plugin. | | **output.​http.​compress** | string | Defines the compression algorithm to use. | | **output.​http.​dedot** | boolean | Enables de-dotting of Kubernetes labels and annotations for compatibility with ElasticSearch based backends. Dots (.) will be replaced by underscores (_). Default is `false`. | @@ -202,7 +192,6 @@ The status of the LogPipeline is determined by the condition types `AgentHealthy | ConfigurationGenerated | False | ReferencedSecretMissing | One or more keys in a referenced Secret are missing: Key 'my-key' in Secret 'my-secret' of Namespace 'my-namespace'" | | ConfigurationGenerated | False | TLSCertificateExpired | TLS (CA) certificate expired on YYYY-MM-DD | | ConfigurationGenerated | False | TLSConfigurationInvalid | TLS configuration invalid | -| ConfigurationGenerated | False | UnsupportedLokiOutput | The grafana-loki output is not supported anymore. For integration with a custom Loki installation, use the `custom` output and follow [Intergrate with Loki](https://kyma-project.io/#/telemetry-manager/user/integration/loki/README). | | ConfigurationGenerated | False | ValidationFailed | Pipeline validation failed due to an error from the Kubernetes API server | | TelemetryFlowHealthy | True | FlowHealthy | No problems detected in the telemetry flow | | TelemetryFlowHealthy | False | AllDataDropped | Backend is not reachable or rejecting logs. All logs are dropped. See troubleshooting: [No Logs Arrive at the Backend](https://kyma-project.io/#/telemetry-manager/user/02-logs?id=no-logs-arrive-at-the-backend) | diff --git a/internal/conditions/conditions.go b/internal/conditions/conditions.go index 29ca33c39..5cb0e6f64 100644 --- a/internal/conditions/conditions.go +++ b/internal/conditions/conditions.go @@ -43,7 +43,6 @@ const ( // LogPipeline reasons ReasonAgentConfigured = "AgentConfigured" ReasonSelfMonNoLogsDelivered = "NoLogsDelivered" - ReasonUnsupportedLokiOutput = "UnsupportedLokiOutput" // MetricPipeline reasons ReasonMetricAgentNotRequired = "AgentNotRequired" diff --git a/internal/fluentbit/config/builder/rewritetag_filter.go b/internal/fluentbit/config/builder/rewritetag_filter.go index 17dd008e2..28eabdf1a 100644 --- a/internal/fluentbit/config/builder/rewritetag_filter.go +++ b/internal/fluentbit/config/builder/rewritetag_filter.go @@ -12,10 +12,6 @@ func getEmitterPostfixByOutput(output *telemetryv1alpha1.Output) string { return "http" } - if output.IsLokiDefined() { - return "grafana-loki" - } - if !output.IsCustomDefined() { return "" } diff --git a/internal/reconciler/logpipeline/reconciler.go b/internal/reconciler/logpipeline/reconciler.go index cea999bed..4ffc5f901 100644 --- a/internal/reconciler/logpipeline/reconciler.go +++ b/internal/reconciler/logpipeline/reconciler.go @@ -375,7 +375,7 @@ func (r *Reconciler) calculateChecksum(ctx context.Context) (string, error) { } // getReconcilablePipelines returns the list of log pipelines that are ready to be rendered into the Fluent Bit configuration. -// A pipeline is deployable if it is not being deleted, all secret references exist, and it doesn't have the legacy grafana-loki output defined. +// A pipeline is deployable if it is not being deleted, and all secret references exist. func (r *Reconciler) getReconcilablePipelines(ctx context.Context, allPipelines []telemetryv1alpha1.LogPipeline) ([]telemetryv1alpha1.LogPipeline, error) { var reconcilableLogPipelines []telemetryv1alpha1.LogPipeline for i := range allPipelines { diff --git a/internal/reconciler/logpipeline/reconciler_test.go b/internal/reconciler/logpipeline/reconciler_test.go index c71501cac..ee35166a4 100644 --- a/internal/reconciler/logpipeline/reconciler_test.go +++ b/internal/reconciler/logpipeline/reconciler_test.go @@ -353,49 +353,6 @@ func TestReconcile(t *testing.T) { require.Contains(t, cm.Data[pipeline.Name+".conf"], pipeline.Name, "sections configmap must contain pipeline name") }) - t.Run("loki output is defined", func(t *testing.T) { - pipeline := testutils.NewLogPipelineBuilder().WithFinalizer("FLUENT_BIT_SECTIONS_CONFIG_MAP").WithLokiOutput().Build() - fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithObjects(&pipeline).WithStatusSubresource(&pipeline).Build() - - proberStub := commonStatusStubs.NewDaemonSetProber(nil) - - flowHealthProberStub := &mocks.FlowHealthProber{} - flowHealthProberStub.On("Probe", mock.Anything, pipeline.Name).Return(prober.LogPipelineProbeResult{}, nil) - - pipelineValidatorWithStubs := &Validator{ - EndpointValidator: stubs.NewEndpointValidator(nil), - TLSCertValidator: stubs.NewTLSCertValidator(nil), - SecretRefValidator: stubs.NewSecretRefValidator(nil), - } - - errToMsgStub := &mocks.ErrorToMessageConverter{} - - sut := New(fakeClient, testConfig, proberStub, flowHealthProberStub, istioStatusCheckerStub, overridesHandlerStub, pipelineValidatorWithStubs, errToMsgStub) - _, err := sut.Reconcile(context.Background(), ctrl.Request{NamespacedName: types.NamespacedName{Name: pipeline.Name}}) - require.NoError(t, err) - - var updatedPipeline telemetryv1alpha1.LogPipeline - _ = fakeClient.Get(context.Background(), types.NamespacedName{Name: pipeline.Name}, &updatedPipeline) - - requireHasStatusCondition(t, updatedPipeline, - conditions.TypeConfigurationGenerated, - metav1.ConditionFalse, - conditions.ReasonUnsupportedLokiOutput, - "The grafana-loki output is not supported anymore. For integration with a custom Loki installation, use the `custom` output and follow https://kyma-project.io/#/telemetry-manager/user/integration/loki/README", - ) - - requireHasStatusCondition(t, updatedPipeline, - conditions.TypeFlowHealthy, - metav1.ConditionFalse, - conditions.ReasonSelfMonConfigNotGenerated, - "No logs delivered to backend because LogPipeline specification is not applied to the configuration of Fluent Bit agent. Check the 'ConfigurationGenerated' condition for more details", - ) - - var cm corev1.ConfigMap - err = fakeClient.Get(context.Background(), testConfig.SectionsConfigMap, &cm) - require.Error(t, err, "sections configmap should not exist") - }) - t.Run("flow healthy", func(t *testing.T) { tests := []struct { name string diff --git a/internal/reconciler/logpipeline/status.go b/internal/reconciler/logpipeline/status.go index 96115a875..54d9c9e4c 100644 --- a/internal/reconciler/logpipeline/status.go +++ b/internal/reconciler/logpipeline/status.go @@ -91,10 +91,6 @@ func (r *Reconciler) evaluateConfigGeneratedCondition(ctx context.Context, pipel return metav1.ConditionTrue, conditions.ReasonAgentConfigured, conditions.MessageForLogPipeline(conditions.ReasonAgentConfigured) } - if errors.Is(err, errUnsupportedLokiOutput) { - return metav1.ConditionFalse, conditions.ReasonUnsupportedLokiOutput, conditions.ConvertErrToMsg(err) - } - if errors.Is(err, secretref.ErrSecretRefNotFound) || errors.Is(err, secretref.ErrSecretKeyNotFound) { return metav1.ConditionFalse, conditions.ReasonReferencedSecretMissing, conditions.ConvertErrToMsg(err) } diff --git a/internal/reconciler/logpipeline/validator.go b/internal/reconciler/logpipeline/validator.go index 19f110e0c..c5296671b 100644 --- a/internal/reconciler/logpipeline/validator.go +++ b/internal/reconciler/logpipeline/validator.go @@ -2,7 +2,6 @@ package logpipeline import ( "context" - "errors" telemetryv1alpha1 "github.com/kyma-project/telemetry-manager/apis/telemetry/v1alpha1" "github.com/kyma-project/telemetry-manager/internal/validators/endpoint" @@ -10,8 +9,6 @@ import ( "github.com/kyma-project/telemetry-manager/internal/validators/tlscert" ) -var errUnsupportedLokiOutput = errors.New("the grafana-loki output is not supported anymore. For integration with a custom Loki installation, use the `custom` output and follow https://kyma-project.io/#/telemetry-manager/user/integration/loki/README") - type EndpointValidator interface { Validate(ctx context.Context, endpoint *telemetryv1alpha1.ValueType, protocol string) error } @@ -31,9 +28,6 @@ type Validator struct { } func (v *Validator) validate(ctx context.Context, pipeline *telemetryv1alpha1.LogPipeline) error { - if pipeline.Spec.Output.IsLokiDefined() { - return errUnsupportedLokiOutput - } if err := v.SecretRefValidator.Validate(ctx, pipeline); err != nil { return err diff --git a/internal/reconciler/telemetry/log_components_checker_test.go b/internal/reconciler/telemetry/log_components_checker_test.go index 5c67ceac2..860db5532 100644 --- a/internal/reconciler/telemetry/log_components_checker_test.go +++ b/internal/reconciler/telemetry/log_components_checker_test.go @@ -109,31 +109,6 @@ func TestLogComponentsCheck(t *testing.T) { Message: "Fluent Bit agent DaemonSet is not ready", }, }, - { - name: "should not be healthy if one pipeline has Loki output defined", - pipelines: []telemetryv1alpha1.LogPipeline{ - testutils.NewLogPipelineBuilder(). - WithStatusCondition(healthyAgentCond). - WithStatusCondition(configGeneratedCond). - Build(), - testutils.NewLogPipelineBuilder(). - WithStatusCondition(healthyAgentCond). - WithStatusCondition(metav1.Condition{ - Type: conditions.TypeConfigurationGenerated, - Status: metav1.ConditionFalse, - Reason: conditions.ReasonUnsupportedLokiOutput, - Message: "The grafana-loki output is not supported anymore. For integration with a custom Loki installation, use the `custom` output and follow https://kyma-project.io/#/telemetry-manager/user/integration/loki/README", - }). - Build(), - }, - telemetryInDeletion: false, - expectedCondition: &metav1.Condition{ - Type: conditions.TypeLogComponentsHealthy, - Status: "False", - Reason: "UnsupportedLokiOutput", - Message: "The grafana-loki output is not supported anymore. For integration with a custom Loki installation, use the `custom` output and follow https://kyma-project.io/#/telemetry-manager/user/integration/loki/README", - }, - }, { name: "should prioritize unready ConfigGenerated reason over AgentHealthy reason", pipelines: []telemetryv1alpha1.LogPipeline{ diff --git a/internal/testutils/log_pipeline_builder.go b/internal/testutils/log_pipeline_builder.go index 4fdc33948..7cecbc64a 100644 --- a/internal/testutils/log_pipeline_builder.go +++ b/internal/testutils/log_pipeline_builder.go @@ -24,7 +24,6 @@ type LogPipelineBuilder struct { filters []telemetryv1alpha1.Filter httpOutput *telemetryv1alpha1.HTTPOutput - lokiOutput *telemetryv1alpha1.LokiOutput customOutput string statusConditions []metav1.Condition @@ -105,11 +104,6 @@ func (b *LogPipelineBuilder) WithHTTPOutput(opts ...HTTPOutputOption) *LogPipeli return b } -func (b *LogPipelineBuilder) WithLokiOutput() *LogPipelineBuilder { - b.lokiOutput = defaultLokiOutput() - return b -} - func (b *LogPipelineBuilder) WithCustomOutput(custom string) *LogPipelineBuilder { b.customOutput = custom return b @@ -134,7 +128,7 @@ func (b *LogPipelineBuilder) Build() telemetryv1alpha1.LogPipeline { if b.name == "" { b.name = fmt.Sprintf("test-%d", b.randSource.Int63()) } - if b.httpOutput == nil && b.lokiOutput == nil && b.customOutput == "" { + if b.httpOutput == nil && b.customOutput == "" { b.httpOutput = defaultHTTPOutput() } @@ -149,7 +143,6 @@ func (b *LogPipelineBuilder) Build() telemetryv1alpha1.LogPipeline { Filters: b.filters, Output: telemetryv1alpha1.Output{ HTTP: b.httpOutput, - Loki: b.lokiOutput, Custom: b.customOutput, }, }, @@ -176,9 +169,3 @@ func defaultHTTPOutput() *telemetryv1alpha1.HTTPOutput { }, } } - -func defaultLokiOutput() *telemetryv1alpha1.LokiOutput { - return &telemetryv1alpha1.LokiOutput{ - URL: telemetryv1alpha1.ValueType{Value: "https://localhost:3100"}, - } -} diff --git a/test/e2e/logs_unsupported_loki_output_test.go b/test/e2e/logs_unsupported_loki_output_test.go deleted file mode 100644 index c128c9da5..000000000 --- a/test/e2e/logs_unsupported_loki_output_test.go +++ /dev/null @@ -1,57 +0,0 @@ -//go:build e2e - -package e2e - -import ( - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - operatorv1alpha1 "github.com/kyma-project/telemetry-manager/apis/operator/v1alpha1" - "github.com/kyma-project/telemetry-manager/internal/conditions" - "github.com/kyma-project/telemetry-manager/internal/testutils" - "github.com/kyma-project/telemetry-manager/test/testkit/assert" - kitk8s "github.com/kyma-project/telemetry-manager/test/testkit/k8s" - "github.com/kyma-project/telemetry-manager/test/testkit/suite" -) - -var _ = Describe(suite.ID(), Label(suite.LabelLogs), Ordered, func() { - var pipelineName = suite.ID() - - Context("When a LogPipeline with Loki output exists", Ordered, func() { - - BeforeAll(func() { - pipeline := testutils.NewLogPipelineBuilder().WithName(pipelineName).WithLokiOutput().Build() - - DeferCleanup(func() { - Expect(kitk8s.DeleteObjects(ctx, k8sClient, &pipeline)).Should(Succeed()) - }) - Expect(kitk8s.CreateObjects(ctx, k8sClient, &pipeline)).Should(Succeed()) - }) - - It("Should set ConfigurationGenerated condition to False in pipeline", func() { - assert.LogPipelineHasCondition(ctx, k8sClient, pipelineName, metav1.Condition{ - Type: conditions.TypeConfigurationGenerated, - Status: metav1.ConditionFalse, - Reason: conditions.ReasonUnsupportedLokiOutput, - }) - }) - - It("Should set TelemetryFlowHealthy condition to False in pipeline", func() { - assert.LogPipelineHasCondition(ctx, k8sClient, pipelineName, metav1.Condition{ - Type: conditions.TypeFlowHealthy, - Status: metav1.ConditionFalse, - Reason: conditions.ReasonSelfMonConfigNotGenerated, - }) - }) - - It("Should set LogComponentsHealthy condition to False in Telemetry", func() { - assert.TelemetryHasState(ctx, k8sClient, operatorv1alpha1.StateWarning) - assert.TelemetryHasCondition(ctx, k8sClient, metav1.Condition{ - Type: conditions.TypeLogComponentsHealthy, - Status: metav1.ConditionFalse, - Reason: conditions.ReasonUnsupportedLokiOutput, - }) - }) - }) -})