diff --git a/cloud_computing_helm/templates/prometheus-claim0-persistentvolumeclaim.yaml b/cloud_computing_helm/templates/prometheus-claim0-persistentvolumeclaim.yaml deleted file mode 100644 index 282635cba364f056d6274ef549e8eab8e403d7a2..0000000000000000000000000000000000000000 --- a/cloud_computing_helm/templates/prometheus-claim0-persistentvolumeclaim.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - creationTimestamp: null - labels: - io.kompose.service: prometheus-claim0 - name: prometheus-claim0 -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Mi -status: {} diff --git a/cloud_computing_helm/templates/prometheus-configmap.yaml b/cloud_computing_helm/templates/prometheus-configmap.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c9ce4e3dd49e10122f0ff43707c10759727c64e4 --- /dev/null +++ b/cloud_computing_helm/templates/prometheus-configmap.yaml @@ -0,0 +1,79 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: prometheus-configmap + labels: + io.kompose.service: prometheus-configmap + +data: + prometheus.yml: | + global: + scrape_interval: 15s # By default, scrape targets every 15 seconds. + + # Attach these labels to any time series or alerts when communicating with + # external systems (federation, remote storage, Alertmanager). + external_labels: + monitor: 'codelab-monitor' + + # Prometheus configuration of targets which will be scraped + scrape_configs: + + - job_name: 'chatroom' + honor_labels: true + scrape_interval: 5s + # scheme: https + static_configs: + - targets: ['134.103.205.145:3600'] + + - job_name: 'server-john' + honor_labels: true + scrape_interval: 5s + # scheme: https + static_configs: + - targets: ['134.103.205.145:3601'] + + - job_name: 'server-paul' + honor_labels: true + scrape_interval: 5s + # scheme: https + static_configs: + - targets: ['192.168.0.230:3602'] + + - job_name: 'server-george' + honor_labels: true + scrape_interval: 5s + # scheme: https + static_configs: + - targets: ['134.103.205.145:3603'] + + - job_name: 'server-ringo' + honor_labels: true + scrape_interval: 5s + # scheme: https + static_configs: + - targets: ['134.103.205.145:3604'] + + + # Chat server application + # - job_name: 'chatroom' + # honor_labels: true + # scrape_interval: 5s + # # scheme: https + # static_configs: + # - targets: ['192.168.0.230:80'] + + # Node-exporter + - job_name: 'node-exporter' + honor_labels: true + scrape_interval: 5s + # scheme: https + static_configs: + - targets: ['192.168.0.230:9100'] + + # MongoDB-exporter + - job_name: 'mongodb-exporter' + honor_labels: true + scrape_interval: 5s + #scheme: https + static_configs: + - targets: ['192.168.0.230:9216'] \ No newline at end of file diff --git a/cloud_computing_helm/templates/prometheus-deployment.yaml b/cloud_computing_helm/templates/prometheus-deployment.yaml index f9e6b2e006af25c3391f88380f2424b62b239e90..b543bbcf1fcf6be234d2cfb24af83bb11c37fbc2 100644 --- a/cloud_computing_helm/templates/prometheus-deployment.yaml +++ b/cloud_computing_helm/templates/prometheus-deployment.yaml @@ -34,14 +34,14 @@ spec: resources: {} volumeMounts: - mountPath: /etc/prometheus - name: prometheus-claim0 + name: prometheus-configmap - mountPath: /prometheus name: prometheus-data restartPolicy: Always volumes: - - name: prometheus-claim0 - persistentVolumeClaim: - claimName: prometheus-claim0 + - name: prometheus-configmap + configMap: + name: prometheus-configmap - name: prometheus-data persistentVolumeClaim: claimName: prometheus-data