diff --git a/templates/virtualization-controller/scrape-config.yaml b/templates/virtualization-controller/scrape-config.yaml new file mode 100644 index 000000000..9d85298ea --- /dev/null +++ b/templates/virtualization-controller/scrape-config.yaml @@ -0,0 +1,33 @@ +--- +apiVersion: monitoring.coreos.com/v1alpha1 +kind: ScrapeConfig +metadata: + name: virtualization-controller + namespace: d8-monitoring + {{- include "helm_lib_module_labels" (list . (dict "app" "virtualization-controller" "prometheus" "main")) | nindent 2 }} +spec: + honorLabels: true + authorization: + credentials: + key: token + name: prometheus-token + scheme: HTTP + tlsConfig: + insecureSkipVerify: true + staticConfigs: + - targets: ['virtualization-controller-metrics.d8-{{ .Chart.Name }}.svc.{{ .Values.global.discovery.clusterDomain }}.:8080'] + relabelings: + - action: labeldrop + regex: (container|endpoint|job|service|pod|exported_namespace|uid) + metricRelabelings: + - sourceLabels: [__name__] + regex: "(.*)" + separator: ; + action: replace + targetLabel: __name__ + replacement: d8_$1 + - action: replace + sourceLabels: + - exported_namespace + targetLabel: namespace + metricsPath: '/metrics' diff --git a/templates/virtualization-controller/service-metrics.yaml b/templates/virtualization-controller/service-metrics.yaml new file mode 100644 index 000000000..4a772c934 --- /dev/null +++ b/templates/virtualization-controller/service-metrics.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: virtualization-controller-metrics + namespace: d8-{{ .Chart.Name }} + {{- include "helm_lib_module_labels" (list . (dict "app" "virtualization-controller")) | nindent 2 }} +spec: + ports: + - type: ClusterIP + clusterIP: None + name: metrics + port: 8080 + protocol: TCP + targetPort: metrics + selector: + app: virtualization-controller diff --git a/templates/virtualization-controller/service-monitor.yaml b/templates/virtualization-controller/service-monitor.yaml deleted file mode 100644 index 976e5da1c..000000000 --- a/templates/virtualization-controller/service-monitor.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: virtualization-controller - namespace: d8-monitoring - {{- include "helm_lib_module_labels" (list . (dict "app" "virtualization-controller" "prometheus" "main")) | nindent 2 }} -spec: - endpoints: - - bearerTokenSecret: - key: token - name: prometheus-token - path: /metrics - port: metrics - scheme: http - metricRelabelings: - - sourceLabels: [__name__] - regex: "(.*)" - separator: ; - action: replace - targetLabel: __name__ - replacement: d8_$1 - - action: replace - sourceLabels: - - exported_namespace - targetLabel: namespace - - action: labeldrop - regex: (container|endpoint|job|service|pod|exported_namespace|uid) - namespaceSelector: - matchNames: - - d8-{{ .Chart.Name }} - selector: - matchLabels: - app: "virtualization-controller" diff --git a/templates/virtualization-controller/service.yaml b/templates/virtualization-controller/service.yaml index 8d57ca102..b64323a18 100644 --- a/templates/virtualization-controller/service.yaml +++ b/templates/virtualization-controller/service.yaml @@ -15,10 +15,6 @@ spec: port: 9443 targetPort: controller protocol: TCP - - name: metrics - port: 8080 - protocol: TCP - targetPort: metrics - name: pprof port: 8081 protocol: TCP