Skip to content

Commit

Permalink
operations: Support secret key as param for inspect tool (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipgough authored Aug 10, 2023
1 parent c8bb4a4 commit 68bd804
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion resources/operations/bucket-inspect/cron-job-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ parameters:
value: 'observatorium-operations'
- name: OBJ_STORE_CONFIG_SECRET_NAME
value: 'thanos-bucket-inspect-config'
- name: K8S_SECRET_KEY
value: config.yaml
- name: SCHEDULE
description: The schedule for the Job to run. Defaults to every 12 hours.
value: '0 */12 * * *'
Expand Down Expand Up @@ -52,7 +54,7 @@ objects:
- 'bucket'
- 'inspect'
- '--log.level=${LOG_LEVEL}'
- '--objstore.config-file=/var/lib/thanos/bucket-inspect-config/config.yaml'
- '--objstore.config-file=/var/lib/thanos/bucket-inspect-config/${K8S_SECRET_KEY}'
- '--selector=tenant_id="${TENANT_ID}"'
restartPolicy: Never
volumes:
Expand Down
4 changes: 3 additions & 1 deletion resources/operations/bucket-inspect/job-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ parameters:
value: 'thanos-bucket-inspect-config'
- name: TENANT_ID
value: 'rhobs'
- name: K8S_SECRET_KEY
value: config.yaml
- name: IMAGE_TAG
value: 'v0.31.0'
- name: LOG_LEVEL
Expand Down Expand Up @@ -47,7 +49,7 @@ objects:
- 'bucket'
- 'inspect'
- '--log.level=${LOG_LEVEL}'
- '--objstore.config-file=/var/lib/thanos/bucket-inspect-config/config.yaml'
- '--objstore.config-file=/var/lib/thanos/bucket-inspect-config/${K8S_SECRET_KEY}'
- '--selector=tenant_id="${TENANT_ID}"'
restartPolicy: Never
volumes:
Expand Down
4 changes: 3 additions & 1 deletion resources/operations/bucket-inspect/s3-secret-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ parameters:
value: s3.us-east-1.amazonaws.com
- name: S3_BUCKET_REGION
value: us-east-1
- name: K8S_SECRET_KEY
value: config.yaml
objects:
- apiVersion: v1
kind: Secret
Expand All @@ -31,7 +33,7 @@ objects:
app.kubernetes.io/part-of: observatorium
type: Opaque
stringData:
config.yaml: |
${K8S_SECRET_KEY}: |
type: S3
config:
bucket: ${S3_BUCKET_NAME}
Expand Down

0 comments on commit 68bd804

Please sign in to comment.