Skip to content

Commit 6be7270

Browse files
committed
Fixes configuration for bundled collectors and e2e test for ClusterObservability
Follow-ups to the initial ClusterObservability framework so the generated agent and cluster collectors come up cleanly on stock distributions, plus a smoke e2e that exercises the pipelines end-to-end.
1 parent 17efea8 commit 6be7270

13 files changed

Lines changed: 500 additions & 163 deletions

File tree

.chloggen/clusterobs-fixes.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
change_type: bug_fix
2+
3+
component: cluster-observability
4+
5+
note: Fix dependencies (image, env, volumes) required by the bundled agent and cluster collector configs
6+
7+
issues: [3821, 3818]
8+
9+
subtext: |
10+
Follow-ups to the initial ClusterObservability framework so the generated
11+
agent and cluster collectors come up cleanly on stock distributions:
12+
- Use the contrib distribution of the configured collector image (the
13+
base configs use contrib-only receivers and processors).
14+
- Inject `K8S_NODE_NAME` and `OTEL_NODE_IP` on the agent pod (referenced
15+
by the Instrumentation OTLP endpoint).
16+
- Mount the OpenShift `kubelet-serving-ca` only on OpenShift, where the
17+
host file exists.
18+
- Use the single `container` filelog operator instead of separate
19+
`parser-docker` / `parser-crio` / `parser-containerd` operators.

.github/workflows/e2e-reusable.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ jobs:
5656
e2e-tests:
5757
runs-on: ubuntu-latest
5858
needs: [ build-test-images ]
59+
# Allow opt-in matrix entries (those with `experimental: true` in their
60+
# `include` block) to fail without marking the workflow run red. Combined
61+
# with fail-fast: false this means experimental groups never block other
62+
# operator e2e jobs or the merge queue.
63+
continue-on-error: ${{ matrix.experimental == true }}
5964
strategy:
6065
fail-fast: false
6166
matrix:
@@ -69,6 +74,7 @@ jobs:
6974
- e2e
7075
- e2e-automatic-rbac
7176
- e2e-autoscale
77+
- e2e-clusterobservability
7278
- e2e-instrumentation-default
7379
- e2e-instrumentation
7480
- e2e-no-crds
@@ -87,6 +93,11 @@ jobs:
8793
- e2e-crd-validations
8894
- e2e-ta-standalone
8995
include:
96+
- group: e2e-clusterobservability
97+
# ClusterObservability is behind a feature gate and still maturing;
98+
# mark experimental so failures don't block other operator e2e jobs.
99+
experimental: true
100+
setup: "add-operator-arg OPERATOR_ARG='--feature-gates=+operator.clusterobservability' prepare-e2e-clusterobservability"
90101
- group: e2e-instrumentation-default
91102
setup: "add-instrumentation-params prepare-e2e"
92103
- group: e2e-instrumentation

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,14 @@ e2e: chainsaw
401401
e2e-sidecar: chainsaw
402402
$(CHAINSAW) test --test-dir ./tests/e2e-sidecar --report-name e2e-sidecar $(CHAINSAW_SELECTOR)
403403

404+
# End-to-end tests for ClusterObservability. The CRD is not bundled, so install
405+
# it directly from config/crd/bases/. --parallel 1 because only the oldest
406+
# active ClusterObservability CR reconciles.
407+
.PHONY: e2e-clusterobservability
408+
e2e-clusterobservability: chainsaw
409+
kubectl apply -f config/crd/bases/opentelemetry.io_clusterobservabilities.yaml
410+
$(CHAINSAW) test --test-dir ./tests/e2e-clusterobservability --report-name e2e-clusterobservability --parallel 1
411+
404412
# end-to-end-test for testing automatic RBAC creation
405413
.PHONY: e2e-automatic-rbac
406414
e2e-automatic-rbac: chainsaw
@@ -521,6 +529,14 @@ prepare-e2e: chainsaw set-image-controller add-image-targetallocator add-image-o
521529
prepare-e2e-no-crds: chainsaw set-image-controller add-image-targetallocator add-image-opampbridge start-kind cert-manager install-metrics-server install-targetallocator-prometheus-crds load-image-all deploy-no-crds
522530
@mkdir -p ./.testresults/e2e
523531

532+
# ClusterObservability needs the kubelet to serve a cluster-CA-signed cert so
533+
# the bundled kubeletstats receiver can verify it via the SA-token CA bundle.
534+
# Override KIND_CONFIG to a kubelet-config that enables serverTLSBootstrap; the
535+
# kubelet-serving CSR is then approved as part of start-kind.
536+
.PHONY: prepare-e2e-clusterobservability
537+
prepare-e2e-clusterobservability: KIND_CONFIG = kind-clusterobservability-$(KUBE_VERSION).yaml
538+
prepare-e2e-clusterobservability: add-rbac-permissions-to-operator prepare-e2e
539+
524540
# Run operator-sdk scorecard tests for bundles
525541
.PHONY: scorecard-tests
526542
scorecard-tests: operator-sdk
@@ -619,8 +635,15 @@ container-instrumentation-all: container-instrumentation-java container-instrume
619635
start-kind: kind
620636
ifeq (true,$(START_KIND_CLUSTER))
621637
$(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config $(KIND_CONFIG) || true
638+
@$(MAKE) approve-kubelet-csrs
622639
endif
623640

641+
# Approve any kubelet-serving CSRs created via serverTLSBootstrap. No-op for
642+
# kind configs that do not enable bootstrap.
643+
.PHONY: approve-kubelet-csrs
644+
approve-kubelet-csrs:
645+
@kubectl get csr -o jsonpath='{range .items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs -r kubectl certificate approve
646+
624647
# Stop kind cluster
625648
.PHONY: stop-kind
626649
stop-kind: kind

0 commit comments

Comments
 (0)