Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

THREESCALE-10709 update monitoring stack deployment to use THANOS_QUERIER_BEARER_TOKEN #925

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

austincunningham
Copy link
Contributor

Issue

https://issues.redhat.com/browse/THREESCALE-10709

What

The steps for getting openshift monitoring data in the readme have been out of date for some time
You can no longer use basic auth to scrape data from openshift-monitoring see OCP docs for more information here

updated the 3scale-scrape-configs.yaml to use bearer token
added steps to the Readme to get the THANOS_QUERIER_BEARER_TOKEN

Verification

Provision a 3scale instance from this branch and follow the readme to test the monitoring stack installation.

Copy link
Contributor

@carlkyrillos carlkyrillos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few small comments but overall looks good to me

$ SECRET=`oc get secret -n openshift-user-workload-monitoring | grep prometheus-user-workload-token | head -n 1 | awk '{print $1 }'`
# Get the THANOS_QUERIER_BEARER_TOKEN using the SECRET name
$ oc get secret $SECRET -n openshift-user-workload-monitoring -o jsonpath="{.data.token}" | base64 -d

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Unnecessary extra line looks odd when markdown is rendered.

Get basic auth password `basicAuthPassword` from `ns/openshift-monitoring/secrets/grafana-datasources-v2/prometheus.yaml` and update `3scale-scrape-configs.yaml` basic auth field.
```bash
# Get the SECRET name that contains the THANOS_QUERIER_BEARER_TOKEN
$ SECRET=`oc get secret -n openshift-user-workload-monitoring | grep prometheus-user-workload-token | head -n 1 | awk '{print $1 }'`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ SECRET=`oc get secret -n openshift-user-workload-monitoring | grep prometheus-user-workload-token | head -n 1 | awk '{print $1 }'`
SECRET=`oc get secret -n openshift-user-workload-monitoring | grep prometheus-user-workload-token | head -n 1 | awk '{print $1 }'`

It makes it easier to run the commands if the leading $ is removed.

# Get the SECRET name that contains the THANOS_QUERIER_BEARER_TOKEN
$ SECRET=`oc get secret -n openshift-user-workload-monitoring | grep prometheus-user-workload-token | head -n 1 | awk '{print $1 }'`
# Get the THANOS_QUERIER_BEARER_TOKEN using the SECRET name
$ oc get secret $SECRET -n openshift-user-workload-monitoring -o jsonpath="{.data.token}" | base64 -d
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ oc get secret $SECRET -n openshift-user-workload-monitoring -o jsonpath="{.data.token}" | base64 -d
oc get secret $SECRET -n openshift-user-workload-monitoring -o jsonpath="{.data.token}" | base64 -d

It makes it easier to run the commands if the leading $ is removed.


Then create secret:

```
```bash
kubectl create secret generic additional-scrape-configs --from-file=3scale-scrape-configs.yaml=./3scale-scrape-configs.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kubectl create secret generic additional-scrape-configs --from-file=3scale-scrape-configs.yaml=./3scale-scrape-configs.yaml
oc create secret generic additional-scrape-configs --from-file=3scale-scrape-configs.yaml=./3scale-scrape-configs.yaml

Might be better to use oc here to be consistent throughout

Copy link

codeclimate bot commented Feb 6, 2024

Code Climate has analyzed commit e7a053b and detected 0 issues on this pull request.

View more on Code Climate.

@carlkyrillos
Copy link
Contributor

Reviewed changes
/lgtm

@MStokluska MStokluska self-requested a review February 8, 2024 10:40
@austincunningham austincunningham merged commit d72cc6c into 3scale:master Feb 8, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants