-
Create
monitor
namespacekubectl create namespace monitor
-
Create Object Store secret
Example S3 configuration
cat <<'EOF' >> object-store.yaml type: S3 config: endpoint: "s3.eu-west-1.amazonaws.com" bucket: "test-bucket" region: "eu-west-1" access_key: "XXXXXXXXX" secret_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" EOF
-
Deploy the secret on Kubernetes
kubectl create secret generic thanos --from-file=object-store.yaml=object-store.yaml --namespace monitor
-
Create the Thanos sidecar definition Extra configuration for prometheus operator.
Note: Prometheus-operator and Thanos MUST be in the same namespace.
cat <<'EOF' >> thanos-sidecar.yaml prometheus: prometheusSpec: thanos: image: quay.io/thanos/thanos:v0.17.2 version: v0.17.2 objectStorageConfig: name: thanos key: object-store.yaml externalLabels: cluster: thanos-operator-test EOF
Remember to set
externalLabels
as it identifies the Prometheus instance for Thanos.
-
Add the Kubernetes stable Helm repository
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo update
-
Install prometheus-operator with the Thanos sidecar
helm install prometheus-operator --namespace monitor prometheus-community/kube-prometheus-stack -f thanos-sidecar.yaml
-
Add the operator chart repository.
helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm repo update
-
Install the Thanos Operator
helm install thanos-operator --namespace monitor banzaicloud-stable/thanos-operator
One Eye will take care of installing and configuring all the dependencies.
install the One Eye CLI and deploy the Thanos operator
curl https://getoneeye.sh | sh && one-eye thanos install --prometheus --secret one-eye/object-store.yaml
verify the installation by opening the thanos query page
one-eye thanos connect