Skip to content

Commit 8197ba6

Browse files
Added empty secretes ,modified newstore function to normal stop if config file is empty.
Signed-off-by: Kushal Shukla <[email protected]>
1 parent beec55f commit 8197ba6

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

prombench/docs/kind.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ If used with the GitHub integration:
116116

117117
2. ### Setting Up Benchmarking Data
118118

119-
When setting up a benchmarking environment, it’s often useful to have pre-generated data available. This data can help speed up testing and make benchmarks more realistic by simulating actual workloads.
119+
When setting up a benchmarking environment, it’s often useful to have pre-generated data available.This data can help speed up testing and make benchmarks more realistic by simulating actual workloads.
120120

121121
In this setup, you have two choices:
122122

@@ -125,14 +125,21 @@ Here’s how each option works:
125125

126126
To download data from object storage, create a Kubernetes secret with exact named `bucket-config` and file name ```object-config.yml``` with the necessary credentials as per your object storage. This secret enables access to the stored data.
127127
> Note: Make sure this secret applied before ```3b_prometheus-test_deployment.yaml```
128-
- **Option 2: Skip downloading data**
129-
130-
If you don’t need to download data, edit the `3b_prometheus-test_deployment.yaml` file:
131128
132-
- Remove the `bucket-config` volume section from.
133-
- Remove the `volumeMount` section name `bucket-config` from `data-downloader`.
134-
> Note: You have to remove these two sections from both prometheus-test-pr-{{ .PR_NUMBER }} and prometheus-test-{{ normalise .RELEASE }} deployments.
129+
- **Option 2: Skip downloading data**
135130

131+
If you don’t Want to Download data create an empty secret like this -
132+
133+
```yaml
134+
# Empty Secret to Skip Downloading Data
135+
apiVersion: v1
136+
kind: Secret
137+
metadata:
138+
name: bucket-secret
139+
namespace: prombench-{{ .PR_NUMBER }}
140+
type: Opaque
141+
stringData:
142+
object-config.yml:
136143
3. Deploy the Kubernetes objects:
137144
> **_Note:_** If you encounter a `too many files open` error caused by promtail, increase the default value of `/proc/sys/fs/inotify/max_user_instances` from 128 to 512:
138145
> ```bash

tools/block-sync/upload_download.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ func newStore(tsdbPath, objectConfig, objectKey string, logger *slog.Logger) (*S
3838
if err != nil {
3939
return nil, fmt.Errorf("failed to read config file: %w", err)
4040
}
41+
if len(configBytes) == 0 {
42+
fmt.Println("Config file is empty, exiting container.")
43+
os.Exit(0)
44+
}
4145

4246
bucket, err := client.NewBucket(log.NewNopLogger(), configBytes, "block-sync")
4347
if err != nil {

0 commit comments

Comments
 (0)