squeakywheel/cortex

By squeakywheel

Updated over 4 years ago

Image
0

373

Cortex | Ubuntu

About Cortex

Cortex provides horizontally scalable, highly available, multi-tenant, long term storage for Prometheus.

  • Horizontally scalable: Cortex can run across multiple machines in a cluster, exceeding the throughput and storage of a single machine. This enables you to send the metrics from multiple Prometheus servers to a single Cortex cluster and run "globally aggregated" queries across all data in a single place.
  • Highly available: When run in a cluster, Cortex can replicate data between machines. This allows you to survive machine failure without gaps in your graphs.
  • Multi-tenant: Cortex can isolate data and queries from multiple different independent Prometheus sources in a single cluster, allowing untrusted parties to share the same cluster.
  • Long term storage: Cortex supports Amazon DynamoDB, Google Bigtable, Cassandra, S3, GCS and Microsoft Azure for long term storage of metric data. This allows you to durably store data for longer than the lifetime of any single machine, and use this data for long term capacity planning.

Read more on the Cortex website.

Tags

  • 1.4.0-focal, 1.4.0, 1.4-focal, 1.4, 1-focal, 1, focal, beta - /!\ this is a beta release

Architectures supported

  • amd64, arm64, ppc64el, s390x

Usage

Docker CLI
$ docker run -d --name cortex -p 32709:9009 -e TZ=UTC squeakywheel/cortex:edge

You can verify that cortex is running by visiting http://localhost:32709 .

Parameters

ParameterDescription
-e TZ=UTCTimezone, e.g. Europe/London.
-p 32709:9009Expose cortex on localhost:32709.
-v /my/local/cortex.yaml:/etc/cortex/cortex.yamlMount local configuration file cortex.yaml (download this example file).

Testing/Debugging

In case you need to debug what it is happening with the container you can run docker logs <name_of_the_container>. But if you want to get access to an interactive shell run:

$ docker exec -it <name_of_the_container> /bin/bash
Deploy with Kubernetes

You can use your favorite Kubernetes distribution; if you don't have one, consider installing MicroK8s.

With microk8s running, enable the dns and storage add-ons:

$ microk8s enable dns storage

Use the sample deployment yaml provided here.

Apply the `cortex-deployment.yml` (click to expand)
# cortex-deployment.yml
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cortex-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cortex
  template:
    metadata:
      labels:
        app: cortex
    spec:
      containers:
      - name: cortex
        image: squeakywheel/cortex:edge
        ports:
        - containerPort: 9009
          name: cortex
          protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
  name: cortex-service
spec:
  type: NodePort
  selector:
    app: cortex
  ports:
  - protocol: TCP
    port: 9009
    targetPort: 9009
    nodePort: 32709
    name: cortex
$ microk8s kubectl apply -f cortex-deployment.yml

Bugs and Features request

If you find a bug in our image or want to request a specific feature file a bug here:

https://bugs.launchpad.net/ubuntu-docker-images/+filebug

In the title of the bug add cortex: <reason>.

Make sure to include:

  • The digest of the image you are using, you can find it using this command replacing <tag> with the one you used to run the image:
$ docker images --no-trunc --quiet squeakywheel/cortex:<tag>
  • Reproduction steps for the deployment
  • If it is a feature request, please provide as much detail as possible

Docker Pull Command

docker pull squeakywheel/cortex