Skip to content

Instantly share code, notes, and snippets.

@narenarjun
Created July 26, 2023 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save narenarjun/8a5e5785e76c4cc47f736598c4dbc742 to your computer and use it in GitHub Desktop.
Save narenarjun/8a5e5785e76c4cc47f736598c4dbc742 to your computer and use it in GitHub Desktop.
Deploy a batch monitoring stack with Prometheus PushGateway - yaml files
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: grafana
namespace: kube-system
spec:
repo: https://grafana.github.io/helm-charts
chart: grafana
version: 6.58.6
targetNamespace: default
valuesContent: |-
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-operated:9090
access: proxy
isDefault: true
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: prometheus
rules:
- apiGroups:
- ""
resources:
- nodes
- services
- endpoints
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: prometheus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: prometheus
subjects:
- kind: ServiceAccount
name: prometheus
namespace: default
---
apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
labels:
app: prometheus
name: prometheus
spec:
serviceAccountName: prometheus
serviceMonitorSelector:
matchLabels:
app: prometheus-pushgateway
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: metrics-sink
namespace: kube-system
spec:
repo: https://prometheus-community.github.io/helm-charts
chart: prometheus-pushgateway
version: 2.4.0
targetNamespace: default
valuesContent: |-
metrics:
enabled: true
serviceMonitor:
enabled: true
namespace: default
additionalLabels:
app: prometheus-pushgateway
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment