-
Notifications
You must be signed in to change notification settings - Fork 504
120 lines (98 loc) · 5.96 KB
/
operator-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Test Operator Charts
on:
pull_request:
paths:
- 'charts/opentelemetry-operator/**'
branches:
- main
jobs:
operator-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
with:
create-kind-cluster: "true"
- name: Check CRDs
run: make check-operator-crds
- name: Install Openshift route crd
run: kubectl apply -f https://raw.githubusercontent.com/openshift/router/master/deploy/route_crd.yaml
- name: Install Prometheus CRDs
run: |
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
- name: Install cert-manager
run: |
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml
kubectl wait --timeout=5m --for=condition=available deployment cert-manager -n cert-manager
kubectl wait --timeout=5m --for=condition=available deployment cert-manager-webhook -n cert-manager
- name: Run chart-testing (install)
run: ct install --charts charts/opentelemetry-operator
- name: Get opentelemetry-operator repository
run: |
appVersion=$(cat ./charts/opentelemetry-operator/Chart.yaml | sed -nr 's/appVersion: ([0-9]+\.[0-9]+\.[0-9]+)/\1/p')
git clone -b v"$appVersion" --single-branch https://github.com/open-telemetry/opentelemetry-operator.git ./opentelemetry-operator
- name: Install chainsaw
uses: kyverno/[email protected]
- name: Install metrics-server
run: |
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
kubectl patch deployment -n kube-system metrics-server --type "json" -p '[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": --kubelet-insecure-tls}]'
kubectl wait --for=condition=available deployment/metrics-server -n kube-system --timeout=5m
- name: Install opentelemetry-operator chart
run: |
helm install --namespace=opentelemetry-operator-system --create-namespace my-opentelemetry-operator ./charts/opentelemetry-operator \
--set 'manager.extraArgs[0]="--enable-go-instrumentation"' \
--set "manager.collectorImage.repository=otel/opentelemetry-collector-k8s"
kubectl wait --timeout=5m --for=condition=available deployment my-opentelemetry-operator -n opentelemetry-operator-system
- name: Run e2e tests
working-directory: ./opentelemetry-operator
# see https://github.com/open-telemetry/opentelemetry-helm-charts/issues/1180 for flaky test
run: chainsaw test --test-dir ./tests/e2e --exclude-test-regex "chainsaw/multiple-configmaps" --exclude-test-regex "chainsaw/smoke-pod-dns-config"
operator-test-no-certmanager:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
with:
create-kind-cluster: "true"
- name: Check CRDs
run: make check-operator-crds
- name: Install Openshift route crd
run: kubectl apply -f https://raw.githubusercontent.com/openshift/router/master/deploy/route_crd.yaml
- name: Install Prometheus CRDs
run: |
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
- name: Run chart-testing (install)
run: ct install --charts charts/opentelemetry-operator --helm-extra-set-args "--set=admissionWebhooks.certManager.enabled=false"
- name: Get opentelemetry-operator repository
run: |
appVersion=$(cat ./charts/opentelemetry-operator/Chart.yaml | sed -nr 's/appVersion: ([0-9]+\.[0-9]+\.[0-9]+)/\1/p')
git clone -b v"$appVersion" --single-branch https://github.com/open-telemetry/opentelemetry-operator.git ./opentelemetry-operator
- name: Install chainsaw
uses: kyverno/[email protected]
- name: Install metrics-server
run: |
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
kubectl patch deployment -n kube-system metrics-server --type "json" -p '[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": --kubelet-insecure-tls}]'
kubectl wait --for=condition=available deployment/metrics-server -n kube-system --timeout=5m
- name: Install opentelemetry-operator chart
run: |
helm install --namespace=opentelemetry-operator-system --create-namespace my-opentelemetry-operator ./charts/opentelemetry-operator \
--set 'manager.extraArgs[0]="--enable-go-instrumentation"' \
--set "manager.collectorImage.repository=otel/opentelemetry-collector-k8s" \
--set "admissionWebhooks.certManager.enabled=false"
kubectl wait --timeout=5m --for=condition=available deployment my-opentelemetry-operator -n opentelemetry-operator-system
- name: Run e2e tests
working-directory: ./opentelemetry-operator
# see https://github.com/open-telemetry/opentelemetry-helm-charts/issues/1180 for flaky test
run: chainsaw test --test-dir ./tests/e2e --exclude-test-regex "chainsaw/multiple-configmaps" --exclude-test-regex "chainsaw/smoke-pod-dns-config"