123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- ---
- ###################################################
- # Prometeus Service Account
- ###################################################
- apiVersion: v1
- kind: ServiceAccount
- metadata:
- name: prometheus
- namespace: monitoring
- ---
- ###################################################
- # Prometeus Roles
- ###################################################
- apiVersion: rbac.authorization.k8s.io/v1beta1
- kind: ClusterRole
- metadata:
- name: prometheus
- namespace: monitoring
- rules:
- - apiGroups: [""]
- resources:
- - nodes
- - nodes/proxy
- - services
- - endpoints
- - pods
- verbs: ["get", "list", "watch"]
- - apiGroups:
- - extensions
- resources:
- - ingresses
- verbs: ["get", "list", "watch"]
- - 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: monitoring
- ---
- ###################################################
- # Prometeus Deployment
- ###################################################
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: prometheus
- namespace: monitoring
- labels:
- #name: prometheus
- app: prometheus
- spec:
- replicas: 1
- selector:
- matchLabels:
- app: prometheus
- template:
- metadata:
- labels:
- app: prometheus
- spec:
- serviceAccountName: prometheus
- containers:
- - name: prometheus
- image: prom/prometheus:v2.1.0
- imagePullPolicy: Always
- ports:
- - containerPort: 9090
- protocol: TCP
- volumeMounts:
- - mountPath: "/etc/prometheus"
- name: config-prometheus
- volumes:
- - name: config-prometheus
- configMap:
- name: prometheus-config
- ---
- ###################################################
- # Prometeus Service
- ###################################################
- apiVersion: v1
- kind: Service
- metadata:
- name: prometheus
- namespace: monitoring
- spec:
- type: ClusterIP
- ports:
- - port: 9090
- targetPort: 9090
- selector:
- app: prometheus
|