this repo hosts the configuration manifests to deploy a minimal cortex
setup to kubernetes.
it is based on the single-process cortex config and configured to have minio
as a backend store
create a kubernetes cluster if you haven't
kind create cluster
install cortex
and minio
to the kubernetes cluster:
kubectl apply -f generated.yaml
this will also launch a pod to create a respective bucket in minio.
port-forward the cortex api:
kubectl port-forward deployment/cortex 9009
create an example rule group:
curl --location 'http://localhost:9009/api/v1/rules/ns1' \
--header 'Content-Type: application/yaml' \
--header 'X-Scope-OrgID: f00bar' \
--data 'name: rule1
rules:
- record: instance_path:request_failures:rate5m
expr: rate(request_failures_total{job="myjob"}[5m])
- alert: HighCPUUtilization
expr: avg(node_cpu{mode="system"}) > 80
for: 5m
annotations:
annotation_name: test
labels:
label_name: test'
{"status":"success","data":null,"errorType":"","error":""}
cue dump ./... > generated.yaml
cue export --out yaml -e service.minio -e deployment.minio ./minio | kubectl apply -f -
cue export --out yaml -e configMap.cortex -e deployment.cortex ./cortex | kubectl apply -f -
port-forward the minio api:
kubectl port-forward deployment/minio 9000
download the minio client (mc) and create the cortex
bucket:
./mc alias set local http://localhost:9000 minioadmin minioadmin
./mc mb local/cortex
./mc tree local/