Skip to content

Commit

Permalink
Add e2e test case for multi-cluster by exposing OTEL collector.
Browse files Browse the repository at this point in the history
  • Loading branch information
IshwarKanse committed Aug 17, 2023
1 parent c8d75ed commit 9c2e0fd
Show file tree
Hide file tree
Showing 15 changed files with 623 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/e2e-openshift/multi-cluster/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: project.openshift.io/v1
kind: Project
metadata:
name: kuttl-multi-cluster-send
status:
phase: Active

apiVersion: project.openshift.io/v1
kind: Project
metadata:
name: kuttl-multi-cluster-receive
status:
phase: Active

---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
preferredChain: ""
privateKeySecretRef:
name: private-key-lets-encrypt
server: https://acme-staging-v02.api.letsencrypt.org/directory
solvers:
- http01:
ingress:
class: openshift-default
26 changes: 26 additions & 0 deletions tests/e2e-openshift/multi-cluster/00-cert-manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: Namespace
metadata:
name: kuttl-multi-cluster-send

---
apiVersion: v1
kind: Namespace
metadata:
name: kuttl-multi-cluster-receive

---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
preferredChain: ""
privateKeySecretRef:
name: private-key-lets-encrypt
server: https://acme-staging-v02.api.letsencrypt.org/directory
solvers:
- http01:
ingress:
class: openshift-default
126 changes: 126 additions & 0 deletions tests/e2e-openshift/multi-cluster/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: jaeger
app.kubernetes.io/component: all-in-one
app.kubernetes.io/instance: jaeger-allinone
app.kubernetes.io/managed-by: jaeger-operator
app.kubernetes.io/name: jaeger-allinone
app.kubernetes.io/part-of: jaeger
name: jaeger-allinone
namespace: kuttl-multi-cluster-receive
status:
availableReplicas: 1
readyReplicas: 1
replicas: 1

---
apiVersion: v1
kind: Service
metadata:
labels:
app: jaeger
app.kubernetes.io/component: service-collector
app.kubernetes.io/instance: jaeger-allinone
app.kubernetes.io/managed-by: jaeger-operator
app.kubernetes.io/name: jaeger-allinone-collector
app.kubernetes.io/part-of: jaeger
name: jaeger-allinone-collector
namespace: kuttl-multi-cluster-receive
spec:
ports:
- name: http-zipkin
port: 9411
protocol: TCP
targetPort: 9411
- name: tls-grpc-jaeger
port: 14250
protocol: TCP
targetPort: 14250
- name: http-c-tchan-trft
port: 14267
protocol: TCP
targetPort: 14267
- name: http-c-binary-trft
port: 14268
protocol: TCP
targetPort: 14268
- name: admin-http
port: 14269
protocol: TCP
targetPort: 14269
- name: grpc-otlp
port: 4317
protocol: TCP
targetPort: 4317
- name: http-otlp
port: 4318
protocol: TCP
targetPort: 4318
selector:
app: jaeger
app.kubernetes.io/component: all-in-one
app.kubernetes.io/instance: jaeger-allinone
app.kubernetes.io/managed-by: jaeger-operator
app.kubernetes.io/name: jaeger-allinone
app.kubernetes.io/part-of: jaeger
type: ClusterIP

---
apiVersion: v1
kind: Service
metadata:
labels:
app: jaeger
app.kubernetes.io/component: service-query
app.kubernetes.io/instance: jaeger-allinone
app.kubernetes.io/managed-by: jaeger-operator
app.kubernetes.io/name: jaeger-allinone-query
app.kubernetes.io/part-of: jaeger
name: jaeger-allinone-query
namespace: kuttl-multi-cluster-receive
spec:
ports:
- name: http-query
port: 16686
protocol: TCP
targetPort: 16686
- name: grpc-query
port: 16685
protocol: TCP
targetPort: 16685
- name: admin-http
port: 16687
protocol: TCP
targetPort: 16687
selector:
app: jaeger
app.kubernetes.io/component: all-in-one
app.kubernetes.io/instance: jaeger-allinone
app.kubernetes.io/managed-by: jaeger-operator
app.kubernetes.io/name: jaeger-allinone
app.kubernetes.io/part-of: jaeger
type: ClusterIP

---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: jaeger
app.kubernetes.io/component: query-route
app.kubernetes.io/instance: jaeger-allinone
app.kubernetes.io/managed-by: jaeger-operator
app.kubernetes.io/name: jaeger-allinone
app.kubernetes.io/part-of: jaeger
name: jaeger-allinone
namespace: kuttl-multi-cluster-receive
spec:
port:
targetPort: http-query
tls:
termination: edge
to:
kind: Service
name: jaeger-allinone-query
9 changes: 9 additions & 0 deletions tests/e2e-openshift/multi-cluster/01-create-jaeger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: jaeger-allinone
namespace: kuttl-multi-cluster-receive
spec:
strategy: allinone
ingress:
security: none
125 changes: 125 additions & 0 deletions tests/e2e-openshift/multi-cluster/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: opentelemetry-collector
app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/name: otlp-receiver-collector
app.kubernetes.io/part-of: opentelemetry
app.kubernetes.io/version: latest
name: otlp-receiver-collector
namespace: kuttl-multi-cluster-receive
status:
availableReplicas: 1
readyReplicas: 1
replicas: 1

---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: opentelemetry-collector
app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/name: otlp-receiver-collector
app.kubernetes.io/part-of: opentelemetry
app.kubernetes.io/version: latest
name: otlp-receiver-collector
namespace: kuttl-multi-cluster-receive
spec:
ports:
- appProtocol: http
name: otlp-http
port: 4318
protocol: TCP
targetPort: 4318
- appProtocol: http
name: otlp-http-legacy
port: 55681
protocol: TCP
targetPort: 4318
selector:
app.kubernetes.io/component: opentelemetry-collector
app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/part-of: opentelemetry
type: ClusterIP

---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: opentelemetry-collector
app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/name: otlp-receiver-collector
app.kubernetes.io/part-of: opentelemetry
app.kubernetes.io/version: latest
operator.opentelemetry.io/collector-headless-service: Exists
name: otlp-receiver-collector-headless
namespace: kuttl-multi-cluster-receive
spec:
ports:
- appProtocol: http
name: otlp-http
port: 4318
protocol: TCP
targetPort: 4318
- appProtocol: http
name: otlp-http-legacy
port: 55681
protocol: TCP
targetPort: 4318
selector:
app.kubernetes.io/component: opentelemetry-collector
app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/part-of: opentelemetry
type: ClusterIP

---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
annotations:
acme.cert-manager.io/http01-ingress-class: openshift-default
labels:
app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/name: otlp-http-legacy-otlp-receiver-route
name: otlp-http-legacy-otlp-receiver-route
namespace: kuttl-multi-cluster-receive
spec:
path: /otlp-http-legacy
port:
targetPort: otlp-http-legac
tls:
termination: edge
to:
kind: Service
name: otlp-receiver-collector

---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
annotations:
acme.cert-manager.io/http01-ingress-class: openshift-default
labels:
app.kubernetes.io/instance: kuttl-multi-cluster-receive.otlp-receiver
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/name: otlp-http-otlp-receiver-route
name: otlp-http-otlp-receiver-route
namespace: kuttl-multi-cluster-receive
spec:
path: /otlp-http
port:
targetPort: otlp-http
tls:
termination: edge
to:
kind: Service
name: otlp-receiver-collector
10 changes: 10 additions & 0 deletions tests/e2e-openshift/multi-cluster/02-otlp-receiver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: ./create_bearer_token_creds.sh

---
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: ./create_otlp_receiver.sh
61 changes: 61 additions & 0 deletions tests/e2e-openshift/multi-cluster/03-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: opentelemetry-collector
app.kubernetes.io/instance: kuttl-multi-cluster-send.otel-sender
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/name: otel-sender-collector
app.kubernetes.io/part-of: opentelemetry
app.kubernetes.io/version: latest
name: otel-sender-collector
namespace: kuttl-multi-cluster-send
status:
availableReplicas: 1
readyReplicas: 1
replicas: 1

---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: opentelemetry-collector
app.kubernetes.io/instance: kuttl-multi-cluster-send.otel-sender
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/name: otel-sender-collector
app.kubernetes.io/part-of: opentelemetry
app.kubernetes.io/version: latest
name: otel-sender-collector
namespace: kuttl-multi-cluster-send
spec:
ports:
- name: opencensus
port: 55678
protocol: TCP
targetPort: 55678
- appProtocol: grpc
name: otlp-grpc
port: 4317
protocol: TCP
targetPort: 4317
- appProtocol: http
name: otlp-http
port: 4318
protocol: TCP
targetPort: 4318
- appProtocol: http
name: otlp-http-legacy
port: 55681
protocol: TCP
targetPort: 4318
- appProtocol: http
name: zipkin
port: 9411
protocol: TCP
targetPort: 9411
selector:
app.kubernetes.io/component: opentelemetry-collector
app.kubernetes.io/instance: kuttl-multi-cluster-send.otel-sender
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/part-of: opentelemetry
Loading

0 comments on commit 9c2e0fd

Please sign in to comment.