Skip to content

Commit

Permalink
e2e example without auth
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wilcsinszky <peter.wilcsinszky@axoflow.com>
  • Loading branch information
pepov committed Jul 15, 2024
1 parent d3c4e2f commit 55714de
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 17 deletions.
29 changes: 29 additions & 0 deletions config/samples/syslog-ng-otlp/manifests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
kind: Logging
apiVersion: logging.banzaicloud.io/v1beta1
metadata:
name: logging
spec:
controlNamespace: default
fluentbit: {}
syslogNG: {}
---
apiVersion: logging.banzaicloud.io/v1beta1
kind: SyslogNGFlow
metadata:
name: all
namespace: log-generator
spec:
match: {}
localOutputRefs:
- otlp
---
apiVersion: logging.banzaicloud.io/v1beta1
kind: SyslogNGOutput
metadata:
name: otlp
namespace: log-generator
spec:
otlp:
url: otel-collector:4317
auth:
insecure: {}
62 changes: 62 additions & 0 deletions config/samples/syslog-ng-otlp/opentelemetry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-config
data:
config.yaml: |-
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
exporters:
debug:
verbosity: detailed
service:
pipelines:
logs/debug:
receivers: [otlp]
exporters: [debug]
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: otel-collector
spec:
selector:
matchLabels:
app: opentelemetry
component: otel-collector
template:
metadata:
labels:
app: opentelemetry
component: otel-collector
spec:
containers:
- name: otel-collector
image: otel/opentelemetry-collector-contrib:0.104.0
volumeMounts:
- mountPath: /etc/otelcol-contrib
name: data
readOnly: true
volumes:
- name: data
configMap:
name: otel-collector-config

---
apiVersion: v1
kind: Service
metadata:
name: otel-collector
labels:
app: opentelemetry
component: otel-collector
spec:
ports:
- name: otlp
port: 4317
selector:
component: otel-collector
1 change: 0 additions & 1 deletion pkg/sdk/logging/model/syslogng/config/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ toolchain go1.22.5

require (
emperror.dev/errors v0.8.1
github.com/MakeNowJust/heredoc v1.0.0
github.com/cisco-open/operator-tools v0.36.0
github.com/kube-logging/logging-operator/pkg/sdk v0.11.0
github.com/siliconbrain/go-seqs v0.12.0
Expand Down
2 changes: 0 additions & 2 deletions pkg/sdk/logging/model/syslogng/config/go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
emperror.dev/errors v0.8.1 h1:UavXZ5cSX/4u9iyvH6aDcuGkVjeexUGJ7Ij7G4VfQT0=
emperror.dev/errors v0.8.1/go.mod h1:YcRvLPh626Ubn2xqtoprejnA5nFha+TJ+2vew48kWuE=
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down
27 changes: 13 additions & 14 deletions pkg/sdk/logging/model/syslogng/config/output_tests/otlp_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2019 Banzai Cloud
// Copyright © 2024 Kube logging authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,6 @@ package test
import (
"testing"

"github.com/MakeNowJust/heredoc"
"github.com/cisco-open/operator-tools/pkg/utils"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down Expand Up @@ -46,11 +45,11 @@ func TestOtlpOutputTable(t *testing.T) {
},
},
},
config: heredoc.Doc(`
destination "output_default_test-otlp-out" {
opentelemetry(url("otlp-server"));
};
`),
config: `
destination "output_default_test-otlp-out" {
opentelemetry(url("otlp-server"));
};
`,
},
{
name: "test_full",
Expand Down Expand Up @@ -78,13 +77,13 @@ func TestOtlpOutputTable(t *testing.T) {
},
},
},
config: heredoc.Doc(`
destination "output_default_test-otlp-out" {
opentelemetry(url("otlp-server") auth(insecure()) disk_buffer(disk_buf_size(0) reliable(yes)) batch-lines(1) compression(yes) channel_args(
"a" => "b"
));
};
`),
config: `
destination "output_default_test-otlp-out" {
opentelemetry(url("otlp-server") auth(insecure()) disk_buffer(disk_buf_size(0) reliable(yes)) batch-lines(1) compression(yes) channel_args(
"a" => "b"
));
};
`,
},
}
for _, tt := range tests {
Expand Down

0 comments on commit 55714de

Please sign in to comment.