mirror of
				https://github.com/prometheus-operator/kube-prometheus.git
				synced 2025-11-04 10:01:03 +01:00 
			
		
		
		
	Merge pull request #463 from rajatvig/support_standard_labels_nodeexporter
Support standard labels for nodeexporter
This commit is contained in:
		
						commit
						cf7bb8706c
					
				@ -16,6 +16,10 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    nodeExporter+:: {
 | 
					    nodeExporter+:: {
 | 
				
			||||||
      port: 9100,
 | 
					      port: 9100,
 | 
				
			||||||
 | 
					      labels: {
 | 
				
			||||||
 | 
					        'app.kubernetes.io/name': 'node-exporter',
 | 
				
			||||||
 | 
					        'app.kubernetes.io/version': $._config.versions.nodeExporter,
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -64,7 +68,7 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
 | 
				
			|||||||
      local toleration = daemonset.mixin.spec.template.spec.tolerationsType;
 | 
					      local toleration = daemonset.mixin.spec.template.spec.tolerationsType;
 | 
				
			||||||
      local containerEnv = container.envType;
 | 
					      local containerEnv = container.envType;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      local podLabels = { app: 'node-exporter' };
 | 
					      local podLabels = $._config.nodeExporter.labels;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      local existsToleration = toleration.new() +
 | 
					      local existsToleration = toleration.new() +
 | 
				
			||||||
                               toleration.withOperator('Exists');
 | 
					                               toleration.withOperator('Exists');
 | 
				
			||||||
@ -154,16 +158,12 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
 | 
				
			|||||||
        metadata: {
 | 
					        metadata: {
 | 
				
			||||||
          name: 'node-exporter',
 | 
					          name: 'node-exporter',
 | 
				
			||||||
          namespace: $._config.namespace,
 | 
					          namespace: $._config.namespace,
 | 
				
			||||||
          labels: {
 | 
					          labels: $._config.nodeExporter.labels,
 | 
				
			||||||
            'k8s-app': 'node-exporter',
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        spec: {
 | 
					        spec: {
 | 
				
			||||||
          jobLabel: 'k8s-app',
 | 
					          jobLabel: 'app.kubernetes.io/name',
 | 
				
			||||||
          selector: {
 | 
					          selector: {
 | 
				
			||||||
            matchLabels: {
 | 
					            matchLabels: $._config.nodeExporter.labels,
 | 
				
			||||||
              'k8s-app': 'node-exporter',
 | 
					 | 
				
			||||||
            },
 | 
					 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          endpoints: [
 | 
					          endpoints: [
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@ -196,7 +196,7 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      service.new('node-exporter', $.nodeExporter.daemonset.spec.selector.matchLabels, nodeExporterPort) +
 | 
					      service.new('node-exporter', $.nodeExporter.daemonset.spec.selector.matchLabels, nodeExporterPort) +
 | 
				
			||||||
      service.mixin.metadata.withNamespace($._config.namespace) +
 | 
					      service.mixin.metadata.withNamespace($._config.namespace) +
 | 
				
			||||||
      service.mixin.metadata.withLabels({ 'k8s-app': 'node-exporter' }) +
 | 
					      service.mixin.metadata.withLabels($._config.nodeExporter.labels) +
 | 
				
			||||||
      service.mixin.spec.withClusterIp('None'),
 | 
					      service.mixin.spec.withClusterIp('None'),
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -2,17 +2,20 @@ apiVersion: apps/v1
 | 
				
			|||||||
kind: DaemonSet
 | 
					kind: DaemonSet
 | 
				
			||||||
metadata:
 | 
					metadata:
 | 
				
			||||||
  labels:
 | 
					  labels:
 | 
				
			||||||
    app: node-exporter
 | 
					    app.kubernetes.io/name: node-exporter
 | 
				
			||||||
 | 
					    app.kubernetes.io/version: v0.18.1
 | 
				
			||||||
  name: node-exporter
 | 
					  name: node-exporter
 | 
				
			||||||
  namespace: monitoring
 | 
					  namespace: monitoring
 | 
				
			||||||
spec:
 | 
					spec:
 | 
				
			||||||
  selector:
 | 
					  selector:
 | 
				
			||||||
    matchLabels:
 | 
					    matchLabels:
 | 
				
			||||||
      app: node-exporter
 | 
					      app.kubernetes.io/name: node-exporter
 | 
				
			||||||
 | 
					      app.kubernetes.io/version: v0.18.1
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    metadata:
 | 
					    metadata:
 | 
				
			||||||
      labels:
 | 
					      labels:
 | 
				
			||||||
        app: node-exporter
 | 
					        app.kubernetes.io/name: node-exporter
 | 
				
			||||||
 | 
					        app.kubernetes.io/version: v0.18.1
 | 
				
			||||||
    spec:
 | 
					    spec:
 | 
				
			||||||
      containers:
 | 
					      containers:
 | 
				
			||||||
      - args:
 | 
					      - args:
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,8 @@ apiVersion: v1
 | 
				
			|||||||
kind: Service
 | 
					kind: Service
 | 
				
			||||||
metadata:
 | 
					metadata:
 | 
				
			||||||
  labels:
 | 
					  labels:
 | 
				
			||||||
    k8s-app: node-exporter
 | 
					    app.kubernetes.io/name: node-exporter
 | 
				
			||||||
 | 
					    app.kubernetes.io/version: v0.18.1
 | 
				
			||||||
  name: node-exporter
 | 
					  name: node-exporter
 | 
				
			||||||
  namespace: monitoring
 | 
					  namespace: monitoring
 | 
				
			||||||
spec:
 | 
					spec:
 | 
				
			||||||
@ -12,4 +13,5 @@ spec:
 | 
				
			|||||||
    port: 9100
 | 
					    port: 9100
 | 
				
			||||||
    targetPort: https
 | 
					    targetPort: https
 | 
				
			||||||
  selector:
 | 
					  selector:
 | 
				
			||||||
    app: node-exporter
 | 
					    app.kubernetes.io/name: node-exporter
 | 
				
			||||||
 | 
					    app.kubernetes.io/version: v0.18.1
 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,8 @@ apiVersion: monitoring.coreos.com/v1
 | 
				
			|||||||
kind: ServiceMonitor
 | 
					kind: ServiceMonitor
 | 
				
			||||||
metadata:
 | 
					metadata:
 | 
				
			||||||
  labels:
 | 
					  labels:
 | 
				
			||||||
    k8s-app: node-exporter
 | 
					    app.kubernetes.io/name: node-exporter
 | 
				
			||||||
 | 
					    app.kubernetes.io/version: v0.18.1
 | 
				
			||||||
  name: node-exporter
 | 
					  name: node-exporter
 | 
				
			||||||
  namespace: monitoring
 | 
					  namespace: monitoring
 | 
				
			||||||
spec:
 | 
					spec:
 | 
				
			||||||
@ -20,7 +21,8 @@ spec:
 | 
				
			|||||||
    scheme: https
 | 
					    scheme: https
 | 
				
			||||||
    tlsConfig:
 | 
					    tlsConfig:
 | 
				
			||||||
      insecureSkipVerify: true
 | 
					      insecureSkipVerify: true
 | 
				
			||||||
  jobLabel: k8s-app
 | 
					  jobLabel: app.kubernetes.io/name
 | 
				
			||||||
  selector:
 | 
					  selector:
 | 
				
			||||||
    matchLabels:
 | 
					    matchLabels:
 | 
				
			||||||
      k8s-app: node-exporter
 | 
					      app.kubernetes.io/name: node-exporter
 | 
				
			||||||
 | 
					      app.kubernetes.io/version: v0.18.1
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user