SHARE
TWEET

Untitled

a guest Mar 21st, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. apiVersion: v1
  2. kind: ServiceAccount
  3. metadata:
  4.   name: prometheus
  5. ---
  6. apiVersion: rbac.authorization.k8s.io/v1beta1
  7. kind: ClusterRole
  8. metadata:
  9.   name: prometheus
  10. rules:
  11. - apiGroups: [""]
  12.   resources:
  13.   - nodes
  14.   - services
  15.   - endpoints
  16.   - pods
  17.   verbs: ["get", "list", "watch"]
  18. - apiGroups: [""]
  19.   resources:
  20.   - configmaps
  21.   verbs: ["get"]
  22. - nonResourceURLs: ["/metrics"]
  23.   verbs: ["get"]
  24. ---
  25. apiVersion: rbac.authorization.k8s.io/v1beta1
  26. kind: ClusterRoleBinding
  27. metadata:
  28.   name: prometheus
  29. roleRef:
  30.   apiGroup: rbac.authorization.k8s.io
  31.   kind: ClusterRole
  32.   name: prometheus
  33. subjects:
  34. - kind: ServiceAccount
  35.   name: prometheus
  36.   namespace: default
  37. ---
  38. apiVersion: monitoring.coreos.com/v1
  39. kind: Prometheus
  40. metadata:
  41.   name: main
  42.   namespace: default
  43.   labels:
  44.     prometheus: main
  45. spec:
  46.   serviceAccountName: prometheus
  47.   version: v1.7.1
  48.   serviceMonitorSelector:
  49.     matchLabels:
  50.       infra: monitoring
  51.   resources:
  52.     requests:
  53.       # 2Gi is default, but won't schedule if you don't have a node with >2Gi
  54.       # memory. Modify based on your target and time-series count for
  55.       # production use. This value is mainly meant for demonstration/testing
  56.       # purposes.
  57.       memory: 400Mi
  58. ---
  59. apiVersion: v1
  60. kind: Service
  61. metadata:
  62.   name: prometheus
  63.   namespace: default
  64. spec:
  65.   type: NodePort
  66.   ports:
  67.   - name: web
  68.     nodePort: 30100
  69.     port: 9090
  70.     protocol: TCP
  71.     targetPort: web
  72.   selector:
  73.     prometheus: main
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top