Advertisement
Guest User

grafana-influxdb

a guest
Sep 20th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.31 KB | None | 0 0
  1. influxdb.yaml:
  2.  
  3. apiVersion: apps/v1
  4. kind: Deployment
  5. metadata:
  6. name: monitoring-influxdb
  7. namespace: kube-system
  8. spec:
  9. replicas: 1
  10. selector:
  11. matchLabels:
  12. k8s-app: influxdb
  13. template:
  14. metadata:
  15. labels:
  16. task: monitoring
  17. k8s-app: influxdb
  18. spec:
  19. containers:
  20. - name: influxdb
  21. image: gcr.io/google_containers/heapster-influxdb-amd64:v1.3.3
  22. volumeMounts:
  23. - mountPath: /data
  24. name: influxdb-storage
  25. volumes:
  26. - name: influxdb-storage
  27. emptyDir: {}
  28. ---
  29. apiVersion: v1
  30. kind: Service
  31. metadata:
  32. labels:
  33. task: monitoring
  34. # For use as a Cluster add-on (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons)
  35. # If you are NOT using this as an addon, you should comment out this line.
  36. kubernetes.io/cluster-service: 'true'
  37. kubernetes.io/name: monitoring-influxdb
  38. name: monitoring-influxdb
  39. namespace: kube-system
  40. spec:
  41. ports:
  42. - port: 8086
  43. targetPort: 8086
  44. selector:
  45. k8s-app: influxdb
  46.  
  47.  
  48.  
  49. grafana.yaml:
  50.  
  51. apiVersion: apps/v1
  52. kind: Deployment
  53. metadata:
  54. name: monitoring-grafana
  55. namespace: kube-system
  56. spec:
  57. replicas: 1
  58. selector:
  59. matchLabels:
  60. k8s-app: grafana
  61. template:
  62. metadata:
  63. labels:
  64. task: monitoring
  65. k8s-app: grafana
  66. spec:
  67. containers:
  68. - name: grafana
  69. image: gcr.io/google_containers/heapster-grafana-amd64:v4.4.3
  70. ports:
  71. - containerPort: 3000
  72. protocol: TCP
  73. volumeMounts:
  74. - mountPath: /etc/ssl/certs
  75. name: ca-certificates
  76. readOnly: true
  77. - mountPath: /var
  78. name: grafana-storage
  79. env:
  80. - name: INFLUXDB_HOST
  81. value: monitoring-influxdb
  82. - name: GF_SERVER_HTTP_PORT
  83. value: "3000"
  84. # The following env variables are required to make Grafana accessible via
  85. # the kubernetes api-server proxy. On production clusters, we recommend
  86. # removing these env variables, setup auth for grafana, and expose the grafana
  87. # service using a LoadBalancer or a public IP.
  88. - name: GF_AUTH_BASIC_ENABLED
  89. value: "false"
  90. - name: GF_AUTH_ANONYMOUS_ENABLED
  91. value: "true"
  92. - name: GF_AUTH_ANONYMOUS_ORG_ROLE
  93. value: Admin
  94. - name: GF_SERVER_ROOT_URL
  95. # If you're only using the API Server proxy, set this value instead:
  96. # value: /api/v1/proxy/namespaces/kube-system/services/monitoring-grafana/
  97. value: /
  98. volumes:
  99. - name: ca-certificates
  100. hostPath:
  101. path: /etc/ssl/certs
  102. - name: grafana-storage
  103. emptyDir: {}
  104. ---
  105. apiVersion: v1
  106. kind: Service
  107. metadata:
  108. labels:
  109. # For use as a Cluster add-on (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons)
  110. # If you are NOT using this as an addon, you should comment out this line.
  111. kubernetes.io/cluster-service: 'true'
  112. kubernetes.io/name: monitoring-grafana
  113. name: monitoring-grafana
  114. namespace: kube-system
  115. spec:
  116. # In a production setup, we recommend accessing Grafana through an external Loadbalancer
  117. # or through a public IP.
  118. # type: LoadBalancer
  119. # You could also use NodePort to expose the service at a randomly-generated port
  120. type: NodePort
  121. ports:
  122. - port: 80
  123. targetPort: 3000
  124. selector:
  125. k8s-app: grafana
  126.  
  127.  
  128.  
  129. heapster_with_RBAC.yaml:
  130.  
  131. apiVersion: v1
  132. kind: ServiceAccount
  133. metadata:
  134. name: heapster
  135. namespace: kube-system
  136. ---
  137. apiVersion: apps/v1
  138. kind: Deployment
  139. metadata:
  140. name: heapster
  141. namespace: kube-system
  142. spec:
  143. replicas: 1
  144. selector:
  145. matchLabels:
  146. k8s-app: heapster
  147. template:
  148. metadata:
  149. labels:
  150. task: monitoring
  151. k8s-app: heapster
  152. spec:
  153. serviceAccountName: heapster
  154. containers:
  155. - name: heapster
  156. image: gcr.io/google_containers/heapster-amd64:v1.5.4
  157. imagePullPolicy: IfNotPresent
  158. command:
  159. - /heapster
  160. - --source=kubernetes.summary_api:https://kubernetes.default?kubeletHttps=true&kubeletPort=10250
  161. - --sink=influxdb:http://monitoring-influxdb.kube-system.svc:8086
  162. ---
  163. apiVersion: v1
  164. kind: Service
  165. metadata:
  166. labels:
  167. task: monitoring
  168. # For use as a Cluster add-on (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons)
  169. # If you are NOT using this as an addon, you should comment out this line.
  170. kubernetes.io/cluster-service: 'true'
  171. kubernetes.io/name: Heapster
  172. name: heapster
  173. namespace: kube-system
  174. spec:
  175. ports:
  176. - port: 80
  177. targetPort: 8082
  178. selector:
  179. k8s-app: heapster
  180. ---
  181. kind: ClusterRoleBinding
  182. apiVersion: rbac.authorization.k8s.io/v1
  183. metadata:
  184. name: heapster
  185. roleRef:
  186. apiGroup: rbac.authorization.k8s.io
  187. kind: ClusterRole
  188. name: system:heapster
  189. subjects:
  190. - kind: ServiceAccount
  191. name: heapster
  192. namespace: kube-system
  193.  
  194.  
  195. dashboard-rbac.yaml:
  196.  
  197.  
  198. apiVersion: rbac.authorization.k8s.io/v1beta1
  199. kind: ClusterRoleBinding
  200. metadata:
  201. name: kubernetes-dashboard
  202. labels:
  203. k8s-app: kubernetes-dashboard
  204. roleRef:
  205. apiGroup: rbac.authorization.k8s.io
  206. kind: ClusterRole
  207. name: cluster-admin
  208. subjects:
  209. - kind: ServiceAccount
  210. name: kubernetes-dashboard
  211. namespace: kube-system
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement