Skip to content

Commit

Permalink
Added empty secretes ,modified newstore function to normal stop if co…
Browse files Browse the repository at this point in the history
…nfig file is empty.

Signed-off-by: Kushal Shukla <[email protected]>
  • Loading branch information
kushalShukla-web committed Nov 17, 2024
1 parent beec55f commit 1c39d4f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
22 changes: 15 additions & 7 deletions prombench/docs/kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,30 @@ If used with the GitHub integration:

2. ### Setting Up Benchmarking Data

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.
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.

In this setup, you have two choices:

Here’s how each option works:
- **Option 1: Download data from object storage**

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.
To download data from object storage, create a Kubernetes secret with exact named `bucket-secret` and file name ```object-config.yml``` with the necessary credentials as per your object storage. This secret enables access to the stored data.
> Note: Make sure this secret applied before ```3b_prometheus-test_deployment.yaml```
- **Option 2: Skip downloading data**

If you don’t need to download data, edit the `3b_prometheus-test_deployment.yaml` file:
- **Option 2: Skip downloading data**

- Remove the `bucket-config` volume section from.
- Remove the `volumeMount` section name `bucket-config` from `data-downloader`.
> Note: You have to remove these two sections from both prometheus-test-pr-{{ .PR_NUMBER }} and prometheus-test-{{ normalise .RELEASE }} deployments.
If you don’t Want to Download data create an empty secret like this -

```yaml
# Empty Secret to Skip Downloading Data
apiVersion: v1
kind: Secret
metadata:
name: bucket-secret
namespace: prombench-{{ .PR_NUMBER }}
type: Opaque
stringData:
object-config.yml:
3. Deploy the Kubernetes objects:
> **_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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ 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: config
hostPath:
path: /object-config
- name: bucket-config # Define the Secret volume
secret:
secretName: bucket-secret
Expand Down
4 changes: 4 additions & 0 deletions tools/block-sync/upload_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func newStore(tsdbPath, objectConfig, objectKey string, logger *slog.Logger) (*S
if err != nil {
return nil, fmt.Errorf("failed to read config file: %w", err)
}
if len(configBytes) == 0 {
fmt.Println("Config file is empty, exiting container.")
os.Exit(0)
}

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

0 comments on commit 1c39d4f

Please sign in to comment.