diff --git a/Makefile b/Makefile index c0538d2fc..992ecbbfe 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/bundle/manifests/jaeger-operator-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml b/bundle/manifests/jaeger-operator-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml new file mode 100644 index 000000000..b9b5df4ca --- /dev/null +++ b/bundle/manifests/jaeger-operator-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml @@ -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 diff --git a/bundle/manifests/jaeger-operator-metrics_v1_service.yaml b/bundle/manifests/jaeger-operator-metrics_v1_service.yaml index 6ff2fe147..0287b505f 100644 --- a/bundle/manifests/jaeger-operator-metrics_v1_service.yaml +++ b/bundle/manifests/jaeger-operator-metrics_v1_service.yaml @@ -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: diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 6f9870c10..fd84c9551 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -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. diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index 5b1a11ac3..cf30965ee 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -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: @@ -19,3 +19,4 @@ spec: selector: matchLabels: name: jaeger-operator + app.kubernetes.io/component: metrics diff --git a/config/rbac/auth_proxy_service.yaml b/config/rbac/auth_proxy_service.yaml index 5e5d1ab6e..458e6a8f7 100644 --- a/config/rbac/auth_proxy_service.yaml +++ b/config/rbac/auth_proxy_service.yaml @@ -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: diff --git a/tests/templates/kuttl-test.yaml b/tests/templates/kuttl-test.yaml index a9d45ee1d..6dae22690 100644 --- a/tests/templates/kuttl-test.yaml +++ b/tests/templates/kuttl-test.yaml @@ -5,6 +5,7 @@ artifactsDir: ../../_build/artifacts/ commands: - script: cd ../../.. && make cert-manager - script: kubectl create namespace observability 2>&1 | grep -v "already exists" || true + - command: make deploy-prometheus-operator - 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 - command: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.1/deploy/static/provider/kind/deploy.yaml