mirror of
				https://github.com/carlosedp/cluster-monitoring.git
				synced 2025-10-26 10:23:04 +01:00 
			
		
		
		
	Regenerate manifests
This commit is contained in:
		
							parent
							
								
									afd3dbcd64
								
							
						
					
					
						commit
						f2bbdfec98
					
				
							
								
								
									
										73
									
								
								manifests/elasticexporter-deployment.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								manifests/elasticexporter-deployment.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,73 @@
 | 
			
		||||
apiVersion: apps/v1beta2
 | 
			
		||||
kind: Deployment
 | 
			
		||||
metadata:
 | 
			
		||||
  labels:
 | 
			
		||||
    k8s-app: elasticsearch-exporter
 | 
			
		||||
  name: elasticsearch-exporter
 | 
			
		||||
  namespace: monitoring
 | 
			
		||||
spec:
 | 
			
		||||
  replicas: 1
 | 
			
		||||
  selector:
 | 
			
		||||
    matchLabels:
 | 
			
		||||
      k8s-app: elasticsearch-exporter
 | 
			
		||||
  strategy:
 | 
			
		||||
    rollingUpdate:
 | 
			
		||||
      maxSurge: 1
 | 
			
		||||
      maxUnavailable: 0
 | 
			
		||||
    type: RollingUpdate
 | 
			
		||||
  template:
 | 
			
		||||
    metadata:
 | 
			
		||||
      labels:
 | 
			
		||||
        k8s-app: elasticsearch-exporter
 | 
			
		||||
    spec:
 | 
			
		||||
      containers:
 | 
			
		||||
      - command:
 | 
			
		||||
        - /bin/elasticsearch_exporter
 | 
			
		||||
        - -es.uri=http://elasticsearch.logging.svc:9200
 | 
			
		||||
        - -es.timeout=60s
 | 
			
		||||
        - -es.all=true
 | 
			
		||||
        image: carlosedp/elasticsearch-exporter:1.0.4rc1
 | 
			
		||||
        livenessProbe:
 | 
			
		||||
          httpGet:
 | 
			
		||||
            path: /health
 | 
			
		||||
            port: 9108
 | 
			
		||||
          initialDelaySeconds: 30
 | 
			
		||||
          timeoutSeconds: 10
 | 
			
		||||
        name: elasticsearch-exporter
 | 
			
		||||
        ports:
 | 
			
		||||
        - containerPort: 9108
 | 
			
		||||
          name: es-metrics
 | 
			
		||||
        readinessProbe:
 | 
			
		||||
          httpGet:
 | 
			
		||||
            path: /health
 | 
			
		||||
            port: 9108
 | 
			
		||||
          initialDelaySeconds: 30
 | 
			
		||||
          timeoutSeconds: 10
 | 
			
		||||
        resources:
 | 
			
		||||
          limits:
 | 
			
		||||
            cpu: 100m
 | 
			
		||||
            memory: 128Mi
 | 
			
		||||
          requests:
 | 
			
		||||
            cpu: 25m
 | 
			
		||||
            memory: 64Mi
 | 
			
		||||
        securityContext:
 | 
			
		||||
          capabilities:
 | 
			
		||||
            drop:
 | 
			
		||||
            - SETPCAP
 | 
			
		||||
            - MKNOD
 | 
			
		||||
            - AUDIT_WRITE
 | 
			
		||||
            - CHOWN
 | 
			
		||||
            - NET_RAW
 | 
			
		||||
            - DAC_OVERRIDE
 | 
			
		||||
            - FOWNER
 | 
			
		||||
            - FSETID
 | 
			
		||||
            - KILL
 | 
			
		||||
            - SETGID
 | 
			
		||||
            - SETUID
 | 
			
		||||
            - NET_BIND_SERVICE
 | 
			
		||||
            - SYS_CHROOT
 | 
			
		||||
            - SETFCAP
 | 
			
		||||
          readOnlyRootFilesystem: "true"
 | 
			
		||||
          runAsNonRoot: true
 | 
			
		||||
          runAsUser: 1000
 | 
			
		||||
      restartPolicy: Always
 | 
			
		||||
							
								
								
									
										14
									
								
								manifests/elasticexporter-service.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								manifests/elasticexporter-service.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: Service
 | 
			
		||||
metadata:
 | 
			
		||||
  labels:
 | 
			
		||||
    k8s-app: elasticsearch-exporter
 | 
			
		||||
  name: elasticsearch-exporter
 | 
			
		||||
  namespace: monitoring
 | 
			
		||||
spec:
 | 
			
		||||
  ports:
 | 
			
		||||
  - name: es-metrics
 | 
			
		||||
    port: 9108
 | 
			
		||||
    targetPort: es-metrics
 | 
			
		||||
  selector:
 | 
			
		||||
    k8s-app: elasticsearch-exporter
 | 
			
		||||
							
								
								
									
										19
									
								
								manifests/elasticexporter-serviceMonitorElastic.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								manifests/elasticexporter-serviceMonitorElastic.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
			
		||||
apiVersion: monitoring.coreos.com/v1
 | 
			
		||||
kind: ServiceMonitor
 | 
			
		||||
metadata:
 | 
			
		||||
  labels:
 | 
			
		||||
    k8s-app: elasticsearch-exporter
 | 
			
		||||
  name: elasticsearch-exporter
 | 
			
		||||
  namespace: monitoring
 | 
			
		||||
spec:
 | 
			
		||||
  endpoints:
 | 
			
		||||
  - interval: 30s
 | 
			
		||||
    port: es-metrics
 | 
			
		||||
    scheme: http
 | 
			
		||||
  jobLabel: k8s-app
 | 
			
		||||
  namespaceSelector:
 | 
			
		||||
    matchNames:
 | 
			
		||||
    - monitoring
 | 
			
		||||
  selector:
 | 
			
		||||
    matchLabels:
 | 
			
		||||
      k8s-app: elasticsearch-exporter
 | 
			
		||||
							
								
								
									
										19
									
								
								manifests/elasticexporter-serviceMonitorFluentd.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								manifests/elasticexporter-serviceMonitorFluentd.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
			
		||||
apiVersion: monitoring.coreos.com/v1
 | 
			
		||||
kind: ServiceMonitor
 | 
			
		||||
metadata:
 | 
			
		||||
  labels:
 | 
			
		||||
    k8s-app: fluentd-es
 | 
			
		||||
  name: fluentd-es
 | 
			
		||||
  namespace: monitoring
 | 
			
		||||
spec:
 | 
			
		||||
  endpoints:
 | 
			
		||||
  - interval: 30s
 | 
			
		||||
    port: metrics
 | 
			
		||||
    scheme: http
 | 
			
		||||
  jobLabel: k8s-app
 | 
			
		||||
  namespaceSelector:
 | 
			
		||||
    matchNames:
 | 
			
		||||
    - logging
 | 
			
		||||
  selector:
 | 
			
		||||
    matchLabels:
 | 
			
		||||
      k8s-app: fluentd-es
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -42,9 +42,15 @@ spec:
 | 
			
		||||
        - mountPath: /etc/grafana/provisioning/dashboards
 | 
			
		||||
          name: grafana-dashboards
 | 
			
		||||
          readOnly: false
 | 
			
		||||
        - mountPath: /grafana-dashboard-definitions/0/apc-ups-dashboard
 | 
			
		||||
          name: grafana-dashboard-apc-ups-dashboard
 | 
			
		||||
          readOnly: false
 | 
			
		||||
        - mountPath: /grafana-dashboard-definitions/0/coredns-dashboard
 | 
			
		||||
          name: grafana-dashboard-coredns-dashboard
 | 
			
		||||
          readOnly: false
 | 
			
		||||
        - mountPath: /grafana-dashboard-definitions/0/elasticsearch-dashboard
 | 
			
		||||
          name: grafana-dashboard-elasticsearch-dashboard
 | 
			
		||||
          readOnly: false
 | 
			
		||||
        - mountPath: /grafana-dashboard-definitions/0/k8s-cluster-rsrc-use
 | 
			
		||||
          name: grafana-dashboard-k8s-cluster-rsrc-use
 | 
			
		||||
          readOnly: false
 | 
			
		||||
@ -100,9 +106,15 @@ spec:
 | 
			
		||||
      - configMap:
 | 
			
		||||
          name: grafana-dashboards
 | 
			
		||||
        name: grafana-dashboards
 | 
			
		||||
      - configMap:
 | 
			
		||||
          name: grafana-dashboard-apc-ups-dashboard
 | 
			
		||||
        name: grafana-dashboard-apc-ups-dashboard
 | 
			
		||||
      - configMap:
 | 
			
		||||
          name: grafana-dashboard-coredns-dashboard
 | 
			
		||||
        name: grafana-dashboard-coredns-dashboard
 | 
			
		||||
      - configMap:
 | 
			
		||||
          name: grafana-dashboard-elasticsearch-dashboard
 | 
			
		||||
        name: grafana-dashboard-elasticsearch-dashboard
 | 
			
		||||
      - configMap:
 | 
			
		||||
          name: grafana-dashboard-k8s-cluster-rsrc-use
 | 
			
		||||
        name: grafana-dashboard-k8s-cluster-rsrc-use
 | 
			
		||||
 | 
			
		||||
@ -74,8 +74,10 @@ spec:
 | 
			
		||||
        runAsUser: 65534
 | 
			
		||||
      serviceAccountName: node-exporter
 | 
			
		||||
      tolerations:
 | 
			
		||||
      - effect: NoExecute
 | 
			
		||||
        operator: Exists
 | 
			
		||||
      - effect: NoSchedule
 | 
			
		||||
        key: node-role.kubernetes.io/master
 | 
			
		||||
        operator: Exists
 | 
			
		||||
      volumes:
 | 
			
		||||
      - hostPath:
 | 
			
		||||
          path: /proc
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
apiVersion: apiregistration.k8s.io/v1beta1
 | 
			
		||||
apiVersion: apiregistration.k8s.io/v1
 | 
			
		||||
kind: APIService
 | 
			
		||||
metadata:
 | 
			
		||||
  name: v1beta1.metrics.k8s.io
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1
 | 
			
		||||
kind: ClusterRoleBinding
 | 
			
		||||
metadata:
 | 
			
		||||
  name: prometheus-adapter
 | 
			
		||||
  namespace: monitoring
 | 
			
		||||
roleRef:
 | 
			
		||||
  apiGroup: rbac.authorization.k8s.io
 | 
			
		||||
  kind: ClusterRole
 | 
			
		||||
 | 
			
		||||
@ -319,6 +319,32 @@ spec:
 | 
			
		||||
    - expr: cluster:node_cpu_seconds_total:rate5m / count(sum(node_cpu_seconds_total)
 | 
			
		||||
        BY (instance, cpu))
 | 
			
		||||
      record: cluster:node_cpu:ratio
 | 
			
		||||
  - name: elasticsearch-k8s-rules
 | 
			
		||||
    rules:
 | 
			
		||||
    - expr: 100 * (elasticsearch_filesystem_data_size_bytes - elasticsearch_filesystem_data_free_bytes)
 | 
			
		||||
        / elasticsearch_filesystem_data_size_bytes
 | 
			
		||||
      record: elasticsearch_filesystem_data_used_percent
 | 
			
		||||
    - expr: 100 - elasticsearch_filesystem_data_used_percent
 | 
			
		||||
      record: elasticsearch_filesystem_data_free_percent
 | 
			
		||||
    - alert: ElasticsearchTooFewNodesRunning
 | 
			
		||||
      annotations:
 | 
			
		||||
        message: There are only {{$value}} < 3 ElasticSearch nodes running
 | 
			
		||||
        runbook_url: https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-elasticsearchtoofewnodesrunning
 | 
			
		||||
        summary: ElasticSearch running on less than 3 nodes
 | 
			
		||||
      expr: elasticsearch_cluster_health_number_of_nodes < 3
 | 
			
		||||
      for: 5m
 | 
			
		||||
      labels:
 | 
			
		||||
        severity: critical
 | 
			
		||||
    - alert: ElasticsearchHeapTooHigh
 | 
			
		||||
      annotations:
 | 
			
		||||
        message: The heap usage is over 90% for 15m
 | 
			
		||||
        runbook_url: https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-elasticsearchheaptoohigh
 | 
			
		||||
        summary: ElasticSearch node {{$labels.node}} heap usage is high
 | 
			
		||||
      expr: elasticsearch_jvm_memory_used_bytes{area="heap"} / elasticsearch_jvm_memory_max_bytes{area="heap"}
 | 
			
		||||
        > 0.9
 | 
			
		||||
      for: 15m
 | 
			
		||||
      labels:
 | 
			
		||||
        severity: critical
 | 
			
		||||
  - name: kubernetes-absent
 | 
			
		||||
    rules:
 | 
			
		||||
    - alert: AlertmanagerDown
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										14
									
								
								manifests/ups-exporter-endpoints.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								manifests/ups-exporter-endpoints.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: Endpoints
 | 
			
		||||
metadata:
 | 
			
		||||
  labels:
 | 
			
		||||
    k8s-app: ups-exporter
 | 
			
		||||
  name: ups-exporter
 | 
			
		||||
  namespace: monitoring
 | 
			
		||||
subsets:
 | 
			
		||||
- addresses:
 | 
			
		||||
  - ip: 192.168.1.62
 | 
			
		||||
  ports:
 | 
			
		||||
  - name: metrics
 | 
			
		||||
    port: 9099
 | 
			
		||||
    protocol: TCP
 | 
			
		||||
							
								
								
									
										14
									
								
								manifests/ups-exporter-service.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								manifests/ups-exporter-service.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: Service
 | 
			
		||||
metadata:
 | 
			
		||||
  labels:
 | 
			
		||||
    k8s-app: ups-exporter
 | 
			
		||||
  name: ups-exporter
 | 
			
		||||
  namespace: monitoring
 | 
			
		||||
spec:
 | 
			
		||||
  clusterIP: None
 | 
			
		||||
  ports:
 | 
			
		||||
  - name: metrics
 | 
			
		||||
    port: 9099
 | 
			
		||||
    targetPort: 9099
 | 
			
		||||
  selector: null
 | 
			
		||||
							
								
								
									
										16
									
								
								manifests/ups-exporter-serviceMonitor.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								manifests/ups-exporter-serviceMonitor.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,16 @@
 | 
			
		||||
apiVersion: monitoring.coreos.com/v1
 | 
			
		||||
kind: ServiceMonitor
 | 
			
		||||
metadata:
 | 
			
		||||
  labels:
 | 
			
		||||
    k8s-app: ups-exporter
 | 
			
		||||
  name: ups-exporter
 | 
			
		||||
  namespace: monitoring
 | 
			
		||||
spec:
 | 
			
		||||
  endpoints:
 | 
			
		||||
  - interval: 30s
 | 
			
		||||
    port: metrics
 | 
			
		||||
    scheme: http
 | 
			
		||||
  jobLabel: k8s-app
 | 
			
		||||
  selector:
 | 
			
		||||
    matchLabels:
 | 
			
		||||
      k8s-app: ups-exporter
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user