Skip to content

Recommended configuration

Rob Skillington edited this page Mar 31, 2021 · 1 revision

Kubernetes configuration

It's recommended to use a StatefulSet to load test a scrape based Prometheus backend. To scale up and down load simply increase the replicas up and down as desired.

Here's an example StatefulSet configuration that adds Prometheus scrape annotations:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  annotations:
  labels:
    app: promremotebench
  name: promremotebench
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: promremotebench
  serviceName: promremotebench
  template:
    metadata:
      annotations:
        prometheus.io/port: "4242"
        prometheus.io/scrape: "true"
      labels:
        app: promremotebench
    spec:
      containers:
      - env:
        - name: PROMREMOTEBENCH_SCRAPE_SERVER
          value: 0.0.0.0:4242
        - name: PROMREMOTEBENCH_NUM_HOSTS
          value: "500"
        - name: PROMREMOTEBENCH_INTERVAL
          value: "10"
        - name: PROMREMOTEBENCH_BATCH
          value: "128"
        - name: PROMREMOTEBENCH_LABELS_JSON_ENV
          value: '{"generator":"PROMREMOTEBENCH_POD_NAME"}'
        - name: PROMREMOTEBENCH_POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: PROMREMOTEBENCH_NEW_SERIES_PERCENTAGE
          value: "0.005"
        image: quay.io/m3db/promremotebench@sha256:ed59d180792a12f2e959d49276b587c6de99781663fd2df22e5d31a3ebe9ec8b
        imagePullPolicy: IfNotPresent
        name: promremotebench
        ports:
        - containerPort: 4242
          name: http
          protocol: TCP
      terminationGracePeriodSeconds: 30
Clone this wiki locally