Skip to content

Update docs: kubernetes scrapeconfig example #47

@cbrherms

Description

@cbrherms

Mostly putting this here in case anyone else finds it useful (unsure if this project is still being maintained), but an example of this being used with kube-prometheus-stack in a kubernetes environment using secrets for the api key:

---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/monitoring.coreos.com/scrapeconfig_v1alpha1.json
apiVersion: monitoring.coreos.com/v1alpha1
kind: ScrapeConfig
metadata:
  name: &name octoprint
spec:
  metricsPath: /plugin/prometheus_exporter/metrics
  authorization:
    type: Bearer
    credentials:
      name: scrape-config-secret
      key: octoprint-api-key
  relabelings:
    - action: replace
      replacement: *name
      targetLabel: job
  staticConfigs:
    - targets:
        - "octopi.local:5000"

This references a secret called scrape-config-secret and a key of octoprint-api-key - making using of bearer token instead of params

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions