/rca-batch

K8s Job to query metrics and save to object storage.

Primary LanguagePython

RCA Batch jobs

Batch job to save metrics data to be used by RCA methods.

The job consists of following steps:

  1. Query Prometheus API for metrics such as CPU usage, memory usage, and network latency.
  2. Format queried metrics into Pandas Dataframe.
  3. Save the Dataframe to S3 bucket or localfile.

Usage

Run Locally

Prerequisite:

  • K8s cluster access via kube config.
  • AWS credentials in ~/.aws/ (for S3).
  • Prometheus API access (defaults at http://localhost:9090).

Prepare env file:

    cp .env.example .env
    vi .env # fill the environmental variables as needed.

Run:

    make install
    make start

Run in Kubernetes

Prerequisite:

  • K8s cluster access via kube config.
  • AWS credentials in ~/.aws/ (for S3).
  • Sealed Secrets controller installed in cluster and cli installed locally.

Prepare env file:

    cp .env.example k8s/overlays/development/.env.k8s
    vi k8s/overlays/development/.env.k8s # fill the environmental variables as needed.

Build Image if needed:

    make ship

Deploy:

    make deploy NAMESPACE=[namespace to deploy to]