Last active
March 10, 2021 19:46
-
-
Save 46bit/93c34f64eb87cecb84554096a836d6c5 to your computer and use it in GitHub Desktop.
Only scrape york-flood-exporter in https://github.com/grafana/agent/blob/e9bd098ffd09930015173008ffb254018e7333c4/production/kubernetes/agent.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: grafana-agent | |
| namespace: ${NAMESPACE} | |
| --- | |
| kind: ConfigMap | |
| metadata: | |
| name: grafana-agent | |
| namespace: ${NAMESPACE} | |
| apiVersion: v1 | |
| data: | |
| agent.yml: | | |
| prometheus: | |
| configs: | |
| - host_filter: true | |
| name: agent | |
| remote_write: | |
| - basic_auth: | |
| password: ${REMOTE_WRITE_PASSWORD} | |
| username: ${REMOTE_WRITE_USERNAME} | |
| url: ${REMOTE_WRITE_URL} | |
| scrape_configs: | |
| - job_name: river_level_metrics | |
| scheme: https | |
| static_configs: | |
| - targets: | |
| - flood-exporter.k8s.46b.it | |
| metrics_path: /probe | |
| scrape_interval: 180s | |
| params: | |
| target: | |
| - https://environment.data.gov.uk/flood-monitoring/id/stations/L2406.json | |
| global: | |
| scrape_interval: 15s | |
| wal_directory: /var/lib/agent/data | |
| server: | |
| log_level: debug | |
| --- | |
| kind: ConfigMap | |
| metadata: | |
| name: grafana-agent-deployment | |
| namespace: ${NAMESPACE} | |
| apiVersion: v1 | |
| data: | |
| agent.yml: | | |
| prometheus: | |
| configs: | |
| - host_filter: true | |
| name: agent | |
| remote_write: | |
| - basic_auth: | |
| password: ${REMOTE_WRITE_PASSWORD} | |
| username: ${REMOTE_WRITE_USERNAME} | |
| url: ${REMOTE_WRITE_URL} | |
| scrape_configs: | |
| - job_name: river_level_metrics | |
| scheme: https | |
| static_configs: | |
| - targets: | |
| - flood-exporter.k8s.46b.it | |
| metrics_path: /probe | |
| scrape_interval: 180s | |
| params: | |
| target: | |
| - https://environment.data.gov.uk/flood-monitoring/id/stations/L2406.json | |
| global: | |
| scrape_interval: 15s | |
| wal_directory: /var/lib/agent/data | |
| server: | |
| log_level: debug | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1beta1 | |
| kind: ClusterRole | |
| metadata: | |
| name: grafana-agent | |
| rules: | |
| - apiGroups: | |
| - "" | |
| resources: | |
| - nodes | |
| - nodes/proxy | |
| - services | |
| - endpoints | |
| - pods | |
| verbs: | |
| - get | |
| - list | |
| - watch | |
| - nonResourceURLs: | |
| - /metrics | |
| verbs: | |
| - get | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1beta1 | |
| kind: ClusterRoleBinding | |
| metadata: | |
| name: grafana-agent | |
| roleRef: | |
| apiGroup: rbac.authorization.k8s.io | |
| kind: ClusterRole | |
| name: grafana-agent | |
| subjects: | |
| - kind: ServiceAccount | |
| name: grafana-agent | |
| namespace: ${NAMESPACE} | |
| --- | |
| apiVersion: apps/v1 | |
| kind: DaemonSet | |
| metadata: | |
| name: grafana-agent | |
| namespace: ${NAMESPACE} | |
| spec: | |
| minReadySeconds: 10 | |
| selector: | |
| matchLabels: | |
| name: grafana-agent | |
| template: | |
| metadata: | |
| labels: | |
| name: grafana-agent | |
| spec: | |
| containers: | |
| - args: | |
| - -config.file=/etc/agent/agent.yml | |
| - -prometheus.wal-directory=/tmp/agent/data | |
| command: | |
| - /bin/agent | |
| env: | |
| - name: HOSTNAME | |
| valueFrom: | |
| fieldRef: | |
| fieldPath: spec.nodeName | |
| image: grafana/agent:v0.13.0 | |
| imagePullPolicy: IfNotPresent | |
| name: agent | |
| ports: | |
| - containerPort: 80 | |
| name: http-metrics | |
| securityContext: | |
| privileged: true | |
| runAsUser: 0 | |
| volumeMounts: | |
| - mountPath: /etc/agent | |
| name: grafana-agent | |
| serviceAccount: grafana-agent | |
| tolerations: | |
| - effect: NoSchedule | |
| operator: Exists | |
| volumes: | |
| - configMap: | |
| name: grafana-agent | |
| name: grafana-agent | |
| updateStrategy: | |
| type: RollingUpdate | |
| --- | |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: grafana-agent-deployment | |
| namespace: ${NAMESPACE} | |
| spec: | |
| minReadySeconds: 10 | |
| replicas: 1 | |
| revisionHistoryLimit: 10 | |
| selector: | |
| matchLabels: | |
| name: grafana-agent-deployment | |
| template: | |
| metadata: | |
| labels: | |
| name: grafana-agent-deployment | |
| spec: | |
| containers: | |
| - args: | |
| - -config.file=/etc/agent/agent.yml | |
| - -prometheus.wal-directory=/tmp/agent/data | |
| command: | |
| - /bin/agent | |
| env: | |
| - name: HOSTNAME | |
| valueFrom: | |
| fieldRef: | |
| fieldPath: spec.nodeName | |
| image: grafana/agent:v0.13.0 | |
| imagePullPolicy: IfNotPresent | |
| name: agent | |
| ports: | |
| - containerPort: 80 | |
| name: http-metrics | |
| securityContext: | |
| privileged: true | |
| runAsUser: 0 | |
| volumeMounts: | |
| - mountPath: /etc/agent | |
| name: grafana-agent-deployment | |
| serviceAccount: grafana-agent | |
| volumes: | |
| - configMap: | |
| name: grafana-agent-deployment | |
| name: grafana-agent-deployment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment