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

Ensuring the collector behavior remains consistent when mTLS feature gate is enabled but TA is not deployed #3496

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
33 changes: 33 additions & 0 deletions tests/e2e-ta-collector-mtls/ta-disabled/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: prometheus-cr-collector
status:
readyReplicas: 1
replicas: 1
---
apiVersion: v1
data:
collector.yaml: |
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
debug: null
service:
telemetry:
metrics:
address: 0.0.0.0:8888
pipelines:
traces:
exporters:
- debug
receivers:
- otlp
kind: ConfigMap
metadata:
name: prometheus-cr-collector-aec5aa11
76 changes: 76 additions & 0 deletions tests/e2e-ta-collector-mtls/ta-disabled/00-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: v1
automountServiceAccountToken: true
kind: ServiceAccount
metadata:
name: collector
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: (join('-', ['collector', $namespace]))
rules:
- apiGroups:
- ""
resources:
- pods
- nodes
- nodes/metrics
- services
- endpoints
- namespaces
verbs:
- get
- watch
- list
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- get
- watch
- list
- nonResourceURLs:
- /metrics
- /metrics/cadvisor
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: (join('-', ['collector', $namespace]))
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: (join('-', ['collector', $namespace]))
subjects:
- kind: ServiceAccount
name: collector
namespace: ($namespace)
---
ItielOlenick marked this conversation as resolved.
Show resolved Hide resolved
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: prometheus-cr
spec:
config: |
receivers:
ItielOlenick marked this conversation as resolved.
Show resolved Hide resolved
otlp:
protocols:
grpc:
http:
processors:

exporters:
debug:

service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
mode: statefulset
serviceAccount: collector
targetAllocator:
enabled: false
18 changes: 18 additions & 0 deletions tests/e2e-ta-collector-mtls/ta-disabled/chainsaw-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: ta-disabled
spec:
steps:
- name: step-00
try:
- apply:
template: true
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app.kubernetes.io/managed-by=opentelemetry-operator
Loading