Deploy Thanos on Kubernetes.
- Thanos Version: v0.24.0
- Kubernetes Version: v1.16.9-aliyun.1
- CloudProvider: Alicloud
git clone https://github.com/koktlzz/thanos-k8s-deployment.git
cd thanos-k8s-deployment
kubectl apply -k overlays/aliclound/
git clone https://github.com/coreos/kube-prometheus.git
cd kube-prometheus
kubectl create -f manifests/setup
# wait for namespaces and CRDs to become available, then
kubectl create -f manifests/
Use kubectl edit -n monitoring prometheus k8s
to enable Prometheus remote write:
# local cluster
spec:
remoteWrite:
- url: http://thanos-receiver.thanos.svc.cluster.local:19291/api/v1/receive
# cluster kazusa
spec:
remoteWrite:
- url: http://thanos-receiver.uuid.cn-shanghai.alicontainer.com/api/v1/receive
headers:
THANOS-TENANT: kazusa
# cluster setsuna
spec:
remoteWrite:
- url: http://thanos-receiver.uuid.cn-shanghai.alicontainer.com/api/v1/receive
headers:
THANOS-TENANT: setsuna
Then you can see three tenants in the Thanos Query UI(kubectl get ingress -n thanos | grep querier
):
Achieve Multi-tenancy in Monitoring with Prometheus & Thanos Receiver