Skip to content

Commit

Permalink
used Host Path volume to get the data
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalShukla-web committed Sep 17, 2024
1 parent 310bf06 commit c04e4c6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 17 deletions.
6 changes: 6 additions & 0 deletions prombench/manifests/cluster_kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ nodes:
kubeletExtraArgs:
node-labels: "node-name=main-node"
- role: worker
extraMounts:
- hostPath: /home/lenovo/data1
containerPath: /mnt/data
kubeadmConfigPatches:
- |
kind: JoinConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "isolation=prometheus,node-name=prometheus-{{ .PR_NUMBER }}"
- role: worker
extraMounts:
- hostPath: /home/lenovo/data2S
containerPath: /mnt/data
kubeadmConfigPatches:
- |
kind: JoinConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -63,21 +64,23 @@ 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
- name: instance-ssd
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
Expand All @@ -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 }}
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
Expand Down

0 comments on commit c04e4c6

Please sign in to comment.