Skip to content

Commit ecf8697

Browse files
committed
openshift
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
1 parent fac10b1 commit ecf8697

15 files changed

+211
-91
lines changed

tests/e2e-openshift/kafka/05-assert.yaml

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: kafka
7+
spec:
8+
steps:
9+
- name: step-00
10+
try:
11+
- apply:
12+
file: 00-create-kafka-instance.yaml
13+
- assert:
14+
file: 00-assert.yaml
15+
- apply:
16+
file: 01-create-kafka-topics.yaml
17+
- assert:
18+
file: 01-assert.yaml
19+
- apply:
20+
file: 02-otel-kakfa-receiver.yaml
21+
- assert:
22+
file: 02-assert.yaml
23+
- apply:
24+
file: 03-otel-kakfa-exporter.yaml
25+
- assert:
26+
file: 03-assert.yaml
27+
- apply:
28+
file: 04-generate-traces.yaml
29+
- assert:
30+
file: 04-assert.yaml
31+
catch:
32+
- script:
33+
content: ./tests/e2e-openshift/kafka/check_traces.sh

tests/e2e-openshift/monitoring/00-assert.yaml

-4
This file was deleted.

tests/e2e-openshift/monitoring/03-assert.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ rules:
1111
- get
1212
- list
1313
- watch
14-
1514
---
1615
apiVersion: rbac.authorization.k8s.io/v1
1716
kind: ClusterRoleBinding
@@ -25,9 +24,3 @@ subjects:
2524
- kind: ServiceAccount
2625
name: prometheus-user-workload
2726
namespace: openshift-user-workload-monitoring
28-
29-
---
30-
apiVersion: kuttl.dev/v1beta1
31-
kind: TestAssert
32-
commands:
33-
- script: ./tests/e2e-openshift/monitoring/check_metrics.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: monitoring
7+
spec:
8+
steps:
9+
- catch:
10+
- script:
11+
content: ./tests/e2e-openshift/monitoring/check_user_workload_monitoring.sh
12+
name: step-00
13+
try:
14+
- apply:
15+
file: 00-workload-monitoring.yaml
16+
- name: step-01
17+
try:
18+
- apply:
19+
file: 01-otel-collector.yaml
20+
- assert:
21+
file: 01-assert.yaml
22+
- name: step-02
23+
try:
24+
- apply:
25+
file: 02-generate-traces.yaml
26+
- assert:
27+
file: 02-assert.yaml
28+
- catch:
29+
- script:
30+
content: ./tests/e2e-openshift/monitoring/check_metrics.sh
31+
name: step-03
32+
try:
33+
- apply:
34+
file: 03-create-monitoring-roles.yaml
35+
- assert:
36+
file: 03-assert.yaml
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,9 @@
1-
apiVersion: kuttl.dev/v1beta1
2-
kind: TestStep
3-
commands:
4-
- script: ./generate_certs.sh
5-
6-
---
71
apiVersion: opentelemetry.io/v1alpha1
82
kind: OpenTelemetryCollector
93
metadata:
104
name: otlp-receiver
115
namespace: kuttl-multi-cluster-receive
126
spec:
13-
mode: "deployment"
14-
ingress:
15-
type: route
16-
route:
17-
termination: "passthrough"
18-
volumes:
19-
- name: kuttl-certs
20-
configMap:
21-
name: kuttl-certs
22-
volumeMounts:
23-
- name: kuttl-certs
24-
mountPath: /certs
257
config: |
268
receivers:
279
otlp:
@@ -47,3 +29,15 @@ spec:
4729
receivers: [otlp]
4830
processors: []
4931
exporters: [otlp]
32+
ingress:
33+
route:
34+
termination: passthrough
35+
type: route
36+
mode: deployment
37+
volumeMounts:
38+
- mountPath: /certs
39+
name: kuttl-certs
40+
volumes:
41+
- configMap:
42+
name: kuttl-certs
43+
name: kuttl-certs

tests/e2e-openshift/multi-cluster/03-otlp-sender.yaml

+37-26
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,57 @@
1-
---
21
apiVersion: v1
32
kind: ServiceAccount
43
metadata:
54
name: kuttl-multi-cluster
65
namespace: kuttl-multi-cluster-send
7-
86
---
97
apiVersion: rbac.authorization.k8s.io/v1
108
kind: ClusterRole
119
metadata:
1210
name: kuttl-multi-cluster
1311
rules:
14-
- apiGroups: ["config.openshift.io"]
15-
resources: ["infrastructures", "infrastructures/status"]
16-
verbs: ["get", "watch", "list"]
17-
- apiGroups: ["apps"]
18-
resources: ["replicasets"]
19-
verbs: ["get", "watch", "list"]
20-
- apiGroups: [""]
21-
resources: ["pods"]
22-
verbs: ["get", "watch", "list"]
23-
- apiGroups: [""]
24-
resources: ["namespaces"]
25-
verbs: ["get", "watch", "list"]
26-
12+
- apiGroups:
13+
- config.openshift.io
14+
resources:
15+
- infrastructures
16+
- infrastructures/status
17+
verbs:
18+
- get
19+
- watch
20+
- list
21+
- apiGroups:
22+
- apps
23+
resources:
24+
- replicasets
25+
verbs:
26+
- get
27+
- watch
28+
- list
29+
- apiGroups:
30+
- ""
31+
resources:
32+
- pods
33+
verbs:
34+
- get
35+
- watch
36+
- list
37+
- apiGroups:
38+
- ""
39+
resources:
40+
- namespaces
41+
verbs:
42+
- get
43+
- watch
44+
- list
2745
---
2846
apiVersion: rbac.authorization.k8s.io/v1
2947
kind: ClusterRoleBinding
3048
metadata:
3149
name: kuttl-multi-cluster
50+
roleRef:
51+
apiGroup: rbac.authorization.k8s.io
52+
kind: ClusterRole
53+
name: kuttl-multi-cluster
3254
subjects:
3355
- kind: ServiceAccount
3456
name: kuttl-multi-cluster
3557
namespace: kuttl-multi-cluster-send
36-
roleRef:
37-
kind: ClusterRole
38-
name: kuttl-multi-cluster
39-
apiGroup: rbac.authorization.k8s.io
40-
41-
---
42-
---
43-
apiVersion: kuttl.dev/v1beta1
44-
kind: TestStep
45-
commands:
46-
- script: ./create_otlp_sender.sh

tests/e2e-openshift/multi-cluster/05-assert.yaml

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: multi-cluster
7+
spec:
8+
steps:
9+
- name: step-00
10+
try:
11+
- apply:
12+
file: 00-create-namespaces.yaml
13+
- assert:
14+
file: 00-assert.yaml
15+
- apply:
16+
file: 01-create-jaeger.yaml
17+
- assert:
18+
file: 01-assert.yaml
19+
- script:
20+
content: ./generate_certs.sh
21+
- apply:
22+
file: 02-otlp-receiver.yaml
23+
- assert:
24+
file: 02-assert.yaml
25+
- script:
26+
content: ./create_otlp_sender.sh
27+
- apply:
28+
file: 03-otlp-sender.yaml
29+
- assert:
30+
file: 03-assert.yaml
31+
- apply:
32+
file: 04-generate-traces.yaml
33+
- assert:
34+
file: 04-assert.yaml
35+
catch:
36+
- script:
37+
content: ./tests/e2e-openshift/multi-cluster/check_traces.sh

tests/e2e-openshift/otlp-metrics-traces/01-assert.yaml

-4
This file was deleted.

tests/e2e-openshift/otlp-metrics-traces/04-assert.yaml

-6
This file was deleted.

tests/e2e-openshift/otlp-metrics-traces/05-assert.yaml

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: otlp-metrics-traces
7+
spec:
8+
steps:
9+
- name: step-00
10+
try:
11+
- apply:
12+
file: 00-install-jaeger.yaml
13+
- assert:
14+
file: 00-assert.yaml
15+
- name: step-01
16+
try:
17+
- apply:
18+
file: 01-workload-monitoring.yaml
19+
- apply:
20+
file: 02-otel-metrics-collector.yaml
21+
- assert:
22+
file: 02-assert.yaml
23+
- apply:
24+
file: 03-metrics-traces-gen.yaml
25+
- assert:
26+
file: 03-assert.yaml
27+
catch:
28+
- script:
29+
content: ./tests/e2e-openshift/otlp-metrics-traces/check_user_workload_monitoring.sh
30+
- script:
31+
content: ./tests/e2e-openshift/otlp-metrics-traces/check_traces.sh
32+
- script:
33+
content: ./tests/e2e-openshift/otlp-metrics-traces/check_metrics.sh

tests/e2e-openshift/route/01-report-empty-otlphttp-spans.yaml

-9
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+
apiVersion: chainsaw.kyverno.io/v1alpha1
3+
kind: Test
4+
metadata:
5+
creationTimestamp: null
6+
name: route
7+
spec:
8+
steps:
9+
- name: step-00
10+
try:
11+
- apply:
12+
file: 00-install.yaml
13+
- assert:
14+
file: 00-assert.yaml
15+
- name: step-01
16+
try:
17+
- script:
18+
content: |
19+
#!/bin/bash
20+
set -ex
21+
# Export empty payload and check of collector accepted it with 2xx status code
22+
otlp_http_host=$(kubectl get route otlp-http-simplest-route -n $NAMESPACE -o jsonpath='{.spec.host}')
23+
for i in {1..40}; do curl --fail -ivX POST http://${otlp_http_host}:80/v1/traces -H "Content-Type: application/json" -d '{}' && break || sleep 1; done

0 commit comments

Comments
 (0)