You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We will need a service account with RBAC permissions for our new Prometheus instances to access service monitors and allow scraping of service endpoints
36
-
In this guide I will use a single service account in two Prometheus instance:
43
+
We'll need `ServiceMonitor` objects to point to our applications. In my guide I generally have one `ServiceMonitor` for each application.
To showcase Thanos, we want to have more than one instance of `Prometheus` running, so that we can demonstrate the sidecar functionality & the global query view that Thanos provides. </br>
49
+
Each service monitor has an extra label which called `prometheus-shard` which indicates which Prometheus instance should scrape it. The manual shards will use this label to manually select services to scrape.
50
+
Two service monitors will be scraped by instance `prometheus-00` and the other two will be scraped by `prometheus-01`.
43
51
44
-
Apply Prometheus instances. </br>
45
-
We can either apply both manual shards, or use a single defined automated shard which will split into two `StatefulSet` objects. In this guide I will keep it simple and use two `Prometheus` instances.
52
+
For automated sharding, the automated shard will select `ServiceMonitor`'s based on label `monitoring` and `Prometheus` will automatically split each of the selected `ServiceMonitor` items into different `StatefulSets` . </br>
53
+
See my Prometheus Sharding video in Kubernetes for more on that. </br>
54
+
55
+
## Create an S3 storage for Thanos
56
+
57
+
Thanos needs an S3 compatible storage for storing its data and long term retention.
58
+
59
+
In this guide I have created a very basic simple S3 storage using [Minio](https://github.com/minio/minio). Please note my example is not a highly available minio instance and not production ready either.
We will need a service account with RBAC permissions for our new Prometheus instances to access service monitors and allow scraping of service endpoints
82
+
In this guide I will use a single service account in two Prometheus instance:
Each service monitor has an extra label which called `prometheus-shard` which indicates which Prometheus instance should scrape it. The manual shards will use this label to manually select services to scrape.
60
-
Two service monitors will be scraped by instance `prometheus-00` and the other two will be scraped by `prometheus-01`.
88
+
To showcase Thanos, we want to have more than one instance of `Prometheus` running, so that we can demonstrate the sidecar functionality & the global query view that Thanos provides. </br>
61
89
62
-
For automated sharding, the automated shard will select `ServiceMonitor`'s based on label `monitoring` and `Prometheus` will automatically split each of the selected `ServiceMonitor` items into different `StatefulSets` . </br>
90
+
We can either apply both manual shards, or use a single defined automated shard which will split into two `StatefulSet` objects. In this guide I will keep it simple and use two `Prometheus` instances.
63
91
64
-
We can now see our Prometheus instances in the `default` namespace:
92
+
To understand Thanos, we'll take a closer look at the `Prometheus` spec in our instances we are going to deploy:
Now that we have applications to monitor and we have `Prometheus` instances scraping these applications in different instances, we can finally implement Thanos into our solution
113
+
Checkout each of the `Prometheus` instances and see our 4 applications sharded to 2 instances evenly. </br>
Thanos needs an S3 compatible storage for storing its data and long term retention.
122
+
Thanos is now enabled on our `Prometheus` instances, which means the sidecars are shipping metrics data from each instance to our S3. </br>
123
+
For us to create a global query service we need to deploy the Thanos Query component which will link up to each Thanos sidecar, using the service created by the Prometheus operator
91
124
92
-
In this guide I have created a very basic simple S3 storage using [Minio](https://github.com/minio/minio). Please note my example is not a highly available minio instance and not production ready either.
0 commit comments