Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apiVersion: v1
- kind: ServiceAccount
- metadata:
- name: prometheus
- ---
- apiVersion: rbac.authorization.k8s.io/v1beta1
- kind: ClusterRole
- metadata:
- name: prometheus
- rules:
- - apiGroups: [""]
- resources:
- - nodes
- - services
- - endpoints
- - pods
- verbs: ["get", "list", "watch"]
- - apiGroups: [""]
- resources:
- - configmaps
- verbs: ["get"]
- - nonResourceURLs: ["/metrics"]
- verbs: ["get"]
- ---
- apiVersion: rbac.authorization.k8s.io/v1beta1
- kind: ClusterRoleBinding
- metadata:
- name: prometheus
- roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: prometheus
- subjects:
- - kind: ServiceAccount
- name: prometheus
- namespace: default
- ---
- apiVersion: monitoring.coreos.com/v1
- kind: Prometheus
- metadata:
- name: main
- namespace: default
- labels:
- prometheus: main
- spec:
- serviceAccountName: prometheus
- version: v1.7.1
- serviceMonitorSelector:
- matchLabels:
- infra: monitoring
- resources:
- requests:
- # 2Gi is default, but won't schedule if you don't have a node with >2Gi
- # memory. Modify based on your target and time-series count for
- # production use. This value is mainly meant for demonstration/testing
- # purposes.
- memory: 400Mi
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: prometheus
- namespace: default
- spec:
- type: NodePort
- ports:
- - name: web
- nodePort: 30100
- port: 9090
- protocol: TCP
- targetPort: web
- selector:
- prometheus: main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement