Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopgrassi committed Apr 25, 2024
1 parent 007bb07 commit bf444c4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
17 changes: 17 additions & 0 deletions testbed/integration/k8senrichment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Enrich from Kubernetes

This is the e2e test for the Collector use-case:
[Enrich from Kubernetes](https://docs.dynatrace.com/docs/shortlink/otel-collector-cases-k8s-enrich).

## Requirements to run the tests

- Docker
- Kind

The tests require a running Kind k8s cluster. During the tests,
a Dynatrace distribution of the OpenTelemetry Collector is deployed
on the k8s cluster with configurations as per the Dynatrace documentation page.

Traces are generated and sent to the Collector, which then
exports to the test where the k8s attributes are asserted on the
received traces.
11 changes: 2 additions & 9 deletions testbed/integration/k8senrichment/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,8 @@ func newExpectedValue(mode int, value string) *expectedValue {
}
}

// TestE2E_ClusterRBAC tests the k8s attributes processor in a k8s cluster with the collector's service account having
// cluster-wide permissions to list/watch namespaces, nodes, pods and replicasets. The config in the test does not
// set filter::namespace.
// The test requires a prebuilt otelcontribcol image uploaded to a kind k8s cluster defined in
// `/tmp/kube-config-otelcol-e2e-testing`. Run the following command prior to running the test locally:
//
// kind create cluster --kubeconfig=/tmp/kube-config-otelcol-e2e-testing
// make docker-otelcontribcol
// KUBECONFIG=/tmp/kube-config-otelcol-e2e-testing kind load docker-image otelcontribcol:latest
// TestE2E_ClusterRBAC tests the "Enrich from Kubernetes" use case
// See: https://docs.dynatrace.com/docs/shortlink/otel-collector-cases-k8s-enrich
func TestE2E_ClusterRBAC(t *testing.T) {
testDir := filepath.Join("testdata")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ rules:
- apiGroups: [""]
resources: ["pods", "namespaces"]
verbs: ["get", "watch", "list"]

- apiGroups: ["apps"]
resources: ["replicasets"]
verbs: ["get", "watch", "list"]

- apiGroups: ["extensions"]
resources: ["replicasets"]
verbs: ["get", "watch", "list"]
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ .Name }}
name: {{ .Name }}
namespace: e2ek8senrichment

0 comments on commit bf444c4

Please sign in to comment.