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

Fix metrics selectors #1742

Merged
merged 10 commits into from
Mar 23, 2022
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ bundle-build: ## Build the bundle image.

.PHONY: bundle-push
bundle-push: ## Push the bundle image.
$(MAKE) docker-push IMG=$(BUNDLE_IMG)
docker push $(BUNDLE_IMG)

.PHONY: opm
OPM = ./bin/opm
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
name: jaeger-operator
name: jaeger-operator-metrics-monitor
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
interval: 30s
path: /metrics
scheme: https
scrapeTimeout: 10s
targetPort: 8443
tlsConfig:
insecureSkipVerify: true
selector:
matchLabels:
app.kubernetes.io/component: metrics
name: jaeger-operator
2 changes: 1 addition & 1 deletion bundle/manifests/jaeger-operator-metrics_v1_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Service
metadata:
creationTimestamp: null
labels:
control-plane: jaeger-operator
app.kubernetes.io/component: metrics
name: jaeger-operator
name: jaeger-operator-metrics
spec:
Expand Down
2 changes: 1 addition & 1 deletion config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bases:
- ../webhook
- ../certmanager
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus
- ../prometheus

patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
Expand Down
3 changes: 2 additions & 1 deletion config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
control-plane: controller-manager
name: jaeger-operator
name: jaeger-operator-metrics-monitor
spec:
endpoints:
Expand All @@ -19,3 +19,4 @@ spec:
selector:
matchLabels:
name: jaeger-operator
app.kubernetes.io/component: metrics
3 changes: 2 additions & 1 deletion config/rbac/auth_proxy_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ apiVersion: v1
kind: Service
metadata:
labels:
control-plane: jaeger-operator
name: jaeger-operator
app.kubernetes.io/component: metrics
name: jaeger-operator-metrics
spec:
ports:
Expand Down
2 changes: 1 addition & 1 deletion tests/templates/kuttl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: TestSuite
crdDir: ../../_build/crds/
artifactsDir: ../../_build/artifacts/
commands:
- script: cd ../../.. && make cert-manager
- script: cd ../../.. && make cert-manager && make deploy-prometheus-operator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: make cert-manager deploy-prometheus-operator

- script: kubectl create namespace observability 2>&1 | grep -v "already exists" || true
- command: kubectl apply -f ../../_build/manifests/01-jaeger-operator.yaml -n observability
- command: kubectl wait --timeout=5m --for=condition=available deployment jaeger-operator -n observability
Expand Down