From c04e4c674ee3e1b7bb1e3feb638b781f85af9c08 Mon Sep 17 00:00:00 2001 From: Kushal Shukla Date: Tue, 17 Sep 2024 20:16:17 +0530 Subject: [PATCH] used Host Path volume to get the data --- prombench/manifests/cluster_kind.yaml | 6 +++ .../3a_prometheus-test_configmap.yaml | 6 ++- .../3b_prometheus-test_deployment.yaml | 43 ++++++++++++------- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/prombench/manifests/cluster_kind.yaml b/prombench/manifests/cluster_kind.yaml index 2b9d99042..506e0a68f 100644 --- a/prombench/manifests/cluster_kind.yaml +++ b/prombench/manifests/cluster_kind.yaml @@ -9,6 +9,9 @@ nodes: kubeletExtraArgs: node-labels: "node-name=main-node" - role: worker + extraMounts: + - hostPath: /home/lenovo/data1 + containerPath: /mnt/data kubeadmConfigPatches: - | kind: JoinConfiguration @@ -16,6 +19,9 @@ nodes: kubeletExtraArgs: node-labels: "isolation=prometheus,node-name=prometheus-{{ .PR_NUMBER }}" - role: worker + extraMounts: + - hostPath: /home/lenovo/data2S + containerPath: /mnt/data kubeadmConfigPatches: - | kind: JoinConfiguration diff --git a/prombench/manifests/prombench/benchmark/3a_prometheus-test_configmap.yaml b/prombench/manifests/prombench/benchmark/3a_prometheus-test_configmap.yaml index ad1fb3ba5..d83a83f1b 100644 --- a/prombench/manifests/prombench/benchmark/3a_prometheus-test_configmap.yaml +++ b/prombench/manifests/prombench/benchmark/3a_prometheus-test_configmap.yaml @@ -6,9 +6,13 @@ metadata: data: prometheus.yml: | global: - scrape_interval: 5s + scrape_interval: 5s scrape_configs: + - job_name: 'prometheus' + static_configs: + - targets: ['localhost:9090'] + - job_name: kubelets scheme: https tls_config: diff --git a/prombench/manifests/prombench/benchmark/3b_prometheus-test_deployment.yaml b/prombench/manifests/prombench/benchmark/3b_prometheus-test_deployment.yaml index 44675c2b8..4bb38bc9e 100644 --- a/prombench/manifests/prombench/benchmark/3b_prometheus-test_deployment.yaml +++ b/prombench/manifests/prombench/benchmark/3b_prometheus-test_deployment.yaml @@ -36,11 +36,12 @@ spec: - name: prometheus-builder image: docker.io/prominfra/prometheus-builder:master imagePullPolicy: Always + env: - name: PR_NUMBER value: "{{ .PR_NUMBER }}" - name: VOLUME_DIR - value: "/prometheus-builder" # same as mountPath + value: "/prometheus-builder" - name: GITHUB_ORG value: "{{ .GITHUB_ORG }}" - name: GITHUB_REPO @@ -63,14 +64,6 @@ spec: periodSeconds: 2 failureThreshold: 30 command: ["/usr/bin/prometheus"] - args: [ - "--web.external-url=http://{{ .DOMAIN_NAME }}/{{ .PR_NUMBER }}/prometheus-pr", - "--storage.tsdb.path=/prometheus", - "--web.console.libraries=/usr/bin/console_libraries", - "--web.console.templates=/usr/bin/consoles", - "--config.file=/etc/prometheus/prometheus.yml", - "--log.level=debug" - ] volumeMounts: - name: config-volume mountPath: /etc/prometheus @@ -78,6 +71,16 @@ spec: mountPath: /prometheus - name: prometheus-executable mountPath: /usr/bin + - name: my-data + mountPath: /mnt/downloads + args: [ + "--web.external-url=http://{{ .DOMAIN_NAME }}/{{ .PR_NUMBER }}/prometheus-pr", + "--storage.tsdb.path=/mnt/downloads", + "--web.console.libraries=/usr/bin/console_libraries", + "--web.console.templates=/usr/bin/consoles", + "--config.file=/etc/prometheus/prometheus.yml", + "--log.level=debug" + ] ports: - name: prom-web containerPort: 9090 @@ -90,6 +93,9 @@ spec: path: /mnt/disks/ssd0 #gke ssds - name: prometheus-executable emptyDir: {} + - name: my-data + hostPath: + path: /mnt/data terminationGracePeriodSeconds: 300 nodeSelector: node-name: prometheus-{{ .PR_NUMBER }} @@ -152,19 +158,21 @@ spec: image: quay.io/prometheus/prometheus:{{ .RELEASE }} imagePullPolicy: Always command: [ "/bin/prometheus" ] + volumeMounts: + - name: config-volume + mountPath: /etc/prometheus + - name: instance-ssd + mountPath: /prometheus + - name: my-data + mountPath: /mnt/downloads args: [ "--web.external-url=http://{{ .DOMAIN_NAME }}/{{ .PR_NUMBER }}/prometheus-release", - "--storage.tsdb.path=/prometheus", + "--storage.tsdb.path=/mnt/downloads", "--web.console.libraries=/etc/prometheus/console_libraries", "--web.console.templates=/etc/prometheus/consoles", "--config.file=/etc/prometheus/prometheus.yml", "--log.level=debug" - ] - volumeMounts: - - name: config-volume - mountPath: /etc/prometheus - - name: instance-ssd - mountPath: /prometheus + ] ports: - name: prom-web containerPort: 9090 @@ -177,6 +185,9 @@ spec: # /mnt is where GKE keeps it's SSD # don't change this if you want Prometheus to take advantage of these local SSDs path: /mnt/disks/ssd0 + - name: my-data + hostPath: + path: /mnt/data terminationGracePeriodSeconds: 300 nodeSelector: node-name: prometheus-{{ .PR_NUMBER }}