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

Fix Prometheus PVC Fill Status Call (for basic users) #932

Merged

Conversation

andrewballantyne
Copy link
Member

@andrewballantyne andrewballantyne commented Feb 3, 2023

Resolves: #862

Description

Using the wrong port for simple metrics the user can get.

  • Port 9091 is for users who can see all metrics in the cluster (get namespace permission)
  • Port 9092 is for users who can only get metrics in certain namespaces

How Has This Been Tested?

  • Turn down the ODH operator on your cluster
  • Replace the ODH Dashboard container's image with the one from the PR
  • Log into the Dashboard with your basic user
  • Create a project & workbench -- then view the status of the PVC

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@andrewballantyne andrewballantyne changed the title [WIP] Testing auth issue Fix Prometheus PVC Fill Status Call (for basic users) Feb 15, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Feb 15, 2023
@andrewballantyne andrewballantyne requested review from DaoDaoNoCode and Gkrumbach07 and removed request for maroroman February 15, 2023 21:09
Copy link
Member

@DaoDaoNoCode DaoDaoNoCode left a comment

Choose a reason for hiding this comment

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

lgtm

@DaoDaoNoCode
Copy link
Member

Could you also add ${port} to the end of this host https://github.com/opendatahub-io/odh-dashboard/blob/main/backend/src/utils/prometheusUtils.ts#L89? I just noticed that we didn't use the port in the DEV_MODE so the result will be different when testing locally and remotely because they are using a different port if we don't assign it.

@andrewballantyne
Copy link
Member Author

Could you also add ${port} to the end of this host https://github.com/opendatahub-io/odh-dashboard/blob/main/backend/src/utils/prometheusUtils.ts#L89? I just noticed that we didn't use the port in the DEV_MODE so the result will be different when testing locally and remotely because they are using a different port if we don't assign it.

Pretty sure this doesn't work -- I just tested adding :${port} on the end and it looks like there is an error 500.

    return `https://${instanceName}-${namespace}.apps.${namedHost}:${port}`;

This errors out.

I think because it's a direct api request, this is not going to work.

My logs:

>> [2023-02-17 14:48:24.020 +0000] INFO (6374 on Andrews-MacBook-Pro): Making Prometheus call: https://thanos-querier-openshift-monitoring.apps.{cluster-name}.devcluster.openshift.com:9092/api/v1/query?namespace=andrews-test&query=kubelet_volume_stats_used_bytes{persistentvolumeclaim='solar-predictions'}
...
>> [2023-02-17 14:48:30.523 +0000] ERROR (6374 on Andrews-MacBook-Pro): Failure calling Prometheus. connect ETIMEDOUT {some-ip}:9092

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: DaoDaoNoCode

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit c0f56c1 into opendatahub-io:main Feb 17, 2023
strangiato pushed a commit to strangiato/odh-dashboard that referenced this pull request Oct 18, 2023
@andrewballantyne andrewballantyne deleted the auth-issue branch June 26, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Basic Users Cannot Get PVC Fill Status
3 participants