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

Update e2e test using the new bridge test server #3102

Merged
merged 3 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_TOOLS_VERSION ?= v0.14.0
GOLANGCI_LINT_VERSION ?= v1.57.2
KIND_VERSION ?= v0.20.0
CHAINSAW_VERSION ?= v0.1.7
CHAINSAW_VERSION ?= v0.2.5

.PHONY: install-tools
install-tools: kustomize golangci-lint kind controller-gen envtest crdoc kind operator-sdk chainsaw
Expand Down
62 changes: 2 additions & 60 deletions tests/e2e-opampbridge/opampbridge/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,65 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-opamp-bridge
spec:
template:
spec:
containers:
- env:
- name: OTELCOL_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
name: opamp-bridge-container
volumeMounts:
- mountPath: /conf
name: opamp-bridge-internal
volumes:
- configMap:
items:
- key: remoteconfiguration.yaml
path: remoteconfiguration.yaml
name: test-opamp-bridge
name: opamp-bridge-internal
name: e2e-test-app-bridge-server
status:
readyReplicas: 1
replicas: 1
---
apiVersion: v1
data:
remoteconfiguration.yaml: |
capabilities:
AcceptsOpAMPConnectionSettings: true
AcceptsOtherConnectionSettings: true
AcceptsRemoteConfig: true
AcceptsRestartCommand: true
ReportsEffectiveConfig: true
ReportsHealth: true
ReportsOwnLogs: true
ReportsOwnMetrics: true
ReportsOwnTraces: true
ReportsRemoteConfig: true
ReportsStatus: true
componentsAllowed:
exporters:
- logging
processors:
- memory_limiter
receivers:
- otlp
endpoint: ws://opamp-server:4320/v1/opamp
kind: ConfigMap
metadata:
name: test-opamp-bridge
---
apiVersion: v1
kind: Service
metadata:
name: test-opamp-bridge
spec:
ports:
- name: opamp-bridge
port: 80
protocol: TCP
targetPort: 8080
replicas: 1
86 changes: 40 additions & 46 deletions tests/e2e-opampbridge/opampbridge/00-install.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,44 @@
apiVersion: v1
automountServiceAccountToken: true
kind: ServiceAccount
metadata:
name: opamp-bridge
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
apiVersion: apps/v1
kind: Deployment
metadata:
name: opamp-bridge
rules:
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- get
name: e2e-test-app-bridge-server
spec:
replicas: 1
selector:
matchLabels:
app: e2e-test-app-bridge-server
template:
metadata:
labels:
app: e2e-test-app-bridge-server
spec:
containers:
- name: e2e-test-app-bridge-server
image: ghcr.io/open-telemetry/opentelemetry-operator/e2e-test-app-bridge-server:main
ports:
- containerPort: 4320
- containerPort: 4321
resources:
limits:
memory: "128Mi"
cpu: "250m"
requests:
memory: "64Mi"
cpu: "100m"
---
apiVersion: opentelemetry.io/v1alpha1
kind: OpAMPBridge
apiVersion: v1
kind: Service
metadata:
name: test
name: e2e-test-app-bridge-server
spec:
capabilities:
AcceptsOpAMPConnectionSettings: true
AcceptsOtherConnectionSettings: true
AcceptsRemoteConfig: true
AcceptsRestartCommand: true
ReportsEffectiveConfig: true
ReportsHealth: true
ReportsOwnLogs: true
ReportsOwnMetrics: true
ReportsOwnTraces: true
ReportsRemoteConfig: true
ReportsStatus: true
componentsAllowed:
exporters:
- logging
processors:
- memory_limiter
receivers:
- otlp
endpoint: ws://opamp-server:4320/v1/opamp
selector:
app: e2e-test-app-bridge-server
ports:
- protocol: TCP
port: 4320
targetPort: 4320
name: "opamp"
- protocol: TCP
port: 4321
targetPort: 4321
name: "http"
65 changes: 65 additions & 0 deletions tests/e2e-opampbridge/opampbridge/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-opamp-bridge
spec:
template:
spec:
containers:
- env:
- name: OTELCOL_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
name: opamp-bridge-container
volumeMounts:
- mountPath: /conf
name: opamp-bridge-internal
volumes:
- configMap:
items:
- key: remoteconfiguration.yaml
path: remoteconfiguration.yaml
name: test-opamp-bridge
name: opamp-bridge-internal
status:
readyReplicas: 1
replicas: 1
---
apiVersion: v1
data:
remoteconfiguration.yaml: |
capabilities:
AcceptsOpAMPConnectionSettings: true
AcceptsOtherConnectionSettings: true
AcceptsRemoteConfig: true
AcceptsRestartCommand: true
ReportsEffectiveConfig: true
ReportsHealth: true
ReportsOwnLogs: true
ReportsOwnMetrics: true
ReportsOwnTraces: true
ReportsRemoteConfig: true
ReportsStatus: true
componentsAllowed:
exporters:
- logging
processors:
- memory_limiter
receivers:
- otlp
endpoint: ws://e2e-test-app-bridge-server:4320/v1/opamp
kind: ConfigMap
metadata:
name: test-opamp-bridge
---
apiVersion: v1
kind: Service
metadata:
name: test-opamp-bridge
spec:
ports:
- name: opamp-bridge
port: 80
protocol: TCP
targetPort: 8080
64 changes: 64 additions & 0 deletions tests/e2e-opampbridge/opampbridge/01-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: true
metadata:
name: opamp-bridge
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: opamp-bridge
rules:
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: bridge-cluster-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: opamp-bridge
subjects:
- kind: ServiceAccount
name: opamp-bridge
namespace: ($namespace)
---
apiVersion: opentelemetry.io/v1alpha1
kind: OpAMPBridge
metadata:
name: test
spec:
serviceAccount: "opamp-bridge"
capabilities:
AcceptsOpAMPConnectionSettings: true
AcceptsOtherConnectionSettings: true
AcceptsRemoteConfig: true
AcceptsRestartCommand: true
ReportsEffectiveConfig: true
ReportsHealth: true
ReportsOwnLogs: true
ReportsOwnMetrics: true
ReportsOwnTraces: true
ReportsRemoteConfig: true
ReportsStatus: true
componentsAllowed:
exporters:
- logging
processors:
- memory_limiter
receivers:
- otlp
endpoint: ws://e2e-test-app-bridge-server:4320/v1/opamp
56 changes: 56 additions & 0 deletions tests/e2e-opampbridge/opampbridge/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: simplest-collector
labels:
opentelemetry.io/opamp-reporting: "true"
status:
readyReplicas: 1

---

apiVersion: v1
kind: Service
metadata:
name: simplest-collector-headless
spec:
ports:
- appProtocol: grpc
name: jaeger-grpc
port: 14250
protocol: TCP
targetPort: 14250
- appProtocol: grpc
name: otlp-grpc
port: 4317
protocol: TCP
targetPort: 4317
- appProtocol: http
name: otlp-http
port: 4318
protocol: TCP
targetPort: 4318

---

apiVersion: v1
kind: Service
metadata:
name: simplest-collector
spec:
ports:
- appProtocol: grpc
name: jaeger-grpc
port: 14250
protocol: TCP
targetPort: 14250
- appProtocol: grpc
name: otlp-grpc
port: 4317
protocol: TCP
targetPort: 4317
- appProtocol: http
name: otlp-http
port: 4318
protocol: TCP
targetPort: 4318
26 changes: 26 additions & 0 deletions tests/e2e-opampbridge/opampbridge/02-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: simplest
labels:
opentelemetry.io/opamp-reporting: "true"
spec:
config: |
receivers:
jaeger:
protocols:
grpc:
otlp:
protocols:
grpc:
http:
processors:

exporters:
debug:

service:
pipelines:
traces:
receivers: [jaeger,otlp]
exporters: [debug]
Loading
Loading