Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit acfd2b2

Browse files
committed
Fully switch to S3 service key
1 parent 0ef9c3f commit acfd2b2

4 files changed

Lines changed: 23 additions & 14 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ module "thanos" {
4343

4444
| Name | Version |
4545
|------|---------|
46-
| <a name="provider_cloudfoundry"></a> [cloudfoundry](#provider\_cloudfoundry) | >= 0.15.5 |
47-
| <a name="provider_hsdp"></a> [hsdp](#provider\_hsdp) | >= 0.38.2 |
48-
| <a name="provider_random"></a> [random](#provider\_random) | >= 2.2.1 |
46+
| <a name="provider_cloudfoundry"></a> [cloudfoundry](#provider\_cloudfoundry) | 0.50.8 |
47+
| <a name="provider_hsdp"></a> [hsdp](#provider\_hsdp) | 0.42.1 |
48+
| <a name="provider_random"></a> [random](#provider\_random) | 3.5.1 |
4949

5050
## Modules
5151

docker/supervisord_configs/thanos.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[program:thanos]
2-
command = /sidecars/bin/thanos_s3.sh sidecar --tsdb.path=/prometheus --prometheus.url="http://localhost:9090" --objstore.config-file=/sidecars/etc/bucket_config.yaml --http-address=0.0.0.0:19191 --grpc-address=0.0.0.0:19090
2+
command = /sidecars/bin/thanos_s3_sk.sh sidecar --tsdb.path=/prometheus --prometheus.url="http://localhost:9090" --objstore.config-file=/sidecars/etc/bucket_config.yaml --http-address=0.0.0.0:19191 --grpc-address=0.0.0.0:19090
33
autostart = true
44
autorestart = true
55
startsecs = 5

main.tf

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,21 @@ resource "cloudfoundry_app" "thanos" {
4242
VARIANT_TENANTS = join(",", var.tenants)
4343
VARIANT_SPACES = join(",", var.spaces)
4444
VARIANT_RELOAD = "true"
45-
}, var.environment)
45+
S3_BUCKET = cloudfoundry_service_key.s3.credentials["bucket"]
46+
S3_ENDPOINT = cloudfoundry_service_key.s3.credentials["endpoint"]
47+
S3_API_KEY = cloudfoundry_service_key.s3.credentials["api_key"]
48+
S3_SECRET_KEY = cloudfoundry_service_key.s3.credentials["secret_key"]
49+
S3_URI = cloudfoundry_service_key.s3.credentials["uri"]
50+
},
51+
var.environment)
52+
4653

4754
dynamic "routes" {
4855
for_each = local.thanos_routes
4956
content {
5057
route = routes.value
5158
}
5259
}
53-
//noinspection HCLUnknownBlockType
54-
service_binding {
55-
service_instance = cloudfoundry_service_instance.s3.id
56-
}
5760

5861
dynamic "service_binding" {
5962
for_each = var.thanos_service_bindings

thanos_store.tf

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@ resource "cloudfoundry_app" "thanos_store" {
88
username = var.docker_username
99
password = var.docker_password
1010
}
11-
environment = var.environment
12-
command = "/sidecars/bin/thanos_s3.sh store --grpc-address=0.0.0.0:19090 --http-address=0.0.0.0:9090 --data-dir=/prometheus --index-cache-size=500MB --chunk-pool-size=500MB --objstore.config-file=/sidecars/etc/bucket_config.yaml"
11+
environment = merge(
12+
{
13+
S3_BUCKET = cloudfoundry_service_key.s3.credentials["bucket"]
14+
S3_ENDPOINT = cloudfoundry_service_key.s3.credentials["endpoint"]
15+
S3_API_KEY = cloudfoundry_service_key.s3.credentials["api_key"]
16+
S3_SECRET_KEY = cloudfoundry_service_key.s3.credentials["secret_key"]
17+
S3_URI = cloudfoundry_service_key.s3.credentials["uri"]
18+
},
19+
var.environment
20+
)
21+
command = "/sidecars/bin/thanos_s3_sk.sh store --grpc-address=0.0.0.0:19090 --http-address=0.0.0.0:9090 --data-dir=/prometheus --index-cache-size=500MB --chunk-pool-size=500MB --objstore.config-file=/sidecars/etc/bucket_config.yaml"
1322
routes {
1423
route = cloudfoundry_route.thanos_store_internal.id
1524
}
16-
service_binding {
17-
service_instance = cloudfoundry_service_instance.s3.id
18-
}
1925
dynamic "service_binding" {
2026
for_each = var.thanos_store_service_bindings
2127

0 commit comments

Comments
 (0)